Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
41 changes: 41 additions & 0 deletions install/0000_30_machine-api-operator_09_rbac.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -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
Expand Down
18 changes: 1 addition & 17 deletions pkg/webhooks/machine_webhook.go
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -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"
Expand Down Expand Up @@ -1374,7 +1363,6 @@ func defaultGCPDisks(disks []*machinev1beta1.GCPDisk, clusterID string) []*machi
Boot: true,
SizeGB: defaultGCPDiskSizeGb,
Type: defaultGCPDiskType,
Image: defaultGCPDiskImage(),
},
}
}
Expand All @@ -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
Expand Down
2 changes: 0 additions & 2 deletions pkg/webhooks/machine_webhook_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -2405,7 +2405,6 @@ func TestMachineUpdate(t *testing.T) {
Boot: true,
SizeGB: defaultGCPDiskSizeGb,
Type: defaultGCPDiskType,
Image: defaultGCPDiskImage(),
},
},
Tags: defaultGCPTags(gcpClusterID),
Expand Down Expand Up @@ -5250,7 +5249,6 @@ func TestDefaultGCPProviderSpec(t *testing.T) {
Boot: true,
SizeGB: defaultGCPDiskSizeGb,
Type: defaultGCPDiskType,
Image: defaultGCPDiskImage(),
},
},
Tags: defaultGCPTags(clusterID),
Expand Down
1 change: 0 additions & 1 deletion pkg/webhooks/machineset_webhook_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -639,7 +639,6 @@ func TestMachineSetUpdate(t *testing.T) {
Boot: true,
SizeGB: defaultGCPDiskSizeGb,
Type: defaultGCPDiskType,
Image: defaultGCPDiskImage(),
},
},
Tags: defaultGCPTags(gcpClusterID),
Expand Down