@@ -14,6 +14,7 @@ import (
1414 "github.com/openshift/installer/pkg/ipnet"
1515 "github.com/openshift/installer/pkg/types"
1616 "github.com/openshift/installer/pkg/types/baremetal"
17+ "github.com/openshift/installer/pkg/types/external"
1718 "github.com/openshift/installer/pkg/types/none"
1819 "github.com/openshift/installer/pkg/types/vsphere"
1920)
@@ -404,19 +405,77 @@ pullSecret: "{\"auths\":{\"example.com\":{\"auth\":\"authorization value\"}}}"
404405 expectedError : "invalid install-config configuration: Platform: Invalid value: \" baremetal\" : CPU architecture \" s390x\" only supports platform \" none\" ." ,
405406 },
406407 {
407- name : "unsupported platformName for external platform" ,
408+ name : "generic platformName for external platform" ,
408409 data : `
409410apiVersion: v1
410411metadata:
411- name: test-cluster
412+ name: test-cluster
412413baseDomain: test-domain
414+ networking:
415+ networkType: OVNKubernetes
416+ compute:
417+ - architecture: amd64
418+ hyperthreading: Enabled
419+ name: worker
420+ platform: {}
421+ replicas: 0
422+ controlPlane:
423+ architecture: amd64
424+ hyperthreading: Enabled
425+ name: master
426+ platform: {}
427+ replicas: 1
413428platform:
414429 external:
415- platformName: some-cloud-provider
430+ platformName: some-cloud-provider
416431pullSecret: "{\"auths\":{\"example.com\":{\"auth\":\"authorization value\"}}}"
417432` ,
418- expectedFound : false ,
419- expectedError : `invalid install-config configuration: Platform.External.PlatformName: Unsupported value: "some-cloud-provider": supported values: "oci"` ,
433+ expectedFound : true ,
434+ expectedConfig : & types.InstallConfig {
435+ TypeMeta : metav1.TypeMeta {
436+ APIVersion : types .InstallConfigVersion ,
437+ },
438+ ObjectMeta : metav1.ObjectMeta {
439+ Name : "test-cluster" ,
440+ },
441+ AdditionalTrustBundlePolicy : types .PolicyProxyOnly ,
442+ BaseDomain : "test-domain" ,
443+ Networking : & types.Networking {
444+ MachineNetwork : []types.MachineNetworkEntry {
445+ {CIDR : * ipnet .MustParseCIDR ("10.0.0.0/16" )},
446+ },
447+ NetworkType : "OVNKubernetes" ,
448+ ServiceNetwork : []ipnet.IPNet {* ipnet .MustParseCIDR ("172.30.0.0/16" )},
449+ ClusterNetwork : []types.ClusterNetworkEntry {
450+ {
451+ CIDR : * ipnet .MustParseCIDR ("10.128.0.0/14" ),
452+ HostPrefix : 23 ,
453+ },
454+ },
455+ },
456+ ControlPlane : & types.MachinePool {
457+ Name : "master" ,
458+ Replicas : pointer .Int64 (1 ),
459+ Hyperthreading : types .HyperthreadingEnabled ,
460+ Architecture : types .ArchitectureAMD64 ,
461+ },
462+ Compute : []types.MachinePool {
463+ {
464+ Name : "worker" ,
465+ Replicas : pointer .Int64 (0 ),
466+ Hyperthreading : types .HyperthreadingEnabled ,
467+ Architecture : types .ArchitectureAMD64 ,
468+ },
469+ },
470+ Platform : types.Platform {
471+ External : & external.Platform {
472+ PlatformName : "some-cloud-provider" ,
473+ CloudControllerManager : "" ,
474+ },
475+ },
476+ PullSecret : `{"auths":{"example.com":{"auth":"authorization value"}}}` ,
477+ Publish : types .ExternalPublishingStrategy ,
478+ },
420479 },
421480 {
422481 name : "unsupported CloudControllerManager for external platform" ,
0 commit comments