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

Fixes the unmarshal error for sensitive string type #238

Merged
merged 1 commit into from
Feb 21, 2022

Conversation

sergenyalcin
Copy link
Member

@sergenyalcin sergenyalcin commented Feb 18, 2022

Description of your changes

Fixes #236

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

This PR was tested by creating the resources that have three type as sensitive: string, []string, map[string]string

@sergenyalcin sergenyalcin self-assigned this Feb 18, 2022

// This for loop accesses to value of selectorMap to determine whether the type is map.
func hasMapValue(selectorMap map[string]interface{}) bool {
for _, v := range selectorMap {
Copy link
Collaborator

Choose a reason for hiding this comment

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

nit: As an alternative, we could use reflection here to get map's value type. But still that requires access to map's actual values, which means accessing a MapIterator.

pkg/resource/sensitive.go Outdated Show resolved Hide resolved
pkg/resource/sensitive.go Show resolved Hide resolved
Signed-off-by: Sergen Yalçın <yalcinsergen97@gmail.com>
Copy link
Collaborator

@ulucinar ulucinar left a comment

Choose a reason for hiding this comment

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

LGTM, thanks @sergenyalcin.

@sergenyalcin sergenyalcin merged commit b8a22b6 into crossplane:main Feb 21, 2022
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.

Cannot unmarshal string sensitive fields
2 participants