Skip to content

Commit

Permalink
changing secret type (#719)
Browse files Browse the repository at this point in the history
  • Loading branch information
johndietz authored Nov 14, 2022
1 parent a808a50 commit 2de528f
Showing 1 changed file with 6 additions and 3 deletions.
9 changes: 6 additions & 3 deletions internal/k3d/secrets.go
Original file line number Diff line number Diff line change
Expand Up @@ -81,7 +81,8 @@ func AddK3DSecrets(dryrun bool) error {

developmentDockerSecrets := &v1.Secret{
ObjectMeta: metav1.ObjectMeta{Name: "docker-config", Namespace: "development"},
Data: map[string][]byte{"config.json": []byte(dockerConfigString)},
Type: "kubernetes.io/dockerconfigjson",
Data: map[string][]byte{".dockerconfigjson": []byte(dockerConfigString)},
}
_, err = clientset.CoreV1().Secrets("development").Create(context.TODO(), developmentDockerSecrets, metav1.CreateOptions{})
if err != nil {
Expand All @@ -91,7 +92,8 @@ func AddK3DSecrets(dryrun bool) error {

stagingDockerSecrets := &v1.Secret{
ObjectMeta: metav1.ObjectMeta{Name: "docker-config", Namespace: "staging"},
Data: map[string][]byte{"config.json": []byte(dockerConfigString)},
Type: "kubernetes.io/dockerconfigjson",
Data: map[string][]byte{".dockerconfigjson": []byte(dockerConfigString)},
}
_, err = clientset.CoreV1().Secrets("staging").Create(context.TODO(), stagingDockerSecrets, metav1.CreateOptions{})
if err != nil {
Expand All @@ -101,7 +103,8 @@ func AddK3DSecrets(dryrun bool) error {

productionDockerSecrets := &v1.Secret{
ObjectMeta: metav1.ObjectMeta{Name: "docker-config", Namespace: "production"},
Data: map[string][]byte{"config.json": []byte(dockerConfigString)},
Type: "kubernetes.io/dockerconfigjson",
Data: map[string][]byte{".dockerconfigjson": []byte(dockerConfigString)},
}
_, err = clientset.CoreV1().Secrets("production").Create(context.TODO(), productionDockerSecrets, metav1.CreateOptions{})
if err != nil {
Expand Down

0 comments on commit 2de528f

Please sign in to comment.