diff --git a/install/0000_30_machine-api-operator_09_rbac.yaml b/install/0000_30_machine-api-operator_09_rbac.yaml index e70deb082..5c208c76a 100644 --- a/install/0000_30_machine-api-operator_09_rbac.yaml +++ b/install/0000_30_machine-api-operator_09_rbac.yaml @@ -190,6 +190,28 @@ rules: - '*' --- apiVersion: rbac.authorization.k8s.io/v1 +kind: Role +metadata: + name: machine-api-controllers + namespace: openshift-machine-config-operator + annotations: + capability.openshift.io/name: MachineAPI + include.release.openshift.io/self-managed-high-availability: "true" + include.release.openshift.io/single-node-developer: "true" +rules: + - apiGroups: + - "" + resources: + - configmaps + resourceNames: + - coreos-bootimages + verbs: + - get + - list + - watch + +--- +apiVersion: rbac.authorization.k8s.io/v1 kind: ClusterRole metadata: name: machine-api-controllers @@ -587,6 +609,25 @@ subjects: name: machine-api-controllers namespace: openshift-machine-api +--- +apiVersion: rbac.authorization.k8s.io/v1 +kind: RoleBinding +metadata: + name: machine-api-controllers + namespace: openshift-machine-config-operator + annotations: + capability.openshift.io/name: MachineAPI + include.release.openshift.io/self-managed-high-availability: "true" + include.release.openshift.io/single-node-developer: "true" +roleRef: + apiGroup: rbac.authorization.k8s.io + kind: Role + name: machine-api-controllers +subjects: + - kind: ServiceAccount + name: machine-api-controllers + namespace: openshift-machine-api + --- apiVersion: rbac.authorization.k8s.io/v1 kind: ClusterRoleBinding diff --git a/pkg/webhooks/machine_webhook.go b/pkg/webhooks/machine_webhook.go index 578ba5326..ad0eda024 100644 --- a/pkg/webhooks/machine_webhook.go +++ b/pkg/webhooks/machine_webhook.go @@ -99,13 +99,6 @@ var ( return []string{fmt.Sprintf("%s-worker", clusterID)} } - defaultGCPDiskImage = func() string { - if arch == ARM64 { - return defaultGCPARMDiskImage - } - return defaultGCPX86DiskImage - } - // Power VS variables //powerVSMachineConfigurations contains the known Power VS system types and their allowed configuration limits @@ -185,11 +178,7 @@ const ( defaultGCPCredentialsSecret = "gcp-cloud-credentials" defaultGCPDiskSizeGb = 128 defaultGCPDiskType = "pd-standard" - // https://releases-rhcos-art.apps.ocp-virt.prod.psi.redhat.com/?stream=prod/streams/4.14-9.2&release=414.92.202307070025-0&arch=x86_64#414.92.202307070025-0 - // https://github.com/openshift/installer/commit/0cec4e1403d78387729f21f04d0f764f63fc552e - defaultGCPX86DiskImage = "projects/rhcos-cloud/global/images/rhcos-414-92-202307070025-0-gcp-x86-64" - defaultGCPARMDiskImage = "projects/rhcos-cloud/global/images/rhcos-414-92-202307070025-0-gcp-aarch64" - defaultGCPGPUCount = 1 + defaultGCPGPUCount = 1 // vSphere Defaults defaultVSphereCredentialsSecret = "vsphere-cloud-credentials" @@ -1374,7 +1363,6 @@ func defaultGCPDisks(disks []*machinev1beta1.GCPDisk, clusterID string) []*machi Boot: true, SizeGB: defaultGCPDiskSizeGb, Type: defaultGCPDiskType, - Image: defaultGCPDiskImage(), }, } } @@ -1383,10 +1371,6 @@ func defaultGCPDisks(disks []*machinev1beta1.GCPDisk, clusterID string) []*machi if disk.Type == "" { disk.Type = defaultGCPDiskType } - - if disk.Boot && disk.Image == "" { - disk.Image = defaultGCPDiskImage() - } } return disks diff --git a/pkg/webhooks/machine_webhook_test.go b/pkg/webhooks/machine_webhook_test.go index 52b9538cd..4a9b82301 100644 --- a/pkg/webhooks/machine_webhook_test.go +++ b/pkg/webhooks/machine_webhook_test.go @@ -2405,7 +2405,6 @@ func TestMachineUpdate(t *testing.T) { Boot: true, SizeGB: defaultGCPDiskSizeGb, Type: defaultGCPDiskType, - Image: defaultGCPDiskImage(), }, }, Tags: defaultGCPTags(gcpClusterID), @@ -5250,7 +5249,6 @@ func TestDefaultGCPProviderSpec(t *testing.T) { Boot: true, SizeGB: defaultGCPDiskSizeGb, Type: defaultGCPDiskType, - Image: defaultGCPDiskImage(), }, }, Tags: defaultGCPTags(clusterID), diff --git a/pkg/webhooks/machineset_webhook_test.go b/pkg/webhooks/machineset_webhook_test.go index db9deb1ce..eb6283ec0 100644 --- a/pkg/webhooks/machineset_webhook_test.go +++ b/pkg/webhooks/machineset_webhook_test.go @@ -639,7 +639,6 @@ func TestMachineSetUpdate(t *testing.T) { Boot: true, SizeGB: defaultGCPDiskSizeGb, Type: defaultGCPDiskType, - Image: defaultGCPDiskImage(), }, }, Tags: defaultGCPTags(gcpClusterID),