-
Notifications
You must be signed in to change notification settings - Fork 426
CNTRLPLANE-2167:Integrate OpenShift Test Extension (OTE) into oc #2176
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -1,4 +1,5 @@ | ||
| /oc | ||
| /oc-tests-ext | ||
| /clicheck | ||
| /gendocs | ||
| /gendocs-admin | ||
|
|
||
| Original file line number | Diff line number | Diff line change | ||||||
|---|---|---|---|---|---|---|---|---|
|
|
@@ -28,7 +28,7 @@ GO_LD_EXTRAFLAGS :=-X k8s.io/component-base/version.gitMajor="1" \ | |||||||
| -X k8s.io/client-go/pkg/version.gitTreeState="$(SOURCE_GIT_TREE_STATE)" | ||||||||
|
|
||||||||
| GO_BUILD_PACKAGES :=$(strip \ | ||||||||
| ./cmd/... \ | ||||||||
| ./cmd/oc/... \ | ||||||||
| $(wildcard ./tools/*) \ | ||||||||
| ) | ||||||||
| # These tags make sure we can statically link and avoid shared dependencies | ||||||||
|
|
@@ -57,9 +57,12 @@ $(call build-image,ocp-cli,$(IMAGE_REGISTRY)/ocp/4.2:cli,./images/cli/Dockerfile | |||||||
|
|
||||||||
| $(call build-image,ocp-cli-artifacts,$(IMAGE_REGISTRY)/ocp/4.2:cli-artifacts,./images/cli-artifacts/Dockerfile.rhel,.) | ||||||||
|
|
||||||||
| $(call build-image,ocp-cli-tests,$(IMAGE_REGISTRY)/ocp/4.2:cli-tests,./images/cli-tests/Dockerfile.rhel,.) | ||||||||
|
Member
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
Suggested change
|
||||||||
|
|
||||||||
| $(call verify-golang-versions,images/cli/Dockerfile.rhel) | ||||||||
|
|
||||||||
| image-ocp-cli-artifacts: image-ocp-cli | ||||||||
| image-ocp-cli-tests: image-ocp-cli | ||||||||
|
|
||||||||
| $(call build-image,ocp-deployer,$(IMAGE_REGISTRY)/ocp/4.2:deployer,./images/deployer/Dockerfile.rhel,.) | ||||||||
| image-ocp-deployer: image-ocp-cli | ||||||||
|
|
@@ -71,6 +74,10 @@ oc: GO_BUILD_PACKAGES :=./cmd/oc | |||||||
| oc: build | ||||||||
| .PHONY: oc | ||||||||
|
|
||||||||
| oc-tests-ext: GO_BUILD_PACKAGES :=./cmd/oc-tests-ext | ||||||||
| oc-tests-ext: build | ||||||||
| .PHONY: oc-tests-ext | ||||||||
|
|
||||||||
| update: update-generated-completions | ||||||||
| .PHONY: update | ||||||||
|
|
||||||||
|
|
||||||||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,53 @@ | ||
| package main | ||
|
|
||
| import ( | ||
| "context" | ||
| "os" | ||
|
|
||
| "github.com/spf13/cobra" | ||
| "k8s.io/component-base/cli" | ||
|
|
||
| otecmd "github.com/openshift-eng/openshift-tests-extension/pkg/cmd" | ||
| oteextension "github.com/openshift-eng/openshift-tests-extension/pkg/extension" | ||
| "github.com/openshift/oc/pkg/version" | ||
|
|
||
| "k8s.io/klog/v2" | ||
| ) | ||
|
|
||
| func main() { | ||
|
Member
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. This binary should be added in .gitignore. |
||
| command := newOperatorTestCommand(context.Background()) | ||
| code := cli.Run(command) | ||
| os.Exit(code) | ||
| } | ||
|
|
||
| func newOperatorTestCommand(ctx context.Context) *cobra.Command { | ||
| registry := prepareOperatorTestsRegistry() | ||
|
|
||
| cmd := &cobra.Command{ | ||
| Use: "oc-tests-ext", | ||
| Short: "A binary used to run oc tests as part of OTE.", | ||
| Run: func(cmd *cobra.Command, args []string) { | ||
| if err := cmd.Help(); err != nil { | ||
| klog.Fatal(err) | ||
| } | ||
| }, | ||
| } | ||
|
|
||
| if v := version.Get().String(); len(v) == 0 { | ||
| cmd.Version = "<unknown>" | ||
| } else { | ||
| cmd.Version = v | ||
| } | ||
|
|
||
| cmd.AddCommand(otecmd.DefaultExtensionCommands(registry)...) | ||
|
|
||
| return cmd | ||
| } | ||
|
|
||
| func prepareOperatorTestsRegistry() *oteextension.Registry { | ||
| registry := oteextension.NewRegistry() | ||
| extension := oteextension.NewExtension("openshift", "payload", "oc") | ||
|
|
||
| registry.Register(extension) | ||
| return registry | ||
| } | ||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -38,6 +38,7 @@ require ( | |
| github.com/moby/term v0.5.2 | ||
| github.com/opencontainers/go-digest v1.0.0 | ||
| github.com/opencontainers/image-spec v1.1.0 | ||
| github.com/openshift-eng/openshift-tests-extension v0.0.0-20251125140340-13f4631a80b0 | ||
|
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. 🧩 Analysis chain🏁 Script executed: cat -n go.mod | sed -n '1,250p'Repository: openshift/oc Length of output: 13358 🌐 Web query:
💡 Result: Summary of findings (searched 2025–2026):
If you want, I can:
Sources
References (numbered above)
Would you like me to fetch the full advisories (NVD/GitHub/OSV links and exact affected versions + remediation commands)? Critical: cel.dev/expr v0.24.0 contains known vulnerabilities (CVE-2025-29786, CVE-2025-68156) that have been patched in later versions. The dependency
Upgrade 🤖 Prompt for AI Agents |
||
| github.com/openshift/api v0.0.0-20251111013132-5c461e21bdb7 | ||
| github.com/openshift/build-machinery-go v0.0.0-20251020112516-49aa9f5db6d8 | ||
| github.com/openshift/client-go v0.0.0-20251015124057-db0dee36e235 | ||
|
|
@@ -69,11 +70,13 @@ require ( | |
| ) | ||
|
|
||
| require ( | ||
| cel.dev/expr v0.24.0 // indirect | ||
| cyphar.com/go-pathrs v0.2.1 // indirect | ||
| github.com/Azure/go-ansiterm v0.0.0-20250102033503-faa5f7b0171c // indirect | ||
| github.com/Azure/go-ntlmssp v0.0.0-20221128193559-754e69321358 // indirect | ||
| github.com/BurntSushi/toml v1.5.0 // indirect | ||
| github.com/Microsoft/go-winio v0.6.2 // indirect | ||
| github.com/antlr4-go/antlr/v4 v4.13.0 // indirect | ||
| github.com/asaskevich/govalidator v0.0.0-20230301143203-a9d515a09cc2 // indirect | ||
| github.com/aws/aws-sdk-go-v2/aws/protocol/eventstream v1.7.1 // indirect | ||
| github.com/aws/aws-sdk-go-v2/credentials v1.18.16 // indirect | ||
|
|
@@ -134,6 +137,7 @@ require ( | |
| github.com/gonum/matrix v0.0.0-20181209220409-c518dec07be9 // indirect | ||
| github.com/gonum/stat v0.0.0-20181125101827-41a0da705a5b // indirect | ||
| github.com/google/btree v1.1.3 // indirect | ||
| github.com/google/cel-go v0.26.0 // indirect | ||
| github.com/google/gnostic-models v0.7.0 // indirect | ||
| github.com/google/go-containerregistry v0.20.0 // indirect | ||
| github.com/google/pprof v0.0.0-20241029153458-d1b30febd7db // indirect | ||
|
|
@@ -188,6 +192,7 @@ require ( | |
| github.com/sigstore/rekor v1.3.6 // indirect | ||
| github.com/sigstore/sigstore v1.8.4 // indirect | ||
| github.com/sirupsen/logrus v1.9.3 // indirect | ||
| github.com/stoewer/go-strcase v1.3.0 // indirect | ||
| github.com/stretchr/testify v1.11.1 // indirect | ||
| github.com/titanous/rocacheck v0.0.0-20171023193734-afe73141d399 // indirect | ||
| github.com/x448/float16 v0.8.4 // indirect | ||
|
|
@@ -201,6 +206,8 @@ require ( | |
| golang.org/x/text v0.31.0 // indirect | ||
| golang.org/x/time v0.9.0 // indirect | ||
| golang.org/x/tools v0.38.0 // indirect | ||
| google.golang.org/genproto/googleapis/api v0.0.0-20250303144028-a0af3efb3deb // indirect | ||
| google.golang.org/genproto/googleapis/rpc v0.0.0-20250303144028-a0af3efb3deb // indirect | ||
| google.golang.org/protobuf v1.36.8 // indirect | ||
| gopkg.in/evanphx/json-patch.v4 v4.12.0 // indirect | ||
| gopkg.in/inf.v0 v0.9.1 // indirect | ||
|
|
||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,12 @@ | ||
| # This Dockerfile builds an image containing oc-tests-ext binary for CI testing | ||
| FROM registry.ci.openshift.org/ocp/builder:rhel-9-golang-1.24-openshift-4.22 AS builder | ||
| WORKDIR /go/src/github.com/openshift/oc | ||
| COPY . . | ||
| RUN make oc-tests-ext --warn-undefined-variables \ | ||
| && gzip oc-tests-ext | ||
|
|
||
| FROM registry.ci.openshift.org/ocp/4.22:cli | ||
| COPY --from=builder /go/src/github.com/openshift/oc/oc-tests-ext.gz /usr/bin/ | ||
| LABEL io.k8s.display-name="OpenShift Test Extensions" \ | ||
| io.k8s.description="Test extensions for OpenShift CLI testing in CI." \ | ||
| io.openshift.tags="openshift,cli,tests" |
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,2 @@ | ||
| 7.3.2 | ||
| # Keep this pinned version in parity with cel-go |
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,2 @@ | ||
| *.pb.go linguist-generated=true | ||
| *.pb.go -diff -merge |
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,2 @@ | ||
| bazel-* | ||
| MODULE.bazel.lock |
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,34 @@ | ||
| load("@io_bazel_rules_go//go:def.bzl", "go_library") | ||
|
|
||
| package(default_visibility = ["//visibility:public"]) | ||
|
|
||
| licenses(["notice"]) # Apache 2.0 | ||
|
|
||
| go_library( | ||
| name = "expr", | ||
| srcs = [ | ||
| "checked.pb.go", | ||
| "eval.pb.go", | ||
| "explain.pb.go", | ||
| "syntax.pb.go", | ||
| "value.pb.go", | ||
| ], | ||
| importpath = "cel.dev/expr", | ||
| visibility = ["//visibility:public"], | ||
| deps = [ | ||
| "@org_golang_google_genproto_googleapis_rpc//status:go_default_library", | ||
| "@org_golang_google_protobuf//reflect/protoreflect", | ||
| "@org_golang_google_protobuf//runtime/protoimpl", | ||
| "@org_golang_google_protobuf//types/known/anypb", | ||
| "@org_golang_google_protobuf//types/known/durationpb", | ||
| "@org_golang_google_protobuf//types/known/emptypb", | ||
| "@org_golang_google_protobuf//types/known/structpb", | ||
| "@org_golang_google_protobuf//types/known/timestamppb", | ||
| ], | ||
| ) | ||
|
|
||
| alias( | ||
| name = "go_default_library", | ||
| actual = ":expr", | ||
| visibility = ["//visibility:public"], | ||
| ) |
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,25 @@ | ||
| # Contributor Code of Conduct | ||
| ## Version 0.1.1 (adapted from 0.3b-angular) | ||
|
|
||
| As contributors and maintainers of the Common Expression Language | ||
| (CEL) project, we pledge to respect everyone who contributes by | ||
| posting issues, updating documentation, submitting pull requests, | ||
| providing feedback in comments, and any other activities. | ||
|
|
||
| Communication through any of CEL's channels (GitHub, Gitter, IRC, | ||
| mailing lists, Google+, Twitter, etc.) must be constructive and never | ||
| resort to personal attacks, trolling, public or private harassment, | ||
| insults, or other unprofessional conduct. | ||
|
|
||
| We promise to extend courtesy and respect to everyone involved in this | ||
| project regardless of gender, gender identity, sexual orientation, | ||
| disability, age, race, ethnicity, religion, or level of experience. We | ||
| expect anyone contributing to the project to do the same. | ||
|
|
||
| If any member of the community violates this code of conduct, the | ||
| maintainers of the CEL project may take action, removing issues, | ||
| comments, and PRs or blocking accounts as deemed appropriate. | ||
|
|
||
| If you are subject to or witness unacceptable behavior, or have any | ||
| other concerns, please email us at | ||
| [[email protected]](mailto:[email protected]). |
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,32 @@ | ||
| # How to Contribute | ||
|
|
||
| We'd love to accept your patches and contributions to this project. There are a | ||
| few guidelines you need to follow. | ||
|
|
||
| ## Contributor License Agreement | ||
|
|
||
| Contributions to this project must be accompanied by a Contributor License | ||
| Agreement. You (or your employer) retain the copyright to your contribution, | ||
| this simply gives us permission to use and redistribute your contributions as | ||
| part of the project. Head over to <https://cla.developers.google.com/> to see | ||
| your current agreements on file or to sign a new one. | ||
|
|
||
| You generally only need to submit a CLA once, so if you've already submitted one | ||
| (even if it was for a different project), you probably don't need to do it | ||
| again. | ||
|
|
||
| ## Code reviews | ||
|
|
||
| All submissions, including submissions by project members, require review. We | ||
| use GitHub pull requests for this purpose. Consult | ||
| [GitHub Help](https://help.github.com/articles/about-pull-requests/) for more | ||
| information on using pull requests. | ||
|
|
||
| ## What to expect from maintainers | ||
|
|
||
| Expect maintainers to respond to new issues or pull requests within a week. | ||
| For outstanding and ongoing issues and particularly for long-running | ||
| pull requests, expect the maintainers to review within a week of a | ||
| contributor asking for a new review. There is no commitment to resolution -- | ||
| merging or closing a pull request, or fixing or closing an issue -- because some | ||
| issues will require more discussion than others. |
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,43 @@ | ||
| # Project Governance | ||
|
|
||
| This document defines the governance process for the CEL language. CEL is | ||
| Google-developed, but openly governed. Major contributors to the CEL | ||
| specification and its corresponding implementations constitute the CEL | ||
| Language Council. New members may be added by a unanimous vote of the | ||
| Council. | ||
|
|
||
| The MAINTAINERS.md file lists the members of the CEL Language Council, and | ||
| unofficially indicates the "areas of expertise" of each member with respect | ||
| to the publicly available CEL repos. | ||
|
|
||
| ## Code Changes | ||
|
|
||
| Code changes must follow the standard pull request (PR) model documented in the | ||
| CONTRIBUTING.md for each CEL repo. All fixes and features must be reviewed by a | ||
| maintainer. The maintainer reserves the right to request that any feature | ||
| request (FR) or PR be reviewed by the language council. | ||
|
|
||
| ## Syntax and Semantic Changes | ||
|
|
||
| Syntactic and semantic changes must be reviewed by the CEL Language Council. | ||
| Maintainers may also request language council review at their discretion. | ||
|
|
||
| The review process is as follows: | ||
|
|
||
| - Create a Feature Request in the CEL-Spec repo. The feature description will | ||
| serve as an abstract for the detailed design document. | ||
| - Co-develop a design document with the Language Council. | ||
| - Once the proposer gives the design document approval, the document will be | ||
| linked to the FR in the CEL-Spec repo and opened for comments to members of | ||
| the [email protected]. | ||
| - The Language Council will review the design doc at the next council meeting | ||
| (once every three weeks) and the council decision included in the document. | ||
|
|
||
| If the proposal is approved, the spec will be updated by a maintainer (if | ||
| applicable) and a rationale will be included in the CEL-Spec wiki to ensure | ||
| future developers may follow CEL's growth and direction over time. | ||
|
|
||
| Approved proposals may be implemented by the proposer or by the maintainers as | ||
| the parties see fit. At the discretion of the maintainer, changes from the | ||
| approved design are permitted during implementation if they improve the user | ||
| experience and clarity of the feature. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
GO_BUILD_PACKAGESstill buildsoc-tests-extbinary. It should be updated like this;