Skip to content

Commit f23c9d1

Browse files
committed
resolve merge conflict
2 parents 09ffe45 + 04cb35e commit f23c9d1

File tree

302 files changed

+961
-197019
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

302 files changed

+961
-197019
lines changed

Dockerfile.ocp

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,6 @@ FROM registry.ci.openshift.org/ocp/builder:rhel-9-golang-1.24-openshift-4.21 AS
22
WORKDIR /go/src/github.com/openshift/cluster-kube-scheduler-operator
33
COPY . .
44
RUN make build --warn-undefined-variables \
5-
&& make tests-ext-build \
65
&& gzip cluster-kube-scheduler-operator-tests-ext
76

87
FROM registry.ci.openshift.org/ocp/4.21:base-rhel9

Makefile

Lines changed: 0 additions & 47 deletions
Original file line numberDiff line numberDiff line change
@@ -9,9 +9,6 @@ include $(addprefix ./vendor/github.com/openshift/build-machinery-go/make/, \
99
targets/openshift/operator/telepresence.mk \
1010
)
1111

12-
# Exclude tests-ext from the main build target
13-
GO_BUILD_PACKAGES :=./cmd/cluster-kube-scheduler-operator ./cmd/render
14-
1512
# Exclude e2e tests from unit testing
1613
GO_TEST_PACKAGES :=./pkg/... ./cmd/... ./bindata/...
1714

@@ -44,47 +41,3 @@ clean:
4441
# See vendor/github.com/openshift/build-machinery-go/scripts/run-telepresence.sh for usage and configuration details
4542
export TP_DEPLOYMENT_YAML ?=./manifests/0000_25_kube-scheduler-operator_06_deployment.yaml
4643
export TP_CMD_PATH ?=./cmd/cluster-kube-scheduler-operator
47-
48-
# OpenShift Tests Extension variables
49-
TESTS_EXT_BINARY ?= cluster-kube-scheduler-operator-tests-ext
50-
TESTS_EXT_PACKAGE ?= ./cmd/cluster-kube-scheduler-operator-tests-ext
51-
TESTS_EXT_LDFLAGS ?= -X 'main.CommitFromGit=$(shell git rev-parse --short HEAD)' \
52-
-X 'main.BuildDate=$(shell date -u +%Y-%m-%dT%H:%M:%SZ)' \
53-
-X 'main.GitTreeState=$(shell if git diff-index --quiet HEAD --; then echo clean; else echo dirty; fi)'
54-
55-
# Build the openshift-tests-extension binary
56-
.PHONY: tests-ext-build
57-
tests-ext-build:
58-
GOOS=$(GOOS) GOARCH=$(GOARCH) GO_COMPLIANCE_POLICY=exempt_all CGO_ENABLED=0 \
59-
go build -o $(TESTS_EXT_BINARY) -ldflags "$(TESTS_EXT_LDFLAGS)" $(TESTS_EXT_PACKAGE)
60-
61-
# Update test metadata
62-
.PHONY: tests-ext-update
63-
tests-ext-update:
64-
./$(TESTS_EXT_BINARY) update
65-
66-
# Clean tests extension artifacts
67-
.PHONY: tests-ext-clean
68-
tests-ext-clean:
69-
rm -f $(TESTS_EXT_BINARY) $(TESTS_EXT_BINARY).gz
70-
71-
# Run tests extension help
72-
.PHONY: tests-ext-help
73-
tests-ext-help:
74-
./$(TESTS_EXT_BINARY) --help
75-
76-
77-
# Run sanity test
78-
.PHONY: tests-ext-sanity
79-
tests-ext-sanity:
80-
./$(TESTS_EXT_BINARY) run-suite "openshift/cluster-kube-scheduler-operator/conformance/parallel"
81-
82-
# List available tests
83-
.PHONY: tests-ext-list
84-
tests-ext-list:
85-
./$(TESTS_EXT_BINARY) list tests
86-
87-
# Show extension info
88-
.PHONY: tests-ext-info
89-
tests-ext-info:
90-
./$(TESTS_EXT_BINARY) info

README.md

