diff --git a/apis/generators/v1alpha1/generator_github.go b/apis/generators/v1alpha1/generator_github.go index 14815f763..7737797e8 100644 --- a/apis/generators/v1alpha1/generator_github.go +++ b/apis/generators/v1alpha1/generator_github.go @@ -30,7 +30,7 @@ type GithubAccessTokenSpec struct { } type GithubAuth struct { - PrivatKey GithubSecretRef `json:"privatKey"` + PrivateKey GithubSecretRef `json:"privateKey"` } type GithubSecretRef struct { diff --git a/apis/generators/v1alpha1/zz_generated.deepcopy.go b/apis/generators/v1alpha1/zz_generated.deepcopy.go index b71166d4b..02e592913 100644 --- a/apis/generators/v1alpha1/zz_generated.deepcopy.go +++ b/apis/generators/v1alpha1/zz_generated.deepcopy.go @@ -643,7 +643,7 @@ func (in *GithubAccessTokenSpec) DeepCopy() *GithubAccessTokenSpec { // DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. func (in *GithubAuth) DeepCopyInto(out *GithubAuth) { *out = *in - in.PrivatKey.DeepCopyInto(&out.PrivatKey) + in.PrivateKey.DeepCopyInto(&out.PrivateKey) } // DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new GithubAuth. diff --git a/config/crds/bases/generators.external-secrets.io_githubaccesstokens.yaml b/config/crds/bases/generators.external-secrets.io_githubaccesstokens.yaml index c2f2ea182..c9d6eeb5e 100644 --- a/config/crds/bases/generators.external-secrets.io_githubaccesstokens.yaml +++ b/config/crds/bases/generators.external-secrets.io_githubaccesstokens.yaml @@ -48,7 +48,7 @@ spec: auth: description: Auth configures how ESO authenticates with a Github instance. properties: - privatKey: + privateKey: properties: secretRef: description: |- @@ -74,7 +74,7 @@ spec: - secretRef type: object required: - - privatKey + - privateKey type: object installID: type: string diff --git a/deploy/crds/bundle.yaml b/deploy/crds/bundle.yaml index 5cf1dd7e9..29489d089 100644 --- a/deploy/crds/bundle.yaml +++ b/deploy/crds/bundle.yaml @@ -11066,7 +11066,7 @@ spec: auth: description: Auth configures how ESO authenticates with a Github instance. properties: - privatKey: + privateKey: properties: secretRef: description: |- @@ -11091,7 +11091,7 @@ spec: - secretRef type: object required: - - privatKey + - privateKey type: object installID: type: string diff --git a/docs/snippets/generator-github.yaml b/docs/snippets/generator-github.yaml index 4a1f00c00..9b77852a1 100644 --- a/docs/snippets/generator-github.yaml +++ b/docs/snippets/generator-github.yaml @@ -14,7 +14,7 @@ spec: installID: "00000000" # (5) url: "" # (Default https://api.github.com.) auth: - privatKey: + privateKey: secretRef: name: github-app-pem # (2) key: key diff --git a/pkg/generator/github/github.go b/pkg/generator/github/github.go index 4859776fb..08af9de33 100644 --- a/pkg/generator/github/github.go +++ b/pkg/generator/github/github.go @@ -127,11 +127,11 @@ func newGHClient(ctx context.Context, k client.Client, n string, hc *http.Client gh.URL = res.Spec.URL + ghPath } secret := &corev1.Secret{} - if err := gh.Kube.Get(ctx, client.ObjectKey{Name: res.Spec.Auth.PrivatKey.SecretRef.Name, Namespace: n}, secret); err != nil { + if err := gh.Kube.Get(ctx, client.ObjectKey{Name: res.Spec.Auth.PrivateKey.SecretRef.Name, Namespace: n}, secret); err != nil { return nil, fmt.Errorf("error getting GH pem from secret:%w", err) } - pk, err := jwt.ParseRSAPrivateKeyFromPEM(secret.Data[res.Spec.Auth.PrivatKey.SecretRef.Key]) + pk, err := jwt.ParseRSAPrivateKeyFromPEM(secret.Data[res.Spec.Auth.PrivateKey.SecretRef.Key]) if err != nil { return nil, fmt.Errorf("error parsing RSA private key: %w", err) } diff --git a/pkg/generator/github/github_test.go b/pkg/generator/github/github_test.go index 665c2b862..4395ad1bc 100644 --- a/pkg/generator/github/github_test.go +++ b/pkg/generator/github/github_test.go @@ -54,7 +54,7 @@ func TestGenerate(t *testing.T) { namespace string } pem, err := os.ReadFile(tstCrtName) - assert.NoError(t, err, "Should not error when reading privatKey") + assert.NoError(t, err, "Should not error when reading privateKey") validResponce := []byte(`{ "token": "ghs_16C7e42F292c6912E7710c838347Ae178B4a", @@ -93,7 +93,7 @@ func TestGenerate(t *testing.T) { Namespace: "foo", }, Data: map[string][]byte{ - "privatKey": pem, + "privateKey": pem, }, }).Build(), jsonSpec: &apiextensions.JSON{ @@ -104,11 +104,11 @@ spec: installID: "00000000" URL: %q auth: - privatKey: + privateKey: secretRef: name: "testName" namespace: "foo" - key: "privatKey"`, server.URL)), + key: "privateKey"`, server.URL)), }, }, want: map[string][]byte{