Skip to content

Commit 57e9293

Browse files
authored
Revert "OTA-1546: Add a serial e2e for accept-risks"
1 parent f763687 commit 57e9293

10 files changed

Lines changed: 17 additions & 227 deletions

File tree

.openshift-tests-extension/openshift_payload_cluster-version-operator.json

Lines changed: 0 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -1,16 +1,4 @@
11
[
2-
{
3-
"name": "[Jira:\"Cluster Version Operator\"] cluster-version-operator should work with accept risks",
4-
"labels": {
5-
"Serial": {}
6-
},
7-
"resources": {
8-
"isolation": {}
9-
},
10-
"source": "openshift:payload:cluster-version-operator",
11-
"lifecycle": "blocking",
12-
"environmentSelector": {}
13-
},
142
{
153
"name": "[Jira:\"Cluster Version Operator\"] cluster-version-operator-tests should support passing tests",
164
"labels": {},

cmd/cluster-version-operator-tests/main.go

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,7 @@ func main() {
2424
Name: "openshift/cluster-version-operator/conformance/parallel",
2525
Parents: []string{"openshift/conformance/parallel"},
2626
Qualifiers: []string{
27-
`!(name.contains("[Serial]") || "Serial" in labels || name.contains("[Slow]"))`,
27+
`!(name.contains("[Serial]") || name.contains("[Slow]"))`,
2828
},
2929
})
3030

@@ -33,7 +33,7 @@ func main() {
3333
Name: "openshift/cluster-version-operator/conformance/serial",
3434
Parents: []string{"openshift/conformance/serial"},
3535
Qualifiers: []string{
36-
`name.contains("[Serial]") || "Serial" in labels`,
36+
`name.contains("[Serial]")`,
3737
},
3838
})
3939

lib/resourcebuilder/apps.go

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,6 @@ import (
1313
metav1 "k8s.io/apimachinery/pkg/apis/meta/v1"
1414
"k8s.io/klog/v2"
1515

16-
"github.com/openshift/cluster-version-operator/pkg/external"
1716
"github.com/openshift/cluster-version-operator/pkg/payload"
1817
)
1918

