Skip to content

Commit 074d2c3

Browse files
Merge pull request #739 from dmage/remove-installer-dep
IR-227: Remove fallback from platformStatus to installer config
2 parents ff79b26 + e9e4f84 commit 074d2c3

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

51 files changed

+1
-1305
lines changed

go.mod

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,6 @@ require (
2828
github.com/openshift/api v0.0.0-20211215015256-3cf5120f2ce6
2929
github.com/openshift/build-machinery-go v0.0.0-20211213093930-7e33a7eb4ce3
3030
github.com/openshift/client-go v0.0.0-20210916133943-9acee1a0fb83
31-
github.com/openshift/installer v0.9.0-master.0.20190726121806-6e8f9c335410
3231
github.com/openshift/library-go v0.0.0-20211110085240-047b536a17c6
3332
github.com/prometheus/client_golang v1.11.0
3433
github.com/prometheus/client_model v0.2.0

go.sum

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -638,8 +638,6 @@ github.com/openshift/build-machinery-go v0.0.0-20211213093930-7e33a7eb4ce3 h1:65
638638
github.com/openshift/build-machinery-go v0.0.0-20211213093930-7e33a7eb4ce3/go.mod h1:b1BuldmJlbA/xYtdZvKi+7j5YGB44qJUJDZ9zwiNCfE=
639639
github.com/openshift/client-go v0.0.0-20210916133943-9acee1a0fb83 h1:TGBy40xVBCqDqvu8gaakva4u+08JtOt/LfekiwbCMyc=
640640
github.com/openshift/client-go v0.0.0-20210916133943-9acee1a0fb83/go.mod h1:iSeqKIqUKxVec3gV1kNvwS1tjDpzpdP134RimkLc3BE=
641-
github.com/openshift/installer v0.9.0-master.0.20190726121806-6e8f9c335410 h1:fCXoMmINCITnEVU7yC6iL0nBuajZw0Y7rruyxVxmfzw=
642-
github.com/openshift/installer v0.9.0-master.0.20190726121806-6e8f9c335410/go.mod h1:VWGgpJgF8DGCKQjbccnigglhZnHtRLCZ6cxqkXN4Ck0=
643641
github.com/openshift/library-go v0.0.0-20211110085240-047b536a17c6 h1:dAwIJESWIaTAJoWUIAZbMgJIGvMIbBeuKSa/256Tl58=
644642
github.com/openshift/library-go v0.0.0-20211110085240-047b536a17c6/go.mod h1:b1cKE6TuNqjl7wT0y3W4g0qREuab1mH6WOJm9pT8L/A=
645643
github.com/opentracing/opentracing-go v1.1.0/go.mod h1:UkNAQd3GIcIGf0SeVgPpRdFStlNbqXla1AfSYxPUl2o=

pkg/client/fake/fixtures.go

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -218,7 +218,6 @@ func (f *FixturesBuilder) BuildListers() *client.Listers {
218218
OpenShiftConfig: corev1listers.NewConfigMapLister(f.configMapsIndexer).ConfigMaps("openshift-config"),
219219
OpenShiftConfigManaged: corev1listers.NewConfigMapLister(f.configMapsIndexer).ConfigMaps("openshift-config-managed"),
220220
RegistryConfigs: regopv1listers.NewConfigLister(f.registryConfigsIndexer),
221-
InstallerConfigMaps: corev1listers.NewConfigMapLister(f.configMapsIndexer).ConfigMaps("kube-system"),
222221
ProxyConfigs: configv1listers.NewProxyLister(f.proxyConfigsIndexer),
223222
Infrastructures: configv1listers.NewInfrastructureLister(f.infraIndexer),
224223
}

pkg/client/listers.go

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,6 @@ type Listers struct {
2626
OpenShiftConfig kcorelisters.ConfigMapNamespaceLister
2727
OpenShiftConfigManaged kcorelisters.ConfigMapNamespaceLister
2828
RegistryConfigs regoplisters.ConfigLister
29-
InstallerConfigMaps kcorelisters.ConfigMapNamespaceLister
3029
ProxyConfigs configlisters.ProxyLister
3130
Infrastructures configlisters.InfrastructureLister
3231
}

pkg/operator/controller.go

Lines changed: 0 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -165,11 +165,6 @@ func NewController(
165165
c.listers.RegistryConfigs = informer.Lister()
166166
return informer.Informer()
167167
},
168-
func() cache.SharedIndexInformer {
169-
informer := kubeSystemKubeInformerFactory.Core().V1().ConfigMaps()
170-
c.listers.InstallerConfigMaps = informer.Lister().ConfigMaps(kubeSystemNamespace)
171-
return informer.Informer()
172-
},
173168
func() cache.SharedIndexInformer {
174169
informer := configInformerFactory.Config().V1().Infrastructures()
175170
c.listers.Infrastructures = informer.Lister()

pkg/storage/util/util.go

Lines changed: 1 addition & 41 deletions
Original file line numberDiff line numberDiff line change
@@ -8,12 +8,10 @@ import (
88

99
corev1 "k8s.io/api/core/v1"
1010
metaapi "k8s.io/apimachinery/pkg/apis/meta/v1"
11-
"k8s.io/apimachinery/pkg/util/yaml"
1211

1312
configv1 "github.com/openshift/api/config/v1"
1413
imageregistryv1 "github.com/openshift/api/imageregistry/v1"
1514
operatorapi "github.com/openshift/api/operator/v1"
16-
installer "github.com/openshift/installer/pkg/types"
1715

1816
regopclient "github.com/openshift/cluster-image-registry-operator/pkg/client"
1917
"github.com/openshift/cluster-image-registry-operator/pkg/defaults"
@@ -64,46 +62,8 @@ func UpdateCondition(cr *imageregistryv1.Config, conditionType string, status op
6462

6563
// GetInfrastructure gets information about the cloud platform that the cluster is
6664
// installed on including the Type, Region, and other platform specific information.
67-
// Currently the install config is used as a backup to be compatible with upgrades
68-
// from 4.1 -> 4.2 when platformStatus did not exist, but should be able to be removed
69-
// in the future.
7065
func GetInfrastructure(listers *regopclient.Listers) (*configv1.Infrastructure, error) {
71-
infra, err := listers.Infrastructures.Get("cluster")
72-
if err != nil {
73-
return nil, err
74-
}
75-
76-
if infra.Status.PlatformStatus == nil {
77-
infra.Status.PlatformStatus = &configv1.PlatformStatus{
78-
//nolint:staticcheck
79-
Type: infra.Status.Platform,
80-
}
81-
82-
// TODO: Eventually we should be able to remove our dependency on the install config
83-
// but it is needed for now since platformStatus doesn't get set on upgrade
84-
// from 4.1 -> 4.2
85-
ic, err := listers.InstallerConfigMaps.Get(defaults.ClusterConfigName)
86-
if err != nil {
87-
return nil, err
88-
}
89-
installConfig := &installer.InstallConfig{}
90-
if err := yaml.NewYAMLOrJSONDecoder(strings.NewReader(string(ic.Data["install-config"])), 100).Decode(installConfig); err != nil {
91-
return nil, fmt.Errorf("unable to decode cluster install configuration: %v", err)
92-
}
93-
94-
if installConfig.Platform.AWS != nil {
95-
infra.Status.PlatformStatus.AWS = &configv1.AWSPlatformStatus{Region: installConfig.Platform.AWS.Region}
96-
}
97-
98-
if installConfig.Platform.GCP != nil {
99-
infra.Status.PlatformStatus.GCP = &configv1.GCPPlatformStatus{
100-
Region: installConfig.Platform.GCP.Region,
101-
ProjectID: installConfig.Platform.GCP.ProjectID,
102-
}
103-
}
104-
}
105-
106-
return infra, nil
66+
return listers.Infrastructures.Get("cluster")
10767
}
10868

10969
// GetValueFromSecret gets value for key in a secret

test/framework/mock/listers/listers.go

Lines changed: 0 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -10,10 +10,6 @@ import (
1010
"github.com/openshift/cluster-image-registry-operator/pkg/defaults"
1111
)
1212

13-
const (
14-
installerConfigNamespace = "kube-system"
15-
)
16-
1713
type mockLister struct {
1814
listers regopclient.Listers
1915
kubeconfig *restclient.Config
@@ -35,7 +31,6 @@ func (m *mockLister) GetListers() (*regopclient.Listers, error) {
3531
}
3632

3733
m.listers.Secrets = MockSecretNamespaceLister{namespace: defaults.ImageRegistryOperatorNamespace, client: coreClient}
38-
m.listers.InstallerConfigMaps = MockConfigMapNamespaceLister{namespace: installerConfigNamespace, client: coreClient}
3934
m.listers.Infrastructures = MockInfrastructureLister{client: *configClient}
4035
m.listers.OpenShiftConfigManaged = MockConfigMapNamespaceLister{namespace: defaults.OpenShiftConfigManagedNamespace, client: coreClient}
4136

vendor/github.com/openshift/installer/LICENSE

Lines changed: 0 additions & 202 deletions
This file was deleted.

vendor/github.com/openshift/installer/NOTICE

Lines changed: 0 additions & 5 deletions
This file was deleted.

0 commit comments

Comments
 (0)