Skip to content

Commit

Permalink
Update pull secret references from cloud.redhat.com to cloud.openshif…
Browse files Browse the repository at this point in the history
…t.com (Azure#2084)
  • Loading branch information
bennerv authored and ellis-johnson committed Jun 3, 2022
1 parent a78d7b3 commit 0bf38fb
Show file tree
Hide file tree
Showing 3 changed files with 9 additions and 9 deletions.
2 changes: 1 addition & 1 deletion pkg/operator/controllers/muo/muo_controller.go
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@ const (
controllerOcmBaseURL = "rh.srep.muo.deploy.ocmBaseUrl"
controllerOcmBaseURLDefaultValue = "https://api.openshift.com"

pullSecretOCMKey = "cloud.redhat.com"
pullSecretOCMKey = "cloud.openshift.com"
)

var pullSecretName = types.NamespacedName{Name: "pull-secret", Namespace: "openshift-config"}
Expand Down
4 changes: 2 additions & 2 deletions pkg/operator/controllers/pullsecret/pullsecret_controller.go
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,7 @@ const (
)

var pullSecretName = types.NamespacedName{Name: "pull-secret", Namespace: "openshift-config"}
var rhKeys = []string{"registry.redhat.io", "cloud.redhat.com", "registry.connect.redhat.com"}
var rhKeys = []string{"registry.redhat.io", "cloud.openshift.com", "registry.connect.redhat.com"}

// Reconciler reconciles a Cluster object
type Reconciler struct {
Expand Down Expand Up @@ -201,7 +201,7 @@ func (r *Reconciler) ensureGlobalPullSecret(ctx context.Context, operatorSecret,

// parseRedHatKeys unmarshal and extract following RH keys from pull-secret:
// - redhat.registry.io
// - cloud.redhat.com
// - cloud.openshift.com
// - registry.connect.redhat.com
// if present, return error when the parsing fail, which means broken secret
func (r *Reconciler) parseRedHatKeys(secret *corev1.Secret) (foundKeys []string, err error) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -151,14 +151,14 @@ func TestPullSecretReconciler(t *testing.T) {
name: "valid RH keys present",
fakecli: newFakecli(&corev1.Secret{
Data: map[string][]byte{
corev1.DockerConfigJsonKey: []byte(`{"auths":{"arosvc.azurecr.io":{"auth":"ZnJlZDplbnRlcg=="},"registry.redhat.io":{"auth":"ZnJlZDplbnRlcg=="},"cloud.redhat.com":{"auth":"ZnJlZDplbnRlcg=="}}}`),
corev1.DockerConfigJsonKey: []byte(`{"auths":{"arosvc.azurecr.io":{"auth":"ZnJlZDplbnRlcg=="},"registry.redhat.io":{"auth":"ZnJlZDplbnRlcg=="},"cloud.openshift.com":{"auth":"ZnJlZDplbnRlcg=="}}}`),
},
}, &corev1.Secret{Data: map[string][]byte{
corev1.DockerConfigJsonKey: []byte(`{"auths":{"arosvc.azurecr.io":{"auth":"ZnJlZDplbnRlcg=="},"registry.redhat.io":{"auth":"ZnJlZDplbnRlcg=="},"cloud.redhat.com":{"auth":"ZnJlZDplbnRlcg=="}}}`),
corev1.DockerConfigJsonKey: []byte(`{"auths":{"arosvc.azurecr.io":{"auth":"ZnJlZDplbnRlcg=="},"registry.redhat.io":{"auth":"ZnJlZDplbnRlcg=="},"cloud.openshift.com":{"auth":"ZnJlZDplbnRlcg=="}}}`),
}}),
arocli: newFakeAro(&baseCluster),
want: `{"auths":{"arosvc.azurecr.io":{"auth":"ZnJlZDplbnRlcg=="},"registry.redhat.io":{"auth":"ZnJlZDplbnRlcg=="},"cloud.redhat.com":{"auth":"ZnJlZDplbnRlcg=="}}}`,
wantKeys: []string{"registry.redhat.io", "cloud.redhat.com"},
want: `{"auths":{"arosvc.azurecr.io":{"auth":"ZnJlZDplbnRlcg=="},"registry.redhat.io":{"auth":"ZnJlZDplbnRlcg=="},"cloud.openshift.com":{"auth":"ZnJlZDplbnRlcg=="}}}`,
wantKeys: []string{"registry.redhat.io", "cloud.openshift.com"},
},
{
name: "management disabled, valid RH key present",
Expand Down Expand Up @@ -298,9 +298,9 @@ func TestParseRedHatKeys(t *testing.T) {
{
name: "with all rh key",
ps: &corev1.Secret{Data: map[string][]byte{
corev1.DockerConfigJsonKey: []byte(`{"auths":{"arosvc.azurecr.io":{"auth":"ZnJlZDplbnRlcg=="},"registry.redhat.io":{"auth":"ZnJlZDplbnRlcg=="},"registry.connect.redhat.com":{"auth":"ZnJlZDplbnRlcg=="},"cloud.redhat.com":{"auth":"ZnJlZDplbnRlcg=="}}}`),
corev1.DockerConfigJsonKey: []byte(`{"auths":{"arosvc.azurecr.io":{"auth":"ZnJlZDplbnRlcg=="},"registry.redhat.io":{"auth":"ZnJlZDplbnRlcg=="},"registry.connect.redhat.com":{"auth":"ZnJlZDplbnRlcg=="},"cloud.openshift.com":{"auth":"ZnJlZDplbnRlcg=="}}}`),
}},
wantKeys: []string{"registry.redhat.io", "cloud.redhat.com", "registry.connect.redhat.com"},
wantKeys: []string{"registry.redhat.io", "cloud.openshift.com", "registry.connect.redhat.com"},
},
}

Expand Down

0 comments on commit 0bf38fb

Please sign in to comment.