@@ -40,7 +39,7 @@ func (b *builder) modifyDeployment(ctx context.Context, deployment *appsv1.Deplo
4039
// if we detect the CVO deployment we need to replace the KUBERNETES_SERVICE_HOST env var with the internal load
4140
// balancer to be resilient to kube-apiserver rollouts that cause the localhost server to become non-responsive for
4241
// multiple minutes.
43-
if deployment.Namespace == external.DefaultCVONamespace && deployment.Name == external.DefaultDeploymentName {
42+
if deployment.Namespace == "openshift-cluster-version" && deployment.Name == "cluster-version-operator" {
4443
infrastructureConfig, err := b.configClientv1.Infrastructures().Get(ctx, "cluster", metav1.GetOptions{})
4544
// not found just means that we don't have infrastructure configuration yet, so we should tolerate not found and avoid substitution
4645
if err != nil && !errors.IsNotFound(err) {
@@ -64,7 +63,7 @@ func (b *builder) modifyDeployment(ctx context.Context, deployment *appsv1.Deplo
6463
}
6564
err = updatePodSpecWithInternalLoadBalancerKubeService(
6665
&deployment.Spec.Template.Spec,
67-
[]string{external.DefaultContainerName},
66+
[]string{"cluster-version-operator"},
6867
lbHost,
6968
lbPort,
7069
)

pkg/cvo/sync_worker.go

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,6 @@ import (
2626
configv1 "github.com/openshift/api/config/v1"
2727

2828
"github.com/openshift/cluster-version-operator/lib/capability"
29-
"github.com/openshift/cluster-version-operator/pkg/internal"
3029
"github.com/openshift/cluster-version-operator/pkg/payload"
3130
"github.com/openshift/cluster-version-operator/pkg/payload/precondition"
3231
)
@@ -330,7 +329,7 @@ func (w *SyncWorker) syncPayload(ctx context.Context, work *SyncWork) ([]configv
330329
// The remainder of this logic is for loading a new payload.
331330
// Any filtering as to not needing to reload the payload should be done in the switch before this point.
332331

333-
cvoObjectRef := &corev1.ObjectReference{APIVersion: "config.openshift.io/v1", Kind: "ClusterVersion", Name: internal.DefaultClusterVersionName, Namespace: internal.DefaultCVONamespace}
332+
cvoObjectRef := &corev1.ObjectReference{APIVersion: "config.openshift.io/v1", Kind: "ClusterVersion", Name: "version", Namespace: "openshift-cluster-version"}
334333
msg := fmt.Sprintf("Retrieving and verifying payload version=%q image=%q", desired.Version, desired.Image)
335334
w.eventRecorder.Eventf(cvoObjectRef, corev1.EventTypeNormal, "RetrievePayload", msg)
336335
reporter.ReportPayload(LoadPayloadStatus{

pkg/external/constants.go

Lines changed: 0 additions & 21 deletions
This file was deleted.

pkg/internal/constants.go

Lines changed: 0 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -7,15 +7,6 @@ import (
77
)
88

99
const (
10-
// DefaultCVONamespace is the default namespace for the Cluster Version Operator
11-
DefaultCVONamespace = "openshift-cluster-version"
12-
// DefaultClusterVersionName is the default name for the Cluster Version resource managed by the Cluster Version Operator
13-
DefaultClusterVersionName = "version"
14-
// DefaultDeploymentName is the default name of the deployment for the Cluster Version Operator
15-
DefaultDeploymentName = "cluster-version-operator"
16-
// DefaultContainerName is the default container name in the deployment for the Cluster Version Operator
17-
DefaultContainerName = DefaultDeploymentName
18-
1910
ConfigNamespace = "openshift-config"
2011
ConfigManagedNamespace = "openshift-config-managed"
2112
AdminGatesConfigMap = "admin-gates"

pkg/start/start.go

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -49,6 +49,9 @@ import (
4949
)
5050

5151
const (
52+
defaultComponentName = "version"
53+
defaultComponentNamespace = "openshift-cluster-version"
54+
5255
minResyncPeriod = 2 * time.Minute
5356
)
5457

@@ -119,8 +122,8 @@ func NewOptions() *Options {
119122
PromQLTarget: defaultPromQLTarget,
120123

121124
// exposed only for testing
122-
Namespace: defaultEnv("CVO_NAMESPACE", internal.DefaultCVONamespace),
123-
Name: defaultEnv("CVO_NAME", internal.DefaultClusterVersionName),
125+
Namespace: defaultEnv("CVO_NAMESPACE", defaultComponentNamespace),
126+
Name: defaultEnv("CVO_NAME", defaultComponentName),
124127
PayloadOverride: os.Getenv("PAYLOAD_OVERRIDE"),
125128
ResyncInterval: minResyncPeriod,
126129
Exclude: os.Getenv("EXCLUDE_MANIFESTS"),

test/cvo/accept_risks.go

Lines changed: 0 additions & 140 deletions
This file was deleted.

test/cvo/cvo.go

Lines changed: 7 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,3 @@
1-
// Package cvo contains end-to-end tests for the Cluster Version Operator.
2-
// The accept_risks test validates the feature about accept risks for conditional updates.
31
package cvo
42

53
import (
@@ -12,14 +10,15 @@ import (
1210
g "github.com/onsi/ginkgo/v2"
1311
o "github.com/onsi/gomega"
1412

15-
"github.com/openshift/cluster-version-operator/pkg/external"
1613
"github.com/openshift/cluster-version-operator/test/oc"
1714
ocapi "github.com/openshift/cluster-version-operator/test/oc/api"
1815
"github.com/openshift/cluster-version-operator/test/util"
1916
)
2017

2118
var logger = g.GinkgoLogr.WithName("cluster-version-operator-tests")
2219

20+
const cvoNamespace = "openshift-cluster-version"
21+
2322
var _ = g.Describe(`[Jira:"Cluster Version Operator"] cluster-version-operator-tests`, func() {
2423
g.It("should support passing tests", func() {
2524
o.Expect(true).To(o.BeTrue())
@@ -67,14 +66,14 @@ var _ = g.Describe(`[Jira:"Cluster Version Operator"] cluster-version-operator`,
6766
o.Expect(err).NotTo(o.HaveOccurred(), "Failed to determine if cluster is MicroShift")
6867

6968
g.By("Checking that the 'openshift.io/run-level' label exists on the namespace and has the empty value")
70-
ns, err := kubeClient.CoreV1().Namespaces().Get(ctx, external.DefaultCVONamespace, metav1.GetOptions{})
71-
o.Expect(err).NotTo(o.HaveOccurred(), "Failed to get namespace %s", external.DefaultCVONamespace)
69+
ns, err := kubeClient.CoreV1().Namespaces().Get(ctx, cvoNamespace, metav1.GetOptions{})
70+
o.Expect(err).NotTo(o.HaveOccurred(), "Failed to get namespace %s", cvoNamespace)
7271
runLevel, exists := ns.Labels["openshift.io/run-level"]
73-
o.Expect(exists).To(o.BeTrue(), "The 'openshift.io/run-level' label on namespace %s does not exist", external.DefaultCVONamespace)
74-
o.Expect(runLevel).To(o.BeEmpty(), "Expected the 'openshift.io/run-level' label value on namespace %s has the empty value, but got %s", external.DefaultCVONamespace, runLevel)
72+
o.Expect(exists).To(o.BeTrue(), "The 'openshift.io/run-level' label on namespace %s does not exist", cvoNamespace)
73+
o.Expect(runLevel).To(o.BeEmpty(), "Expected the 'openshift.io/run-level' label value on namespace %s has the empty value, but got %s", cvoNamespace, runLevel)
7574

7675
g.By("Checking that the annotation 'openshift.io/scc annotation' on the CVO pod has the value hostaccess")
77-
podList, err := kubeClient.CoreV1().Pods(external.DefaultCVONamespace).List(ctx, metav1.ListOptions{
76+
podList, err := kubeClient.CoreV1().Pods(cvoNamespace).List(ctx, metav1.ListOptions{
7877
LabelSelector: "k8s-app=cluster-version-operator",
7978
FieldSelector: "status.phase=Running",
8079
})

test/util/util.go

Lines changed: 0 additions & 28 deletions
Original file line numberDiff line numberDiff line change
@@ -5,8 +5,6 @@ import (
55
"time"
66

77
g "github.com/onsi/ginkgo/v2"
8-
o "github.com/onsi/gomega"
9-
108
configv1 "github.com/openshift/api/config/v1"
119
clientconfigv1 "github.com/openshift/client-go/config/clientset/versioned"
1210
corev1 "k8s.io/api/core/v1"
@@ -108,29 +106,3 @@ func GetKubeClient(restConfig *rest.Config) (kubernetes.Interface, error) {
108106
func GetConfigClient(restConfig *rest.Config) (clientconfigv1.Interface, error) {
109107
return clientconfigv1.NewForConfig(restConfig)
110108
}
111-
112-
// IsTechPreviewNoUpgrade checks if a cluster is a TechPreviewNoUpgrade cluster
113-
func IsTechPreviewNoUpgrade(ctx context.Context, restConfig *rest.Config) bool {
114-
configClient, err := GetConfigClient(restConfig)
115-
o.Expect(err).NotTo(o.HaveOccurred())
116-
featureGate, err := configClient.ConfigV1().FeatureGates().Get(ctx, "cluster", metav1.GetOptions{})
117-
if err != nil {
118-
if apierrors.IsNotFound(err) {
119-
return false
120-
}
121-
o.Expect(err).NotTo(o.HaveOccurred(), "could not retrieve feature-gate: %v", err)
122-
}
123-
return featureGate.Spec.FeatureSet == configv1.TechPreviewNoUpgrade
124-
}
125-
126-
// SkipIfNotTechPreviewNoUpgrade skips the test if a cluster is not a TechPreviewNoUpgrade cluster
127-
func SkipIfNotTechPreviewNoUpgrade(ctx context.Context, restConfig *rest.Config) {
128-
if !IsTechPreviewNoUpgrade(ctx, restConfig) {
129-
g.Skip("This test is skipped because the Tech Preview NoUpgrade is not enabled")
130-
}
131-
}
132-
133-
const (
134-
// fauxinnati mocks Cincinnati Update Graph Server for OpenShift
135-
FauxinnatiAPIURL = "https://fauxinnati-fauxinnati.apps.ota-stage.q2z4.p1.openshiftapps.com/api/upgrades_info/graph"
136-
)

0 commit comments

Comments
 (0)