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
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@ import (

exutil "github.com/openshift/origin/test/extended/util"

configv1 "github.com/openshift/api/config/v1"
configclient "github.com/openshift/client-go/config/clientset/versioned"
"github.com/openshift/origin/pkg/monitor/monitorapi"
"github.com/openshift/origin/pkg/monitortestframework"
Expand Down Expand Up @@ -84,6 +85,13 @@ func (w *auditLogAnalyzer) StartCollection(ctx context.Context, adminRESTConfig
return err
case extensions.IsROSACluster(infra.Status.PlatformStatus):
w.apiLoadBalancerSkipReason = "not applicable to ROSA"
case infra.Status.PlatformStatus != nil && infra.Status.PlatformStatus.Type == configv1.ExternalPlatformType:
_, _, platformName := exutil.GetExternalPlatformProviderNameWithCCM(infra)
// AWS NLB takes longer than expected time to propagate health, crossing the expected shutdown/startup behaviour,
// impacting in the readiness of this test.
if strings.EqualFold(platformName, "aws") {
w.apiLoadBalancerSkipReason = "test not supported by platform type External using AWS as provider caused by NLB health check propagation delays. See also: https://redhat.atlassian.net/browse/OCPBUGS-86789"
}
}

kubeClient, err := kubernetes.NewForConfig(w.adminRESTConfig)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -36,6 +36,7 @@ import (
"github.com/openshift/origin/pkg/monitortestlibrary/disruptionlibrary"
"github.com/openshift/origin/pkg/monitortestlibrary/utility"
"github.com/openshift/origin/pkg/test/ginkgo/junitapi"

exutil "github.com/openshift/origin/test/extended/util"
"github.com/openshift/origin/test/extended/util/image"
)
Expand Down Expand Up @@ -70,21 +71,26 @@ type availability struct {
// isNotSupportedForPlatformExternal if platform type is external, this checks to see if the
// platform name is one that does not support a service load balancer.
func isNotSupportedForPlatformExternal(infra *configv1.Infrastructure) bool {
notSupported := false
if infra.Spec.PlatformSpec.External == nil {
return notSupported
isExternal, hasCCM, platformName := exutil.GetExternalPlatformProviderNameWithCCM(infra)
if !isExternal {
return false
}

platformName := infra.Spec.PlatformSpec.External.PlatformName
logrus.Infof("external platform(%t) name(%s) with supported CloudControllerManagerExternal(%t)", isExternal, platformName, hasCCM)

fmt.Fprintf(os.Stderr, "external platform name: %s\n", platformName)
// Platform External variant#1 (similar None) is not installed with external Cloud Controller Manager,
// thus external service type LoadBalancer is not supported.
if !hasCCM {
return true
}

switch strings.ToLower(infra.Spec.PlatformSpec.External.PlatformName) {
case "vsphere":
notSupported = true
// All providers which has external CCM, CloudControllerManager state set to External,
// must support service type LoadBalancer, except:
if strings.EqualFold(platformName, "vsphere") {
return true
}

return notSupported
return false
}

// isInternalIngressLoadBalancer reports whether the default IngressController is exposed
Expand Down
29 changes: 29 additions & 0 deletions test/extended/util/framework.go
Original file line number Diff line number Diff line change
Expand Up @@ -2341,6 +2341,35 @@ func IsExternalPlatformCluster(ctx context.Context, configClient clientconfigv1.
return infrastructure.Status.PlatformStatus != nil && infrastructure.Status.PlatformStatus.Type == configv1.ExternalPlatformType, nil
}

// GetExternalPlatformProviderNameWithCCM returns platform External configuration for
// supported variants.
// isPlatformExternal returns true if platform type is External.
// hasExternalCCM returns true when CloudControllerManager is External, indicating external Cloud Controller Manager deployment.
// platformName indicating the free-form name set by deployer when platform type is External.
func GetExternalPlatformProviderNameWithCCM(infrastructure *configv1.Infrastructure) (bool, bool, string) {
if infrastructure == nil || infrastructure.Status.PlatformStatus == nil {
return false, false, ""
}

status := infrastructure.Status.PlatformStatus
isPlatformExternal := status.Type == configv1.ExternalPlatformType
if !isPlatformExternal {
return false, false, ""
}

// Discover with External CCM is supported
hasExternalCCM := status.External != nil &&
status.External.CloudControllerManager.State == configv1.CloudControllerManagerExternal

// Discover platformName when it is set
platformName := ""
if infrastructure.Spec.PlatformSpec.External != nil {
platformName = infrastructure.Spec.PlatformSpec.External.PlatformName
}

return isPlatformExternal, hasExternalCCM, platformName
}

// IsMicroShiftCluster returns "true" if a cluster is MicroShift,
// "false" otherwise. It needs kube-admin client as input.
//
Expand Down