Skip to content

Commit

Permalink
Merge pull request #9188 from pawanpinjarkar/cherrypick-oci-ccm-fix-t…
Browse files Browse the repository at this point in the history
…o-4.16

[release-4.16] OCPBUGS-44348: Cherrypick oci ccm fix to 4.16
  • Loading branch information
openshift-merge-bot[bot] authored Nov 12, 2024
2 parents f12bc39 + ab8ba3a commit dc63e8f
Show file tree
Hide file tree
Showing 4 changed files with 86 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,8 @@ exists $WORK/boot-artifacts/agent.x86_64-rootfs.img
exists $WORK/auth/kubeconfig
exists $WORK/auth/kubeadmin-password

isocmp agent.x86_64.iso /etc/assisted/manifests/agent-cluster-install.yaml expected/agent-cluster-install.yaml

-- install-config.yaml --
apiVersion: v1
baseDomain: test.metalkube.org
Expand Down Expand Up @@ -45,3 +47,41 @@ metadata:
namespace: cluster0
rendezvousIP: 192.168.111.20
bootArtifactsBaseURL: http://user-specified-infra.com

-- expected/agent-cluster-install.yaml --
apiVersion: extensions.hive.openshift.io/v1beta1
kind: AgentClusterInstall
metadata:
annotations:
agent-install.openshift.io/install-config-overrides: '{"platform":{"external":{"platformName":"oci","cloudControllerManager":"External"}}}'
creationTimestamp: null
name: ostest
namespace: cluster0
spec:
clusterDeploymentRef:
name: ostest
external:
cloudControllerManager: External
platformName: oci
imageSetRef:
name: openshift-was not built correctly
networking:
clusterNetwork:
- cidr: 10.128.0.0/14
hostPrefix: 23
machineNetwork:
- cidr: 192.168.111.0/24
networkType: OVNKubernetes
serviceNetwork:
- 172.30.0.0/16
userManagedNetworking: true
platformType: External
provisionRequirements:
controlPlaneAgents: 3
sshPublicKey: ssh-rsa AAAAB3NzaC1yc2EAAAADAQABAAABgQDK6UTEydcEKzuNdPaofn8Z2DwgHqdcionLZBiPf/zIRNco++etLsat7Avv7yt04DINQd5zjxIFgG8jblaUB5E5C9ClUcMwb52GO0ay2Y9v1uBv1a4WhI3peKktAzYNk0EBMQlJtXPjRMrC9ylBPh+DsBHMu+KmDnfk7PIwyN4efC8k5kSRuPWoNdme1rz2+umU8FSmaWTHIajrbspf4GQbsntA5kuKEtDbfoNCU97o2KrRnUbeg3a8hwSjfh3u6MhlnGcg5K2Ij+zivEsWGCLKYUtE1ErqwfIzwWmJ6jnV66XCQGHf4Q1iIxqF7s2a1q24cgG2Z/iDXfqXrCIfy4P7b/Ztak3bdT9jfAdVZtdO5/r7I+O5hYhF86ayFlDWzZWP/ByiSb+q4CQbfVgK3BMmiAv2MqLHdhesmD/SmIcoOWUF6rFmRKZVFFpKpt5ATNTgUJ3JRowoXrrDruVXClUGRiCS6Zabd1rZ3VmTchaPJwtzQMdfIWISXj+Ig+C4UK0=
status:
debugInfo:
eventsURL: ""
logsURL: ""
progress:
totalPercentage: 0
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,8 @@ exists $WORK/agent.x86_64.iso
exists $WORK/auth/kubeconfig
exists $WORK/auth/kubeadmin-password

isocmp agent.x86_64.iso /etc/assisted/manifests/agent-cluster-install.yaml expected/agent-cluster-install.yaml

-- install-config.yaml --
apiVersion: v1
baseDomain: test.metalkube.org
Expand Down Expand Up @@ -43,3 +45,41 @@ metadata:
name: ostest
namespace: cluster0
rendezvousIP: 192.168.111.20

