Skip to content

Commit

Permalink
Merge pull request #28767 from pacevedom/USHIFT-3133
Browse files Browse the repository at this point in the history
USHIFT-3133: Skip cloud provider disruption monitors for MicroShift
  • Loading branch information
openshift-merge-bot[bot] committed May 9, 2024
2 parents 06199cd + 5fe6dc8 commit 8045e28
Show file tree
Hide file tree
Showing 3 changed files with 60 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -3,18 +3,22 @@ package disruptionexternalawscloudservicemonitoring
import (
"context"
_ "embed"
"fmt"
"time"

"github.com/openshift/origin/pkg/clioptions/clusterdiscovery"
"github.com/openshift/origin/pkg/monitortestframework"
"github.com/openshift/origin/pkg/monitortestlibrary/disruptionlibrary"
exutil "github.com/openshift/origin/test/extended/util"
"github.com/sirupsen/logrus"

"k8s.io/client-go/rest"

"github.com/openshift/origin/pkg/monitor/backenddisruption"
"github.com/openshift/origin/pkg/monitor/monitorapi"
"github.com/openshift/origin/pkg/test/ginkgo/junitapi"

"k8s.io/client-go/kubernetes"
)

const (
Expand All @@ -41,7 +45,22 @@ func NewCloudAvailabilityInvariant() monitortestframework.MonitorTest {
}

func (w *cloudAvailability) StartCollection(ctx context.Context, adminRESTConfig *rest.Config, recorder monitorapi.RecorderWriter) error {

{
kubeClient, err := kubernetes.NewForConfig(adminRESTConfig)
if err != nil {
return err
}
isMicroShift, err := exutil.IsMicroShiftCluster(kubeClient)
if err != nil {
return fmt.Errorf("unable to determine if cluster is MicroShift: %v", err)
}
if isMicroShift {
w.notSupportedReason = &monitortestframework.NotSupportedError{
Reason: "platform MicroShift not supported",
}
return w.notSupportedReason
}
}
// Proxy jobs may require a whitelist we don't want to deal with:
clusterState, err := clusterdiscovery.DiscoverClusterState(adminRESTConfig)
if err != nil {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,18 +3,22 @@ package disruptionexternalazurecloudservicemonitoring
import (
"context"
_ "embed"
"fmt"
"time"

"github.com/openshift/origin/pkg/clioptions/clusterdiscovery"
"github.com/openshift/origin/pkg/monitortestframework"
"github.com/openshift/origin/pkg/monitortestlibrary/disruptionlibrary"
exutil "github.com/openshift/origin/test/extended/util"
"github.com/sirupsen/logrus"

"k8s.io/client-go/rest"

"github.com/openshift/origin/pkg/monitor/backenddisruption"
"github.com/openshift/origin/pkg/monitor/monitorapi"
"github.com/openshift/origin/pkg/test/ginkgo/junitapi"

"k8s.io/client-go/kubernetes"
)

const (
Expand Down Expand Up @@ -47,7 +51,22 @@ func NewRecordCloudAvailabilityOnly() monitortestframework.MonitorTest {
}

func (w *cloudAvailability) StartCollection(ctx context.Context, adminRESTConfig *rest.Config, recorder monitorapi.RecorderWriter) error {

{
kubeClient, err := kubernetes.NewForConfig(adminRESTConfig)
if err != nil {
return err
}
isMicroShift, err := exutil.IsMicroShiftCluster(kubeClient)
if err != nil {
return fmt.Errorf("unable to determine if cluster is MicroShift: %v", err)
}
if isMicroShift {
w.notSupportedReason = &monitortestframework.NotSupportedError{
Reason: "platform MicroShift not supported",
}
return w.notSupportedReason
}
}
// Proxy jobs may require a whitelist we don't want to deal with:
clusterState, err := clusterdiscovery.DiscoverClusterState(adminRESTConfig)
if err != nil {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,18 +3,22 @@ package disruptionexternalgcpcloudservicemonitoring
import (
"context"
_ "embed"
"fmt"
"time"

"github.com/openshift/origin/pkg/clioptions/clusterdiscovery"
"github.com/openshift/origin/pkg/monitortestframework"
"github.com/openshift/origin/pkg/monitortestlibrary/disruptionlibrary"
exutil "github.com/openshift/origin/test/extended/util"
"github.com/sirupsen/logrus"

"k8s.io/client-go/rest"

"github.com/openshift/origin/pkg/monitor/backenddisruption"
"github.com/openshift/origin/pkg/monitor/monitorapi"
"github.com/openshift/origin/pkg/test/ginkgo/junitapi"

"k8s.io/client-go/kubernetes"
)

const (
Expand Down Expand Up @@ -45,6 +49,22 @@ func NewCloudAvailabilityInvariant() monitortestframework.MonitorTest {
}

func (w *cloudAvailability) StartCollection(ctx context.Context, adminRESTConfig *rest.Config, recorder monitorapi.RecorderWriter) error {
{
kubeClient, err := kubernetes.NewForConfig(adminRESTConfig)
if err != nil {
return err
}
isMicroShift, err := exutil.IsMicroShiftCluster(kubeClient)
if err != nil {
return fmt.Errorf("unable to determine if cluster is MicroShift: %v", err)
}
if isMicroShift {
w.notSupportedReason = &monitortestframework.NotSupportedError{
Reason: "platform MicroShift not supported",
}
return w.notSupportedReason
}
}

// Proxy jobs may require a whitelist we don't want to deal with:
clusterState, err := clusterdiscovery.DiscoverClusterState(adminRESTConfig)
Expand Down

0 comments on commit 8045e28

Please sign in to comment.