From dc901ef8a18bfb89e1384e85a0791837bfe26e3d Mon Sep 17 00:00:00 2001 From: Brad Beam Date: Wed, 5 Jan 2022 06:40:47 +0000 Subject: [PATCH] fix: Add additional json tags Not sure if this is really a fix or just bending to the will of controller-gen. When trying to use `konjure.Resources` in a CRD, controller-gen attempts to validate every struct has json tags. Even for private fields ( dumb ). Signed-off-by: Brad Beam --- pkg/api/core/v1beta2/types.go | 2 +- pkg/konjure/resource.go | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/pkg/api/core/v1beta2/types.go b/pkg/api/core/v1beta2/types.go index 4d9df89..f29e600 100644 --- a/pkg/api/core/v1beta2/types.go +++ b/pkg/api/core/v1beta2/types.go @@ -149,7 +149,7 @@ type Secret struct { PasswordSources []PasswordRecipe `json:"passwords,omitempty" yaml:"passwords,omitempty"` // Additional configuration for generating passwords. - PasswordOptions *password.GeneratorInput `json:"passwordOptions,omitempty" yaml:"passwordOptions,omitempty"` + PasswordOptions *password.GeneratorInput `json:"-" yaml:"-"` } // Git is used to expand full or partial Git repositories. diff --git a/pkg/konjure/resource.go b/pkg/konjure/resource.go index 1d4ac6c..405a6e7 100644 --- a/pkg/konjure/resource.go +++ b/pkg/konjure/resource.go @@ -44,10 +44,10 @@ type Resource struct { File *konjurev1beta2.File `json:"file,omitempty" yaml:"file,omitempty"` // Some specs (default reader, `data:` URLs, inline resources) resolve to a stream. - raw kio.Reader // NOTE: when this is non-nil there MUST be a value for `str`! + raw kio.Reader `json:"-"` // NOTE: when this is non-nil there MUST be a value for `str`! // Original string representation this resource was parsed from. - str string + str string `json:"-"` } // NewResource returns a resource for parsing the supplied resource specifications. This