From 2f043ecaed5efc52a5f9f7a49f42ab7798a0024a Mon Sep 17 00:00:00 2001 From: Kiyofumi Sano <62272140+Kiyo510@users.noreply.github.com> Date: Sat, 2 Dec 2023 22:53:11 +0900 Subject: [PATCH] Signed-off-by: Kiyo510 (#2919) typo: ref:#2917 Fix typo in ExtermalSecretRewriteTransform --- .../v1beta1/externalsecret_types.go | 4 +- .../v1beta1/zz_generated.deepcopy.go | 32 +++++----- docs/api/spec.md | 64 +++++++++---------- pkg/utils/utils.go | 2 +- pkg/utils/utils_test.go | 4 +- 5 files changed, 53 insertions(+), 53 deletions(-) diff --git a/apis/externalsecrets/v1beta1/externalsecret_types.go b/apis/externalsecrets/v1beta1/externalsecret_types.go index 5415a19e6bd..3d95ffaf716 100644 --- a/apis/externalsecrets/v1beta1/externalsecret_types.go +++ b/apis/externalsecrets/v1beta1/externalsecret_types.go @@ -288,7 +288,7 @@ type ExternalSecretRewrite struct { // Used to apply string transformation on the secrets. // The resulting key will be the output of the template applied by the operation. // +optional - Transform *ExtermalSecretRewriteTransform `json:"transform,omitempty"` + Transform *ExternalSecretRewriteTransform `json:"transform,omitempty"` } type ExternalSecretRewriteRegexp struct { @@ -298,7 +298,7 @@ type ExternalSecretRewriteRegexp struct { Target string `json:"target"` } -type ExtermalSecretRewriteTransform struct { +type ExternalSecretRewriteTransform struct { // Used to define the template to apply on the secret name. // `.value ` will specify the secret name in the template. Template string `json:"template"` diff --git a/apis/externalsecrets/v1beta1/zz_generated.deepcopy.go b/apis/externalsecrets/v1beta1/zz_generated.deepcopy.go index e3bad9739f9..bbeb1b9d463 100644 --- a/apis/externalsecrets/v1beta1/zz_generated.deepcopy.go +++ b/apis/externalsecrets/v1beta1/zz_generated.deepcopy.go @@ -846,21 +846,6 @@ func (in *DopplerProvider) DeepCopy() *DopplerProvider { return out } -// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. -func (in *ExtermalSecretRewriteTransform) DeepCopyInto(out *ExtermalSecretRewriteTransform) { - *out = *in -} - -// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new ExtermalSecretRewriteTransform. -func (in *ExtermalSecretRewriteTransform) DeepCopy() *ExtermalSecretRewriteTransform { - if in == nil { - return nil - } - out := new(ExtermalSecretRewriteTransform) - in.DeepCopyInto(out) - return out -} - // DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. func (in *ExternalSecret) DeepCopyInto(out *ExternalSecret) { *out = *in @@ -1064,7 +1049,7 @@ func (in *ExternalSecretRewrite) DeepCopyInto(out *ExternalSecretRewrite) { } if in.Transform != nil { in, out := &in.Transform, &out.Transform - *out = new(ExtermalSecretRewriteTransform) + *out = new(ExternalSecretRewriteTransform) **out = **in } } @@ -1094,6 +1079,21 @@ func (in *ExternalSecretRewriteRegexp) DeepCopy() *ExternalSecretRewriteRegexp { return out } +// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. +func (in *ExternalSecretRewriteTransform) DeepCopyInto(out *ExternalSecretRewriteTransform) { + *out = *in +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new ExternalSecretRewriteTransform. +func (in *ExternalSecretRewriteTransform) DeepCopy() *ExternalSecretRewriteTransform { + if in == nil { + return nil + } + out := new(ExternalSecretRewriteTransform) + in.DeepCopyInto(out) + return out +} + // DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. func (in *ExternalSecretSpec) DeepCopyInto(out *ExternalSecretSpec) { *out = *in diff --git a/docs/api/spec.md b/docs/api/spec.md index 5d093f42ed6..12a76442b30 100644 --- a/docs/api/spec.md +++ b/docs/api/spec.md @@ -2190,36 +2190,6 @@ string -

ExtermalSecretRewriteTransform -

-

-(Appears on: -ExternalSecretRewrite) -

-

-

- - - - - - - - - - - - - -
FieldDescription
-template
- -string - -
-

Used to define the template to apply on the secret name. -.value will specify the secret name in the template.

-

ExternalSecret

@@ -2900,8 +2870,8 @@ The resulting key will be the output of a regexp.ReplaceAll operation.

transform
- -ExtermalSecretRewriteTransform + +ExternalSecretRewriteTransform @@ -2953,6 +2923,36 @@ string +

ExternalSecretRewriteTransform +

+

+(Appears on: +ExternalSecretRewrite) +

+

+

+ + + + + + + + + + + + + +
FieldDescription
+template
+ +string + +
+

Used to define the template to apply on the secret name. +.value will specify the secret name in the template.

+

ExternalSecretSpec

diff --git a/pkg/utils/utils.go b/pkg/utils/utils.go index 9301490005c..d24f17683d9 100644 --- a/pkg/utils/utils.go +++ b/pkg/utils/utils.go @@ -93,7 +93,7 @@ func RewriteRegexp(operation esv1beta1.ExternalSecretRewriteRegexp, in map[strin } // RewriteTransform applies string transformation on each secret key name to rewrite. -func RewriteTransform(operation esv1beta1.ExtermalSecretRewriteTransform, in map[string][]byte) (map[string][]byte, error) { +func RewriteTransform(operation esv1beta1.ExternalSecretRewriteTransform, in map[string][]byte) (map[string][]byte, error) { out := make(map[string][]byte) for key, value := range in { data := map[string][]byte{ diff --git a/pkg/utils/utils_test.go b/pkg/utils/utils_test.go index b0d8e8ac7ea..c1d90289d7a 100644 --- a/pkg/utils/utils_test.go +++ b/pkg/utils/utils_test.go @@ -490,7 +490,7 @@ func TestRewrite(t *testing.T) { }, }, { - Transform: &esv1beta1.ExtermalSecretRewriteTransform{ + Transform: &esv1beta1.ExternalSecretRewriteTransform{ Template: `{{ .value | upper | replace "-" "_" }}`, }, }, @@ -510,7 +510,7 @@ func TestRewrite(t *testing.T) { args: args{ operations: []esv1beta1.ExternalSecretRewrite{ { - Transform: &esv1beta1.ExtermalSecretRewriteTransform{ + Transform: &esv1beta1.ExternalSecretRewriteTransform{ Template: `{{ .value | lower }}`, }, },