From 7df8d80508bbc07f8aca79b5aa37e58dfeaa5895 Mon Sep 17 00:00:00 2001 From: Charlie Doern Date: Tue, 2 Aug 2022 11:31:59 -0400 Subject: add omitempty to Secret in k8s VolumeSource Secret was populating a generated kube as `null`. Add omitempty so that when the volume source is not a secret, we do not print unnecessary info resolves #15156 Signed-off-by: Charlie Doern --- pkg/k8s.io/api/core/v1/types.go | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) (limited to 'pkg/k8s.io') diff --git a/pkg/k8s.io/api/core/v1/types.go b/pkg/k8s.io/api/core/v1/types.go index 39a675dae..384965769 100644 --- a/pkg/k8s.io/api/core/v1/types.go +++ b/pkg/k8s.io/api/core/v1/types.go @@ -56,7 +56,8 @@ type VolumeSource struct { // ConfigMap represents a configMap that should populate this volume // +optional ConfigMap *ConfigMapVolumeSource `json:"configMap,omitempty"` - Secret *SecretVolumeSource + // Secret represents a secret that should be mounted as a volume + Secret *SecretVolumeSource `json:"secret,omitempty"` } // PersistentVolumeClaimVolumeSource references the user's PVC in the same namespace. -- cgit v1.2.3-54-g00ecf