-- expected/agent-cluster-install.yaml --
apiVersion: extensions.hive.openshift.io/v1beta1
kind: AgentClusterInstall
metadata:
annotations:
agent-install.openshift.io/install-config-overrides: '{"platform":{"external":{"platformName":"oci","cloudControllerManager":"External"}}}'
creationTimestamp: null
name: ostest
namespace: cluster0
spec:
clusterDeploymentRef:
name: ostest
external:
cloudControllerManager: External
platformName: oci
imageSetRef:
name: openshift-was not built correctly
networking:
clusterNetwork:
- cidr: 10.128.0.0/14
hostPrefix: 23
machineNetwork:
- cidr: 192.168.111.0/24
networkType: OVNKubernetes
serviceNetwork:
- 172.30.0.0/16
userManagedNetworking: true
platformType: External
provisionRequirements:
controlPlaneAgents: 3
sshPublicKey: ssh-rsa AAAAB3NzaC1yc2EAAAADAQABAAABgQDK6UTEydcEKzuNdPaofn8Z2DwgHqdcionLZBiPf/zIRNco++etLsat7Avv7yt04DINQd5zjxIFgG8jblaUB5E5C9ClUcMwb52GO0ay2Y9v1uBv1a4WhI3peKktAzYNk0EBMQlJtXPjRMrC9ylBPh+DsBHMu+KmDnfk7PIwyN4efC8k5kSRuPWoNdme1rz2+umU8FSmaWTHIajrbspf4GQbsntA5kuKEtDbfoNCU97o2KrRnUbeg3a8hwSjfh3u6MhlnGcg5K2Ij+zivEsWGCLKYUtE1ErqwfIzwWmJ6jnV66XCQGHf4Q1iIxqF7s2a1q24cgG2Z/iDXfqXrCIfy4P7b/Ztak3bdT9jfAdVZtdO5/r7I+O5hYhF86ayFlDWzZWP/ByiSb+q4CQbfVgK3BMmiAv2MqLHdhesmD/SmIcoOWUF6rFmRKZVFFpKpt5ATNTgUJ3JRowoXrrDruVXClUGRiCS6Zabd1rZ3VmTchaPJwtzQMdfIWISXj+Ig+C4UK0=
status:
debugInfo:
eventsURL: ""
logsURL: ""
progress:
totalPercentage: 0
5 changes: 4 additions & 1 deletion pkg/asset/agent/manifests/agentclusterinstall.go
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ import (
"github.com/openshift/installer/pkg/types"
"github.com/openshift/installer/pkg/types/baremetal"
"github.com/openshift/installer/pkg/types/defaults"
"github.com/openshift/installer/pkg/types/external"
external "github.com/openshift/installer/pkg/types/external"
"github.com/openshift/installer/pkg/types/none"
"github.com/openshift/installer/pkg/types/vsphere"
)
Expand Down Expand Up @@ -207,6 +207,9 @@ func (a *AgentClusterInstall) Generate(dependencies asset.Parents) error {
PlatformName: installConfig.Config.Platform.External.PlatformName,
}
}
if installConfig.Config.Platform.Name() == external.Name && installConfig.Config.Platform.External.PlatformName == external.ExternalPlatformNameOci {
agentClusterInstall.Spec.ExternalPlatformSpec.CloudControllerManager = external.CloudControllerManagerTypeExternal
}

if installConfig.Config.Platform.Name() == none.Name || installConfig.Config.Platform.Name() == external.Name {
logrus.Debugf("Setting UserManagedNetworking to true for %s platform", installConfig.Config.Platform.Name())
Expand Down
3 changes: 2 additions & 1 deletion pkg/asset/agent/manifests/agentclusterinstall_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -116,7 +116,8 @@ func TestAgentClusterInstall_Generate(t *testing.T) {
goodExternalOCIPlatformACI.Spec.Networking.UserManagedNetworking = &val
goodExternalOCIPlatformACI.Spec.PlatformType = hiveext.ExternalPlatformType
goodExternalOCIPlatformACI.Spec.ExternalPlatformSpec = &hiveext.ExternalPlatformSpec{
PlatformName: externaltype.ExternalPlatformNameOci,
PlatformName: externaltype.ExternalPlatformNameOci,
CloudControllerManager: externaltype.CloudControllerManagerTypeExternal,
}
goodExternalOCIPlatformACI.SetAnnotations(map[string]string{
installConfigOverrides: `{"platform":{"external":{"platformName":"oci","cloudControllerManager":"External"}}}`,
Expand Down

0 comments on commit dc63e8f

Please sign in to comment.