Skip to content
This repository has been archived by the owner on Dec 15, 2022. It is now read-only.

Inconsistent casing of 'JSON' when generating new struct with a sensitive field #251

Closed
AaronME opened this issue Mar 4, 2022 · 0 comments · Fixed by #255
Closed

Inconsistent casing of 'JSON' when generating new struct with a sensitive field #251

AaronME opened this issue Mar 4, 2022 · 0 comments · Fixed by #255
Labels
bug Something isn't working

Comments

@AaronME
Copy link

AaronME commented Mar 4, 2022

What happened?

I have a sensitive field called data_json in the upstream terraform resource.

When running code generation, this is converted into a sensitive field like so:

type SecretParameters struct {

	// JSON-encoded secret data to write.
	// +kubebuilder:validation:Required
	DataJSONSecretRef v1.SecretKeySelector `json:"dataJsonSecretRef" tf:"-"`
}

This creates a GetConnectionDetailsMapping like this:

// GetConnectionDetailsMapping for this Secret
func (tr *Secret) GetConnectionDetailsMapping() map[string]string {
	return map[string]string{"data": "status.atProvider.data", "data_json": "spec.forProvider.dataJSONSecretRef"}
}

This results in the error:

        The argument "data_json" is required, but no definition was found.

The error clears when changing the mapping to spec.forProvider.dataJsonSecretRef.

How can we reproduce it?

It would most likely affect any field which contained _json in the name

@AaronME AaronME added the bug Something isn't working label Mar 4, 2022
turkenh added a commit to turkenh/terrajet that referenced this issue Mar 7, 2022
Fixes crossplane#251

Signed-off-by: Hasan Turken <turkenh@gmail.com>
@turkenh turkenh mentioned this issue Mar 7, 2022
3 tasks
github-actions bot pushed a commit that referenced this issue Mar 7, 2022
Fixes #251

Signed-off-by: Hasan Turken <turkenh@gmail.com>
(cherry picked from commit dbc7b90)
# for free to subscribe to this conversation on GitHub. Already have an account? #.
Labels
bug Something isn't working
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant