1
0
Fork 0
mirror of https://github.com/external-secrets/external-secrets.git synced 2024-12-14 11:57:59 +00:00

Fix typo privatKey in multiple files (#3578)

* Update generators.external-secrets.io_githubaccesstokens.yaml

Fixes https://github.com/external-secrets/external-secrets/issues/3556

Signed-off-by: Idan Adar <iadar@il.ibm.com>

* Update generator_github.go

Signed-off-by: Idan Adar <iadar@il.ibm.com>

* Update github.go

Signed-off-by: Idan Adar <iadar@il.ibm.com>

* Update generator-github.yaml

Signed-off-by: Idan Adar <iadar@il.ibm.com>

* Update github_test.go

Signed-off-by: Idan Adar <iadar@il.ibm.com>

* fix: rename property

Signed-off-by: Moritz Johner <beller.moritz@googlemail.com>

---------

Signed-off-by: Idan Adar <iadar@il.ibm.com>
Signed-off-by: Moritz Johner <beller.moritz@googlemail.com>
Co-authored-by: Moritz Johner <beller.moritz@googlemail.com>
This commit is contained in:
Idan Adar 2024-06-17 12:12:03 +03:00 committed by GitHub
parent f74e08546c
commit e13e09413e
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
7 changed files with 13 additions and 13 deletions

View file

@ -30,7 +30,7 @@ type GithubAccessTokenSpec struct {
}
type GithubAuth struct {
PrivatKey GithubSecretRef `json:"privatKey"`
PrivateKey GithubSecretRef `json:"privateKey"`
}
type GithubSecretRef struct {

View file

@ -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.

View file

@ -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

View file

@ -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

View file

@ -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

View file

@ -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)
}

View file

@ -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{