From 7add627636cb0dcda4a4f502f2895a0ae09f3714 Mon Sep 17 00:00:00 2001 From: dlorenc Date: Wed, 1 Dec 2021 14:43:03 -0600 Subject: [PATCH] Fix the k8s subject parsing. (#254) This got dropped unintentionally during the interface refactor in #218 and #220. Signed-off-by: Dan Lorenc --- pkg/ca/googleca/v1/googleca.go | 2 ++ pkg/ca/googleca/v1beta1/googleca.go | 2 ++ 2 files changed, 4 insertions(+) diff --git a/pkg/ca/googleca/v1/googleca.go b/pkg/ca/googleca/v1/googleca.go index 10559ac18..cdb5fcce5 100644 --- a/pkg/ca/googleca/v1/googleca.go +++ b/pkg/ca/googleca/v1/googleca.go @@ -195,6 +195,8 @@ func (c *CertAuthorityService) CreateCertificate(ctx context.Context, subj *chal privca = spiffeSubject(subj.Value) case challenges.GithubWorkflowValue: privca = githubWorkflowSubject(subj.Value) + case challenges.KubernetesValue: + privca = KubernetesSubject(subj.Value) } pubKeyBytes, err := cryptoutils.MarshalPublicKeyToPEM(subj.PublicKey) diff --git a/pkg/ca/googleca/v1beta1/googleca.go b/pkg/ca/googleca/v1beta1/googleca.go index 9864c052a..a9d60b724 100644 --- a/pkg/ca/googleca/v1beta1/googleca.go +++ b/pkg/ca/googleca/v1beta1/googleca.go @@ -201,6 +201,8 @@ func (c *CertAuthorityService) CreateCertificate(ctx context.Context, subj *chal privca = spiffeSubject(subj.Value) case challenges.GithubWorkflowValue: privca = githubWorkflowSubject(subj.Value) + case challenges.KubernetesValue: + privca = KubernetesSubject(subj.Value) } pubKeyBytes, err := cryptoutils.MarshalPublicKeyToPEM(subj.PublicKey)