Skip to content

Commit

Permalink
Remove "spec.initProvider." prefix while normalizing JSON path.
Browse files Browse the repository at this point in the history
Signed-off-by: Cem Mergenci <cmergenci@gmail.com>
  • Loading branch information
mergenci committed May 19, 2024
1 parent b5d344b commit 3f1100a
Showing 1 changed file with 8 additions and 1 deletion.
9 changes: 8 additions & 1 deletion pkg/resource/sensitive.go
Original file line number Diff line number Diff line change
Expand Up @@ -353,7 +353,14 @@ func expandedFor(expanded fieldpath.Segments, withWildcard fieldpath.Segments) b
}

func normalizeJSONPath(s string) string {
return strings.TrimPrefix(strings.TrimPrefix(s, "spec.forProvider."), "status.atProvider.")
result := s

prefixes := []string{"spec.forProvider.", "spec.initProvider.", "status.atProvider."}
for _, prefix := range prefixes {
result = strings.TrimPrefix(result, prefix)
}

return result
}

func secretKeyToFieldPath(s string) (string, error) {
Expand Down

0 comments on commit 3f1100a

Please sign in to comment.