From 37aa19f3c10e10c49c7a20c598b1c9d51b548392 Mon Sep 17 00:00:00 2001 From: Sanskar Jaiswal Date: Fri, 11 Aug 2023 15:19:49 +0530 Subject: [PATCH] modify `flux create secret tls` to create secrets of type TLS Signed-off-by: Sanskar Jaiswal --- cmd/flux/testdata/create_secret/tls/secret-tls.yaml | 1 + pkg/manifestgen/sourcesecret/sourcesecret.go | 1 + 2 files changed, 2 insertions(+) diff --git a/cmd/flux/testdata/create_secret/tls/secret-tls.yaml b/cmd/flux/testdata/create_secret/tls/secret-tls.yaml index 6e2cdab1cf..047c9221c7 100644 --- a/cmd/flux/testdata/create_secret/tls/secret-tls.yaml +++ b/cmd/flux/testdata/create_secret/tls/secret-tls.yaml @@ -102,3 +102,4 @@ stringData: XBQO4ig7vY8+1+L3w2xpTN95/rXAvB4BbO/DLea9ArikePoSJ+bVTj0YwrKBghep kOvbvVANrpsunlSAcpXm1qkV+G+xPnyJ -----END PRIVATE KEY----- +type: kubernetes.io/tls diff --git a/pkg/manifestgen/sourcesecret/sourcesecret.go b/pkg/manifestgen/sourcesecret/sourcesecret.go index 25d3f59acf..f468fa726d 100644 --- a/pkg/manifestgen/sourcesecret/sourcesecret.go +++ b/pkg/manifestgen/sourcesecret/sourcesecret.go @@ -163,6 +163,7 @@ func buildSecret(keypair *ssh.KeyPair, hostKey, dockerCfg []byte, options Option } if len(options.TLSCrt) != 0 && len(options.TLSKey) != 0 { + secret.Type = corev1.SecretTypeTLS secret.StringData[TLSCrtSecretKey] = string(options.TLSCrt) secret.StringData[TLSKeySecretKey] = string(options.TLSKey) } else if len(options.CertFile) != 0 && len(options.KeyFile) != 0 {