From eddf24fe3b52c01e178f6e7a893710aea6f833e1 Mon Sep 17 00:00:00 2001 From: Nick Stogner Date: Tue, 12 Apr 2022 10:36:35 -0400 Subject: [PATCH] Add SecretKeyReference Signed-off-by: Nick Stogner --- apis/meta/reference_types.go | 14 ++++++++++++++ apis/meta/zz_generated.deepcopy.go | 15 +++++++++++++++ 2 files changed, 29 insertions(+) diff --git a/apis/meta/reference_types.go b/apis/meta/reference_types.go index d6e32f6f7..502194961 100644 --- a/apis/meta/reference_types.go +++ b/apis/meta/reference_types.go @@ -54,3 +54,17 @@ type NamespacedObjectKindReference struct { // +optional Namespace string `json:"namespace,omitempty"` } + +// SecretKeyReference contains enough information to locate the referenced Kubernetes Secret object in the same +// namespace. Optionally a key can be specified. +// Use this type instead of core/v1 SecretKeySelector when the Key is optional and the Optional field is not +// applicable. +type SecretKeyReference struct { + // Name of the Secret. + // +required + Name string `json:"name"` + + // Key in the Secret, when not specified an implementation-specific default key is used. + // +optional + Key string `json:"key,omitempty"` +} diff --git a/apis/meta/zz_generated.deepcopy.go b/apis/meta/zz_generated.deepcopy.go index 9cd8e8d10..41860dad0 100644 --- a/apis/meta/zz_generated.deepcopy.go +++ b/apis/meta/zz_generated.deepcopy.go @@ -82,3 +82,18 @@ func (in *ReconcileRequestStatus) DeepCopy() *ReconcileRequestStatus { in.DeepCopyInto(out) return out } + +// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. +func (in *SecretKeyReference) DeepCopyInto(out *SecretKeyReference) { + *out = *in +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new SecretKeyReference. +func (in *SecretKeyReference) DeepCopy() *SecretKeyReference { + if in == nil { + return nil + } + out := new(SecretKeyReference) + in.DeepCopyInto(out) + return out +}