@@ -30,6 +30,7 @@ import (
30
30
configv1 "github.com/openshift/api/config/v1"
31
31
imageregistryv1 "github.com/openshift/api/imageregistry/v1"
32
32
operatorapiv1 "github.com/openshift/api/operator/v1"
33
+ configlisters "github.com/openshift/client-go/config/listers/config/v1"
33
34
34
35
regopclient "github.com/openshift/cluster-image-registry-operator/pkg/client"
35
36
"github.com/openshift/cluster-image-registry-operator/pkg/defaults"
@@ -82,7 +83,7 @@ func (e *errDoesNotExist) Error() string {
82
83
// load credentials from ImageRegistryPrivateConfigurationUser secret, if this secret is not
83
84
// present this function loads credentials from cluster wide config present on secret
84
85
// CloudCredentialsName.
85
- func GetConfig (secLister kcorelisters.SecretNamespaceLister ) (* Azure , error ) {
86
+ func GetConfig (secLister kcorelisters.SecretNamespaceLister , infraLister configlisters. InfrastructureLister ) (* Azure , error ) {
86
87
sec , err := secLister .Get (defaults .ImageRegistryPrivateConfigurationUser )
87
88
if err != nil {
88
89
if ! errors .IsNotFound (err ) {
@@ -361,7 +362,7 @@ func (d *driver) CABundle() (string, bool, error) {
361
362
// ConfigEnv configures the environment variables that will be used in the
362
363
// image registry deployment.
363
364
func (d * driver ) ConfigEnv () (envs envvar.List , err error ) {
364
- cfg , err := GetConfig (d .Listers .Secrets )
365
+ cfg , err := GetConfig (d .Listers .Secrets , d . Listers . Infrastructures )
365
366
if err != nil {
366
367
return nil , err
367
368
}
@@ -449,7 +450,7 @@ func (d *driver) StorageExists(cr *imageregistryv1.Config) (bool, error) {
449
450
return false , nil
450
451
}
451
452
452
- cfg , err := GetConfig (d .Listers .Secrets )
453
+ cfg , err := GetConfig (d .Listers .Secrets , d . Listers . Infrastructures )
453
454
if err != nil {
454
455
util .UpdateCondition (cr , defaults .StorageExists , operatorapiv1 .ConditionUnknown , storageExistsReasonConfigError , fmt .Sprintf ("Unable to get configuration: %s" , err ))
455
456
return false , err
@@ -649,7 +650,7 @@ func (d *driver) processUPI(cr *imageregistryv1.Config) {
649
650
650
651
// CreateStorage attempts to create a storage account and a storage container.
651
652
func (d * driver ) CreateStorage (cr * imageregistryv1.Config ) error {
652
- cfg , err := GetConfig (d .Listers .Secrets )
653
+ cfg , err := GetConfig (d .Listers .Secrets , d . Listers . Infrastructures )
653
654
if err != nil {
654
655
util .UpdateCondition (
655
656
cr ,
@@ -749,7 +750,7 @@ func (d *driver) RemoveStorage(cr *imageregistryv1.Config) (retry bool, err erro
749
750
return false , nil
750
751
}
751
752
752
- cfg , err := GetConfig (d .Listers .Secrets )
753
+ cfg , err := GetConfig (d .Listers .Secrets , d . Listers . Infrastructures )
753
754
if err != nil {
754
755
util .UpdateCondition (cr , defaults .StorageExists , operatorapiv1 .ConditionUnknown , storageExistsReasonConfigError , fmt .Sprintf ("Unable to get configuration: %s" , err ))
755
756
return false , err
0 commit comments