Secrets: Save owner reference fields in secure value db table (#108905)

* Secrets: Save owner reference fields in secure value db table

* Save api group and version separately
This commit is contained in:
Matheus Macabu
2025-07-31 10:42:19 +02:00
committed by GitHub
parent 66bebe94e0
commit 80d7892d6a
19 changed files with 243 additions and 67 deletions
@@ -20,6 +20,18 @@ INSERT INTO {{ .Ident "secret_secure_value" }} (
{{ if .Row.Ref.Valid }}
{{ .Ident "ref" }},
{{ end }}
{{ if .Row.OwnerReferenceAPIGroup.Valid }}
{{ .Ident "owner_reference_api_group" }},
{{ end }}
{{ if .Row.OwnerReferenceAPIVersion.Valid }}
{{ .Ident "owner_reference_api_version" }},
{{ end }}
{{ if .Row.OwnerReferenceKind.Valid }}
{{ .Ident "owner_reference_kind" }},
{{ end }}
{{ if .Row.OwnerReferenceName.Valid }}
{{ .Ident "owner_reference_name" }},
{{ end }}
{{ .Ident "external_id" }}
) VALUES (
{{ .Arg .Row.GUID }},
@@ -43,5 +55,17 @@ INSERT INTO {{ .Ident "secret_secure_value" }} (
{{ if .Row.Ref.Valid }}
{{ .Arg .Row.Ref.String }},
{{ end }}
{{ if .Row.OwnerReferenceAPIGroup.Valid }}
{{ .Arg .Row.OwnerReferenceAPIGroup.String }},
{{ end }}
{{ if .Row.OwnerReferenceAPIVersion.Valid }}
{{ .Arg .Row.OwnerReferenceAPIVersion.String }},
{{ end }}
{{ if .Row.OwnerReferenceKind.Valid }}
{{ .Arg .Row.OwnerReferenceKind.String }},
{{ end }}
{{ if .Row.OwnerReferenceName.Valid }}
{{ .Arg .Row.OwnerReferenceName.String }},
{{ end }}
{{ .Arg .Row.ExternalID }}
);