Skip to content
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

Registry operator fails on unit tests #1519

Closed
michael-valdron opened this issue Apr 11, 2024 · 3 comments · Fixed by devfile/registry-operator#87
Closed

Registry operator fails on unit tests #1519

michael-valdron opened this issue Apr 11, 2024 · 3 comments · Fixed by devfile/registry-operator#87
Assignees
Labels
area/registry Devfile registry for stacks and infrastructure kind/bug Something isn't working severity/blocker Issues that prevent developers from working

Comments

@michael-valdron
Copy link
Member

michael-valdron commented Apr 11, 2024

Which area this feature is related to?

/kind bug

Which area this bug is related to?

/area registry

What versions of software are you using?

Go project

Operating System and version: N/A

Go Pkg Version: 1.19

Bug Summary

Describe the bug:

The unit tests on failing for the registry operator when doing a fresh install of sigs.k8s.io/controller-runtime/tools/setup-envtest for setting up the testing environment. The failures only seem to happen if the latest version installed during fresh installs.

To Reproduce:

  1. Ensure sigs.k8s.io/controller-runtime/tools/setup-envtest is not installed, generally by removing the ignored bin directory from past runs
  2. Run make test

Expected behavior

Running should successfully run all unit test cases for registry operator.

Any logs, error output, screenshots etc? Provide the devfile that sees this bug, if applicable

mkdir -p /home/mvaldron/source/repos/michael-valdron/devfile-registry-operator/bin
test -s /home/mvaldron/source/repos/michael-valdron/devfile-registry-operator/bin/controller-gen && /home/mvaldron/source/repos/michael-valdron/devfile-registry-operator/bin/controller-gen --version | grep -q v0.9.2 || \
GOBIN=/home/mvaldron/source/repos/michael-valdron/devfile-registry-operator/bin GOFLAGS="" go install sigs.k8s.io/controller-tools/cmd/controller-gen@v0.9.2
/home/mvaldron/source/repos/michael-valdron/devfile-registry-operator/bin/controller-gen rbac:roleName=manager-role crd webhook paths="./..." output:crd:artifacts:config=config/crd/bases
/home/mvaldron/source/repos/michael-valdron/devfile-registry-operator/bin/controller-gen object:headerFile="hack/boilerplate.go.txt" paths="./..."
go fmt ./...
go vet ./...
test -s /home/mvaldron/source/repos/michael-valdron/devfile-registry-operator/bin/setup-envtest || GOBIN=/home/mvaldron/source/repos/michael-valdron/devfile-registry-operator/bin GOFLAGS="" go install sigs.k8s.io/controller-runtime/tools/setup-envtest@latest
go: downloading sigs.k8s.io/controller-runtime v0.17.3
go: downloading sigs.k8s.io/controller-runtime/tools/setup-envtest v0.0.0-20240411191551-a7508decdfef
go: sigs.k8s.io/controller-runtime/tools/setup-envtest@latest (in sigs.k8s.io/controller-runtime/tools/setup-envtest@v0.0.0-20240411191551-a7508decdfef): go.mod:3: invalid go version '1.22.0': must match format 1.23
make: *** [Makefile:262: /home/mvaldron/source/repos/michael-valdron/devfile-registry-operator/bin/setup-envtest] Error 1

Additional context

Any workaround?

None at the moment, aside from fix or updating Go version for the module, there is an open issue kubernetes-sigs/controller-runtime#2744 to address this, if it is resolved it might be possible to restore the latest tag.

Suggestion on how to fix the bug

Replace latest with the latest capped version number which is compatible with Go 1.19: Makefile#L262

@michael-valdron michael-valdron self-assigned this Apr 11, 2024
@openshift-ci openshift-ci bot added kind/bug Something isn't working area/registry Devfile registry for stacks and infrastructure labels Apr 11, 2024
@michael-valdron michael-valdron added the severity/blocker Issues that prevent developers from working label Apr 11, 2024
@michael-valdron
Copy link
Member Author

Related issue: kubernetes-sigs/controller-runtime#2744

@michael-valdron
Copy link
Member Author

Last working revision of setup-envtest is v0.0.0-20240405143037-c25fe2f5ca0f, best to use this one.

@michael-valdron
Copy link
Member Author

Bugfix PR ready for review: devfile/registry-operator#87

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
area/registry Devfile registry for stacks and infrastructure kind/bug Something isn't working severity/blocker Issues that prevent developers from working
Projects
Status: Done ✅
Development

Successfully merging a pull request may close this issue.

1 participant