Lines changed: 33 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -305,3 +305,36 @@ I0105 03:32:31.936642 1 dumper.go:52] "Dump of cached NodeInfo" nodes=<
305305
name: POD_NAME, namespace: POD_NAMESPACE, uid: 50bc7d7e-bd30-4c47-82ce-a9d3eb737434, phase: Running, nominated node:
306306
...
307307
```
308+
309+
## Tests
310+
311+
This repository is compatible with the [OpenShift Tests Extension (OTE)](https://github.com/openshift-eng/openshift-tests-extension) framework.
312+
313+
### Building the test binary
314+
315+
```bash
316+
make build
317+
```
318+
319+
### Running test suites and tests
320+
321+
```bash
322+
# Run a specific test suite or test
323+
./cluster-kube-scheduler-operator-tests-ext run-suite openshift/cluster-kube-scheduler-operator/all
324+
./cluster-kube-scheduler-operator-tests-ext run-test "test-name"
325+
326+
# Run with JUnit output
327+
./cluster-kube-scheduler-operator-tests-ext run-suite openshift/cluster-kube-scheduler-operator/all --junit-path /tmp/junit.xml
328+
```
329+
330+
### Listing available tests and suites
331+
332+
```bash
333+
# List all test suites
334+
./cluster-kube-scheduler-operator-tests-ext list suites
335+
336+
# List tests in a suite
337+
./cluster-kube-scheduler-operator-tests-ext list tests --suite=openshift/cluster-kube-scheduler-operator/all
338+
```
339+
340+
For more information about the OTE framework, see the [openshift-tests-extension documentation](https://github.com/openshift-eng/openshift-tests-extension).
Lines changed: 47 additions & 86 deletions
Original file line numberDiff line numberDiff line change
@@ -1,105 +1,66 @@
1+
/*
2+
This command is used to run the Cluster Kube Scheduler Operator tests extension for OpenShift.
3+
It registers the cluster-kube-scheduler-operator tests with the OpenShift Tests Extension framework
4+
and provides a command-line interface to execute them.
5+
For further information, please refer to the documentation at:
6+
https://github.com/openshift-eng/openshift-tests-extension/blob/main/cmd/example-tests/main.go
7+
*/
18
package main
29

310
import (
4-
"fmt"
11+
"context"
512
"os"
6-
"strings"
7-
8-
"github.com/openshift-eng/openshift-tests-extension/pkg/cmd"
9-
e "github.com/openshift-eng/openshift-tests-extension/pkg/extension"
10-
et "github.com/openshift-eng/openshift-tests-extension/pkg/extension/extensiontests"
11-
g "github.com/openshift-eng/openshift-tests-extension/pkg/ginkgo"
1213

1314
"github.com/spf13/cobra"
15+
"k8s.io/component-base/cli"
16+
17+
otecmd "github.com/openshift-eng/openshift-tests-extension/pkg/cmd"
18+
oteextension "github.com/openshift-eng/openshift-tests-extension/pkg/extension"
19+
"github.com/openshift/cluster-kube-scheduler-operator/pkg/version"
1420

15-
// The import below is necessary to ensure that the cluster etcd operator tests are registered with the extension.
16-
_ "github.com/openshift/cluster-kube-scheduler-operator/test/extended"
21+
"k8s.io/klog/v2"
1722
)
1823

1924
func main() {
20-
registry := e.NewRegistry()
21-
ext := e.NewExtension("openshift", "payload", "cluster-kube-scheduler-operator")
25+
command := newOperatorTestCommand(context.Background())
26+
code := cli.Run(command)
27+
os.Exit(code)
28+
}
2229

23-
// Suite: conformance/parallel (fast, parallel-safe)
24-
ext.AddSuite(e.Suite{
25-
Name: "openshift/cluster-kube-scheduler-operator/conformance/parallel",
26-
Parents: []string{"openshift/conformance/parallel"},
27-
Qualifiers: []string{
28-
`!(name.contains("[Serial]") || name.contains("[Slow]"))`,
29-
},
30-
})
30+
func newOperatorTestCommand(ctx context.Context) *cobra.Command {
31+
registry := prepareOperatorTestsRegistry()
3132

32-
// Suite: conformance/serial (explicitly serial tests)
33-
ext.AddSuite(e.Suite{
34-
Name: "openshift/cluster-kube-scheduler-operator/conformance/serial",
35-
Parents: []string{"openshift/conformance/serial"},
36-
Qualifiers: []string{
37-
`name.contains("[Serial]")`,
38-
},
39-
})
40-
41-
// Suite: optional/slow (long-running tests)
42-
ext.AddSuite(e.Suite{
43-
Name: "openshift/cluster-kube-scheduler-operator/optional/slow",
44-
Parents: []string{"openshift/optional/slow"},
45-
Qualifiers: []string{
46-
`name.contains("[Slow]")`,
33+
cmd := &cobra.Command{
34+
Use: "cluster-kube-scheduler-operator-tests-ext",
35+
Short: "A binary used to run cluster-kube-scheduler-operator tests as part of OTE.",
36+
Run: func(cmd *cobra.Command, args []string) {
37+
// no-op, logic is provided by the OTE framework
38+
if err := cmd.Help(); err != nil {
39+
klog.Fatal(err)
40+
}
4741
},
48-
})
49-
50-
// Suite: all (includes everything)
51-
ext.AddSuite(e.Suite{
52-
Name: "openshift/cluster-kube-scheduler-operator/all",
53-
})
54-
55-
specs, err := g.BuildExtensionTestSpecsFromOpenShiftGinkgoSuite()
56-
if err != nil {
57-
panic(fmt.Sprintf("couldn't build extension test specs from ginkgo: %+v", err.Error()))
5842
}
5943

60-
// Ensure [Disruptive] tests are also [Serial] (for any future tests that might need this)
61-
specs = specs.Walk(func(spec *et.ExtensionTestSpec) {
62-
if strings.Contains(spec.Name, "[Disruptive]") && !strings.Contains(spec.Name, "[Serial]") {
63-
spec.Name = strings.ReplaceAll(
64-
spec.Name,
65-
"[Disruptive]",
66-
"[Serial][Disruptive]",
67-
)
68-
}
69-
})
70-
71-
// Preserve original-name labels for renamed tests
72-
specs = specs.Walk(func(spec *et.ExtensionTestSpec) {
73-
for label := range spec.Labels {
74-
if strings.HasPrefix(label, "original-name:") {
75-
parts := strings.SplitN(label, "original-name:", 2)
76-
if len(parts) > 1 {
77-
spec.OriginalName = parts[1]
78-
}
79-
}
80-
}
81-
})
82-
83-
// Ignore obsolete tests
84-
ext.IgnoreObsoleteTests(
85-
// "[sig-etcd] <test name here>",
86-
)
87-
88-
// Initialize environment before running any tests
89-
specs.AddBeforeAll(func() {
90-
// do stuff
91-
})
92-
93-
ext.AddSpecs(specs)
94-
registry.Register(ext)
95-
96-
root := &cobra.Command{
97-
Long: "Cluster Kube Scheduler Operator Tests Extension",
44+
if v := version.Get().String(); len(v) == 0 {
45+
cmd.Version = "<unknown>"
46+
} else {
47+
cmd.Version = v
9848
}
9949

100-
root.AddCommand(cmd.DefaultExtensionCommands(registry)...)
50+
cmd.AddCommand(otecmd.DefaultExtensionCommands(registry)...)
10151

102-
if err := root.Execute(); err != nil {
103-
os.Exit(1)
104-
}
52+
return cmd
53+
}
54+
55+
// prepareOperatorTestsRegistry creates the OTE registry for this operator.
56+
//
57+
// Note:
58+
//
59+
// This method must be called before adding the registry to the OTE framework.
60+
func prepareOperatorTestsRegistry() *oteextension.Registry {
61+
registry := oteextension.NewRegistry()
62+
extension := oteextension.NewExtension("openshift", "payload", "cluster-kube-scheduler-operator")
63+
64+
registry.Register(extension)
65+
return registry
10566
}

go.mod

Lines changed: 3 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -6,10 +6,10 @@ require (
66
github.com/blang/semver/v4 v4.0.0
77
github.com/ghodss/yaml v1.0.0
88
github.com/google/go-cmp v0.7.0
9-
github.com/openshift/api v0.0.0-20251015095338-264e80a2b6e7
9+
github.com/openshift/api v0.0.0-20251111013132-5c461e21bdb7
1010
github.com/openshift/build-machinery-go v0.0.0-20250530140348-dc5b2804eeee
1111
github.com/openshift/client-go v0.0.0-20251015124057-db0dee36e235
12-
github.com/openshift/library-go v0.0.0-20251015151611-6fc7a74b67c5
12+
github.com/openshift/library-go v0.0.0-20251112091634-ab97ebb73f0f
1313
github.com/prometheus/client_golang v1.22.0
1414
github.com/prometheus/common v0.62.0
1515
github.com/spf13/cobra v1.9.1
@@ -26,11 +26,7 @@ require (
2626
k8s.io/utils v0.0.0-20250604170112-4c0f3b243397
2727
)
2828

29-
require (
30-
github.com/onsi/ginkgo/v2 v2.21.0
31-
github.com/onsi/gomega v1.35.1
32-
github.com/openshift-eng/openshift-tests-extension v0.0.0-20250916161632-d81c09058835
33-
)
29+
require github.com/openshift-eng/openshift-tests-extension v0.0.0-20250916161632-d81c09058835
3430

3531
require (
3632
cel.dev/expr v0.24.0 // indirect
@@ -52,7 +48,6 @@ require (
5248
github.com/go-openapi/jsonpointer v0.21.0 // indirect
5349
github.com/go-openapi/jsonreference v0.20.2 // indirect
5450
github.com/go-openapi/swag v0.23.0 // indirect
55-
github.com/go-task/slim-sprig/v3 v3.0.0 // indirect
5651
github.com/gogo/protobuf v1.3.2 // indirect
5752
github.com/golang/protobuf v1.5.4 // indirect
5853
github.com/google/btree v1.1.3 // indirect
@@ -106,7 +101,6 @@ require (
106101
golang.org/x/term v0.35.0 // indirect
107102
golang.org/x/text v0.29.0 // indirect
108103
golang.org/x/time v0.9.0 // indirect
109-
golang.org/x/tools v0.36.0 // indirect
110104
google.golang.org/genproto/googleapis/api v0.0.0-20250303144028-a0af3efb3deb // indirect
111105
google.golang.org/genproto/googleapis/rpc v0.0.0-20250303144028-a0af3efb3deb // indirect
112106
google.golang.org/grpc v1.72.1 // indirect

go.sum

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -63,6 +63,7 @@ github.com/go-openapi/jsonreference v0.20.2/go.mod h1:Bl1zwGIM8/wsvqjsOQLJ/SH+En
6363
github.com/go-openapi/swag v0.22.3/go.mod h1:UzaqsxGiab7freDnrUUra0MwWfN/q7tE4j+VcZ0yl14=
6464
github.com/go-openapi/swag v0.23.0 h1:vsEVJDUo2hPJ2tu0/Xc+4noaxyEffXNIs3cOULZ+GrE=
6565
github.com/go-openapi/swag v0.23.0/go.mod h1:esZ8ITTYEsH1V2trKHjAN8Ai7xHb8RV+YSZ577vPjgQ=
66+
github.com/go-task/slim-sprig v0.0.0-20230315185526-52ccab3ef572 h1:tfuBGBXKqDEevZMzYi5KSi8KkcZtzBcTgAUUtapy0OI=
6667
github.com/go-task/slim-sprig/v3 v3.0.0 h1:sUs3vkvUymDpBKi3qH1YSqBQk9+9D/8M2mN1vB6EwHI=
6768
github.com/go-task/slim-sprig/v3 v3.0.0/go.mod h1:W848ghGpv3Qj3dhTPRyJypKRiqCdHZiAzKg9hl15HA8=
6869
github.com/gobwas/httphead v0.1.0/go.mod h1:O/RXo79gxV8G+RqlR/otEwx4Q36zl9rqC5u12GKvMCM=
@@ -144,14 +145,14 @@ github.com/onsi/gomega v1.35.1 h1:Cwbd75ZBPxFSuZ6T+rN/WCb/gOc6YgFBXLlZLhC7Ds4=
144145
github.com/onsi/gomega v1.35.1/go.mod h1:PvZbdDc8J6XJEpDK4HCuRBm8a6Fzp9/DmhC9C7yFlog=
145146
github.com/openshift-eng/openshift-tests-extension v0.0.0-20250916161632-d81c09058835 h1:rkqIIfdYYkasXbF2XKVgh/3f1mhjSQK9By8WtVMgYo8=
146147
github.com/openshift-eng/openshift-tests-extension v0.0.0-20250916161632-d81c09058835/go.mod h1:6gkP5f2HL0meusT0Aim8icAspcD1cG055xxBZ9yC68M=
147-
github.com/openshift/api v0.0.0-20251015095338-264e80a2b6e7 h1:Ot2fbEEPmF3WlPQkyEW/bUCV38GMugH/UmZvxpWceNc=
148-
github.com/openshift/api v0.0.0-20251015095338-264e80a2b6e7/go.mod h1:d5uzF0YN2nQQFA0jIEWzzOZ+edmo6wzlGLvx5Fhz4uY=
148+
github.com/openshift/api v0.0.0-20251111013132-5c461e21bdb7 h1:fdvcDJySvjVJctbPbdLPoMiMk+bls34+eq6tWOqdFZg=
149+
github.com/openshift/api v0.0.0-20251111013132-5c461e21bdb7/go.mod h1:d5uzF0YN2nQQFA0jIEWzzOZ+edmo6wzlGLvx5Fhz4uY=
149150
github.com/openshift/build-machinery-go v0.0.0-20250530140348-dc5b2804eeee h1:+Sp5GGnjHDhT/a/nQ1xdp43UscBMr7G5wxsYotyhzJ4=
150151
github.com/openshift/build-machinery-go v0.0.0-20250530140348-dc5b2804eeee/go.mod h1:8jcm8UPtg2mCAsxfqKil1xrmRMI3a+XU2TZ9fF8A7TE=
151152
github.com/openshift/client-go v0.0.0-20251015124057-db0dee36e235 h1:9JBeIXmnHlpXTQPi7LPmu1jdxznBhAE7bb1K+3D8gxY=
152153
github.com/openshift/client-go v0.0.0-20251015124057-db0dee36e235/go.mod h1:L49W6pfrZkfOE5iC1PqEkuLkXG4W0BX4w8b+L2Bv7fM=
153-
github.com/openshift/library-go v0.0.0-20251015151611-6fc7a74b67c5 h1:bANtDc8SgetSK4nQehf59x3+H9FqVJCprgjs49/OTg0=
154-
github.com/openshift/library-go v0.0.0-20251015151611-6fc7a74b67c5/go.mod h1:OlFFws1AO51uzfc48MsStGE4SFMWlMZD0+f5a/zCtKI=
154+
github.com/openshift/library-go v0.0.0-20251112091634-ab97ebb73f0f h1:r1pLosA7z3+t+lzW29FU54sg4/pAWu+lsKD0L5Gx3wg=
155+
github.com/openshift/library-go v0.0.0-20251112091634-ab97ebb73f0f/go.mod h1:ErDfiIrPHH+menTP/B4LKd0nxFDdvCbTamAc6SWMIh8=
155156
github.com/openshift/onsi-ginkgo/v2 v2.6.1-0.20241205171354-8006f302fd12 h1:AKx/w1qpS8We43bsRgf8Nll3CGlDHpr/WAXvuedTNZI=
156157
github.com/openshift/onsi-ginkgo/v2 v2.6.1-0.20241205171354-8006f302fd12/go.mod h1:7Du3c42kxCUegi0IImZ1wUQzMBVecgIHjR1C+NkhLQo=
157158
github.com/orisano/pixelmatch v0.0.0-20220722002657-fb0b55479cde/go.mod h1:nZgzbfBr3hhjoZnS66nKrHmduYNpc34ny7RK4z5/HM0=

pkg/operator/targetconfigcontroller/targetconfigcontroller.go

Lines changed: 0 additions & 25 deletions
Original file line numberDiff line numberDiff line change
@@ -199,31 +199,6 @@ func manageKubeSchedulerConfigMap_v311_00_to_latest(ctx context.Context, feature
199199
return nil, false, err
200200
}
201201

202-
var enableDRAPlugin bool
203-
switch config.Spec.ProfileCustomizations.DynamicResourceAllocation {
204-
case v1.DRAEnablementEnabled:
205-
enableDRAPlugin = true
206-
case "", v1.DRAEnablementDisabled:
207-
// no-op
208-
default:
209-
return nil, false, fmt.Errorf("dynamicResourceAllocation customization %q not recognized", config.Spec.ProfileCustomizations.DynamicResourceAllocation)
210-
}
211-
// if the feature gate DynamicResourceAllocation is enabled, we will enable the plugin
212-
if !enableDRAPlugin {
213-
if featureGates.Enabled("DynamicResourceAllocation") {
214-
enableDRAPlugin = true
215-
}
216-
}
217-
if enableDRAPlugin {
218-
if len(schedulerConfiguration.Profiles) == 0 {
219-
schedulerConfiguration.Profiles = []schedulerconfigv1.KubeSchedulerProfile{{}}
220-
}
221-
if schedulerConfiguration.Profiles[0].Plugins == nil {
222-
schedulerConfiguration.Profiles[0].Plugins = &schedulerconfigv1.Plugins{}
223-
}
224-
schedulerConfiguration.Profiles[0].Plugins.MultiPoint.Enabled = append(schedulerConfiguration.Profiles[0].Plugins.MultiPoint.Enabled, schedulerconfigv1.Plugin{Name: "DynamicResources"})
225-
}
226-
227202
schedulerConfigurationBytes, err := yaml.Marshal(schedulerConfiguration)
228203
if err != nil {
229204
return nil, false, err

0 commit comments

Comments
 (0)