Skip to content

Commit

Permalink
Fix typo in test name
Browse files Browse the repository at this point in the history
  • Loading branch information
mandre committed Dec 19, 2023
1 parent c48eb27 commit 5dc5ef1
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 12 deletions.
3 changes: 2 additions & 1 deletion pkg/defaultmonitortests/types.go
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@ package defaultmonitortests

import (
"fmt"

"github.com/openshift/origin/pkg/monitortests/testframework/watchrequestcountscollector"
"github.com/sirupsen/logrus"

Expand Down Expand Up @@ -103,7 +104,7 @@ func newDefaultMonitorTests(info monitortestframework.MonitorTestInitializationI
monitorTestRegistry.AddMonitorTestOrDie("apiserver-availability", "kube-apiserver", disruptionlegacyapiservers.NewAvailabilityInvariant())
monitorTestRegistry.AddMonitorTestOrDie("apiserver-new-disruption-invariant", "kube-apiserver", disruptionnewapiserver.NewDisruptionInvariant())

monitorTestRegistry.AddMonitorTestOrDie("pod-network-avalibility", "Network / ovn-kubernetes", disruptionpodnetwork.NewPodNetworkAvalibilityInvariant(info))
monitorTestRegistry.AddMonitorTestOrDie("pod-network-availability", "Network / ovn-kubernetes", disruptionpodnetwork.NewPodNetworkAvailabilityInvariant(info))
monitorTestRegistry.AddMonitorTestOrDie("service-type-load-balancer-availability", "Networking / router", disruptionserviceloadbalancer.NewAvailabilityInvariant())
monitorTestRegistry.AddMonitorTestOrDie("ingress-availability", "Networking / router", disruptioningress.NewAvailabilityInvariant())

Expand Down
22 changes: 11 additions & 11 deletions pkg/monitortests/network/disruptionpodnetwork/monitortest.go
Original file line number Diff line number Diff line change
Expand Up @@ -76,21 +76,21 @@ func init() {
hostNetworkTargetService = resourceread.ReadServiceV1OrDie(yamlOrDie("host-network-target-service.yaml"))
}

type podNetworkAvalibility struct {
type podNetworkAvailability struct {
payloadImagePullSpec string
notSupportedReason error
namespaceName string
targetService *corev1.Service
kubeClient kubernetes.Interface
}

func NewPodNetworkAvalibilityInvariant(info monitortestframework.MonitorTestInitializationInfo) monitortestframework.MonitorTest {
return &podNetworkAvalibility{
func NewPodNetworkAvailabilityInvariant(info monitortestframework.MonitorTestInitializationInfo) monitortestframework.MonitorTest {
return &podNetworkAvailability{
payloadImagePullSpec: info.UpgradeTargetPayloadImagePullSpec,
}
}

func (pna *podNetworkAvalibility) StartCollection(ctx context.Context, adminRESTConfig *rest.Config, recorder monitorapi.RecorderWriter) error {
func (pna *podNetworkAvailability) StartCollection(ctx context.Context, adminRESTConfig *rest.Config, recorder monitorapi.RecorderWriter) error {
if len(pna.payloadImagePullSpec) == 0 {
configClient, err := configclient.NewForConfig(adminRESTConfig)
if err != nil {
Expand Down Expand Up @@ -209,7 +209,7 @@ func (pna *podNetworkAvalibility) StartCollection(ctx context.Context, adminREST
return nil
}

func (pna *podNetworkAvalibility) serviceHasEndpoints(ctx context.Context) (bool, error) {
func (pna *podNetworkAvailability) serviceHasEndpoints(ctx context.Context) (bool, error) {
targetServiceLabel, err := labels.NewRequirement("kubernetes.io/service-name", selection.Equals, []string{pna.targetService.Name})
if err != nil {
return false, err
Expand All @@ -235,7 +235,7 @@ func (pna *podNetworkAvalibility) serviceHasEndpoints(ctx context.Context) (bool
return false, nil
}

func (pna *podNetworkAvalibility) CollectData(ctx context.Context, storageDir string, beginning, end time.Time) (monitorapi.Intervals, []*junitapi.JUnitTestCase, error) {
func (pna *podNetworkAvailability) CollectData(ctx context.Context, storageDir string, beginning, end time.Time) (monitorapi.Intervals, []*junitapi.JUnitTestCase, error) {
if pna.notSupportedReason != nil {
return nil, nil, pna.notSupportedReason
}
Expand Down Expand Up @@ -267,7 +267,7 @@ func (pna *podNetworkAvalibility) CollectData(ctx context.Context, storageDir st
return retIntervals, junits, utilerrors.NewAggregate(errs)
}

func (pna *podNetworkAvalibility) collectDetailsForPoller(ctx context.Context, typeOfConnection string) (monitorapi.Intervals, []*junitapi.JUnitTestCase, []error) {
func (pna *podNetworkAvailability) collectDetailsForPoller(ctx context.Context, typeOfConnection string) (monitorapi.Intervals, []*junitapi.JUnitTestCase, []error) {
pollerLabel, err := labels.NewRequirement("network.openshift.io/disruption-actor", selection.Equals, []string{"poller"})
if err != nil {
return nil, nil, []error{err}
Expand Down Expand Up @@ -344,19 +344,19 @@ func (pna *podNetworkAvalibility) collectDetailsForPoller(ctx context.Context, t
return retIntervals, junits, errs
}

func (pna *podNetworkAvalibility) ConstructComputedIntervals(ctx context.Context, startingIntervals monitorapi.Intervals, recordedResources monitorapi.ResourcesMap, beginning, end time.Time) (constructedIntervals monitorapi.Intervals, err error) {
func (pna *podNetworkAvailability) ConstructComputedIntervals(ctx context.Context, startingIntervals monitorapi.Intervals, recordedResources monitorapi.ResourcesMap, beginning, end time.Time) (constructedIntervals monitorapi.Intervals, err error) {
return nil, pna.notSupportedReason
}

func (pna *podNetworkAvalibility) EvaluateTestsFromConstructedIntervals(ctx context.Context, finalIntervals monitorapi.Intervals) ([]*junitapi.JUnitTestCase, error) {
func (pna *podNetworkAvailability) EvaluateTestsFromConstructedIntervals(ctx context.Context, finalIntervals monitorapi.Intervals) ([]*junitapi.JUnitTestCase, error) {
return nil, pna.notSupportedReason
}

func (pna *podNetworkAvalibility) WriteContentToStorage(ctx context.Context, storageDir, timeSuffix string, finalIntervals monitorapi.Intervals, finalResourceState monitorapi.ResourcesMap) error {
func (pna *podNetworkAvailability) WriteContentToStorage(ctx context.Context, storageDir, timeSuffix string, finalIntervals monitorapi.Intervals, finalResourceState monitorapi.ResourcesMap) error {
return pna.notSupportedReason
}

func (pna *podNetworkAvalibility) Cleanup(ctx context.Context) error {
func (pna *podNetworkAvailability) Cleanup(ctx context.Context) error {
if len(pna.namespaceName) > 0 && pna.kubeClient != nil {
if err := pna.kubeClient.CoreV1().Namespaces().Delete(ctx, pna.namespaceName, metav1.DeleteOptions{}); err != nil {
return err
Expand Down

0 comments on commit 5dc5ef1

Please sign in to comment.