Skip to content

Commit

Permalink
use apply instead of update
Browse files Browse the repository at this point in the history
  • Loading branch information
s-amann committed Sep 28, 2023
1 parent 9ec5d88 commit 26ec6ce
Showing 1 changed file with 6 additions and 1 deletion.
7 changes: 6 additions & 1 deletion pkg/cluster/acrtoken.go
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@ import (
metav1 "k8s.io/apimachinery/pkg/apis/meta/v1"
"k8s.io/apimachinery/pkg/types"
"k8s.io/apimachinery/pkg/util/wait"
v1 "k8s.io/client-go/applyconfigurations/core/v1"
"k8s.io/client-go/util/retry"

"github.com/Azure/ARO-RP/pkg/api"
Expand Down Expand Up @@ -178,8 +179,12 @@ func (m *manager) rotateOpenShiftConfigSecret(ctx context.Context, encodedDocker
openshiftConfigSecret.Data[corev1.DockerConfigJsonKey] = encodedDockerConfigJson
}

applyConfiguration := v1.Secret(openshiftConfigSecret.Name, openshiftConfigSecret.Namespace).
WithData(openshiftConfigSecret.Data).
WithType(corev1.SecretTypeDockerConfigJson)

return retryOperation(func() error {
_, err = m.kubernetescli.CoreV1().Secrets(pullSecretName.Namespace).Update(ctx, openshiftConfigSecret, metav1.UpdateOptions{})
_, err = m.kubernetescli.CoreV1().Secrets(pullSecretName.Namespace).Apply(ctx, applyConfiguration, metav1.ApplyOptions{})
return err
})
}
Expand Down

0 comments on commit 26ec6ce

Please sign in to comment.