Skip to content

Commit

Permalink
Change cases from string to type of FieldType
Browse files Browse the repository at this point in the history
Signed-off-by: Sergen Yalçın <[email protected]>
(cherry picked from commit b63f338)
  • Loading branch information
sergenyalcin authored and github-actions[bot] committed Mar 6, 2024
1 parent aa58f1a commit 404ab86
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions pkg/types/field.go
Original file line number Diff line number Diff line change
Expand Up @@ -268,12 +268,12 @@ func NewSensitiveField(g *Builder, cfg *config.Resource, r *resource, sch *schem
return nil, true, nil
}
sfx := "SecretRef"
switch f.FieldType.String() {
case "string", "*string", "map[string]string", "map[string]*string":
cfg.Sensitive.AddFieldPath(fieldPathWithWildcard(f.TerraformPaths), "spec.forProvider."+fieldPathWithWildcard(f.CRDPaths)+sfx)
case "[]string", "[]*string":
switch f.FieldType.(type) {
case *types.Slice:
f.CRDPaths[len(f.CRDPaths)-2] = f.CRDPaths[len(f.CRDPaths)-2] + sfx
cfg.Sensitive.AddFieldPath(fieldPathWithWildcard(f.TerraformPaths), "spec.forProvider."+fieldPathWithWildcard(f.CRDPaths))
default:
cfg.Sensitive.AddFieldPath(fieldPathWithWildcard(f.TerraformPaths), "spec.forProvider."+fieldPathWithWildcard(f.CRDPaths)+sfx)
}
// todo(turkenh): do we need to support other field types as sensitive?
if f.FieldType.String() != "string" && f.FieldType.String() != "*string" && f.FieldType.String() != "[]string" &&
Expand Down

0 comments on commit 404ab86

Please sign in to comment.