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

Use pointer for secret ref if optional #149

Merged
merged 1 commit into from
Nov 18, 2021

Conversation

turkenh
Copy link
Member

@turkenh turkenh commented Nov 17, 2021

Description of your changes

Fixes #118

I have:

  • Read and followed Crossplane's contribution process.
  • Run make reviewable to ensure this PR is ready for review.
  • Added backport release-x.y labels to auto-backport this PR if necessary.

How has this code been tested

Tested with gcp compute instance which also has the same problem described in #118

@turkenh turkenh requested review from muvaf and ulucinar November 17, 2021 15:56
tfTag = "-"
fieldType = typeSecretKeySelector
jsonTag = fmt.Sprintf("%s", NewNameFromCamel(fieldNameCamel).LowerCamelComputed)
if sch.Optional {
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Don't we need to skip here if the value of that pointer is nil?

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

No, because expandWildcards method here, does only return paths that are available in the spec.

Closes crossplane#118

Signed-off-by: Hasan Turken <turkenh@gmail.com>
@turkenh turkenh force-pushed the fix-optional-secrets branch from dbfacf6 to 514ee85 Compare November 18, 2021 09:37
@turkenh turkenh requested a review from muvaf November 18, 2021 09:52
Copy link
Member

@muvaf muvaf left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks @turkenh !

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Optional Secret References Are Always Resolved
2 participants