Skip to content

Commit

Permalink
Merge pull request kubevirt#6730 from zhhray/feat/change-cert-secret-…
Browse files Browse the repository at this point in the history
…type

change kubevrit cert secret type from Opaque to kubernetes.io/tls
  • Loading branch information
kubevirt-bot authored Nov 15, 2021
2 parents aaa7286 + fa50cb3 commit e622b99
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 8 deletions.
12 changes: 6 additions & 6 deletions pkg/virt-operator/resource/generate/components/secrets.go
Original file line number Diff line number Diff line change
Expand Up @@ -154,7 +154,7 @@ func NewCACertSecret(operatorNamespace string) *k8sv1.Secret {
v1.ManagedByLabel: v1.ManagedByLabelOperatorValue,
},
},
Type: "Opaque",
Type: k8sv1.SecretTypeTLS,
}
}

Expand Down Expand Up @@ -189,7 +189,7 @@ func NewCertSecrets(installNamespace string, operatorNamespace string) []*k8sv1.
v1.ManagedByLabel: v1.ManagedByLabelOperatorValue,
},
},
Type: "Opaque",
Type: k8sv1.SecretTypeTLS,
},
{
TypeMeta: metav1.TypeMeta{
Expand All @@ -203,7 +203,7 @@ func NewCertSecrets(installNamespace string, operatorNamespace string) []*k8sv1.
v1.ManagedByLabel: v1.ManagedByLabelOperatorValue,
},
},
Type: "Opaque",
Type: k8sv1.SecretTypeTLS,
},
{
TypeMeta: metav1.TypeMeta{
Expand All @@ -217,7 +217,7 @@ func NewCertSecrets(installNamespace string, operatorNamespace string) []*k8sv1.
v1.ManagedByLabel: v1.ManagedByLabelOperatorValue,
},
},
Type: "Opaque",
Type: k8sv1.SecretTypeTLS,
},
{
TypeMeta: metav1.TypeMeta{
Expand All @@ -231,7 +231,7 @@ func NewCertSecrets(installNamespace string, operatorNamespace string) []*k8sv1.
v1.ManagedByLabel: v1.ManagedByLabelOperatorValue,
},
},
Type: "Opaque",
Type: k8sv1.SecretTypeTLS,
},
{
TypeMeta: metav1.TypeMeta{
Expand All @@ -245,7 +245,7 @@ func NewCertSecrets(installNamespace string, operatorNamespace string) []*k8sv1.
v1.ManagedByLabel: v1.ManagedByLabelOperatorValue,
},
},
Type: "Opaque",
Type: k8sv1.SecretTypeTLS,
},
}
return secrets
Expand Down
6 changes: 4 additions & 2 deletions tests/infra_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -258,7 +258,8 @@ var _ = Describe("[Serial][sig-compute]Infrastructure", func() {
secret, err := virtClient.CoreV1().Secrets(flags.KubeVirtInstallNamespace).Get(context.Background(), components.KubeVirtCASecretName, metav1.GetOptions{})
Expect(err).ToNot(HaveOccurred())
secret.Data = map[string][]byte{
"random": []byte("nonsense"),
"tls.crt": []byte(""),
"tls.key": []byte(""),
}

_, err = virtClient.CoreV1().Secrets(flags.KubeVirtInstallNamespace).Update(context.Background(), secret, metav1.UpdateOptions{})
Expand Down Expand Up @@ -344,7 +345,8 @@ var _ = Describe("[Serial][sig-compute]Infrastructure", func() {
return err
}
secret.Data = map[string][]byte{
"random": []byte("nonsense"),
"tls.crt": []byte(""),
"tls.key": []byte(""),
}
_, err = virtClient.CoreV1().Secrets(flags.KubeVirtInstallNamespace).Update(context.Background(), secret, metav1.UpdateOptions{})

Expand Down

0 comments on commit e622b99

Please sign in to comment.