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

✨ (config-gen alpha command): upgrade sigs.k8s.io/controller-tools from v0.7.0 to v0.8.0 #2586

Merged
merged 1 commit into from
Apr 3, 2022

Conversation

AlmogBaku
Copy link
Member

@AlmogBaku AlmogBaku commented Apr 1, 2022

Description:

Update the controller-tools dep from 0.7.0 to .0.8.0 in the Kubebuilder CLI go mod which is only used by config-gen (alpha command).

Motivation

We could check that when we try to use the go version 1.18 the following errors are faced when the unit tests to check config-gen are executed. see :

/Users/AlmogBaku/go/pkg/mod/sigs.k8s.io/controller-runtime@v0.11.2/pkg/builder/webhook.go:27:2: missing go.sum entry for module providing package k8s.io/client-go/rest (imported by sigs.k8s.io/controller-runtime/pkg/builder); to add:
	go get sigs.k8s.io/controller-runtime/pkg/builder@v0.11.2
/Users/AlmogBaku/go/pkg/mod/sigs.k8s.io/controller-runtime@v0.11.2/pkg/client/patch.go:22:2: missing go.sum entry for module providing package github.com/evanphx/json-patch (imported by sigs.k8s.io/controller-runtime/pkg/client); to add:
	go get sigs.k8s.io/controller-runtime/pkg/client@v0.11.2
/Users/AlmogBaku/go/pkg/mod/k8s.io/kube-openapi@v0.0.0-20211115234752-e816edb12b65/pkg/util/proto/document.go:24:2: missing go.sum entry for module providing package github.com/googleapis/gnostic/openapiv2 (imported by k8s.io/kube-openapi/pkg/util/proto); to add:
	go get k8s.io/kube-openapi/pkg/util/proto@v0.0.0-20211115234752-e816edb12b65
/Users/AlmogBaku/go/pkg/mod/sigs.k8s.io/controller-runtime@v0.11.2/pkg/client/watch.go:26:2: missing go.sum entry for module providing package k8s.io/client-go/dynamic (imported by sigs.k8s.io/controller-runtime/pkg/client); to add:
	go get sigs.k8s.io/controller-runtime/pkg/client@v0.11.2

Why?

Tests were failing due to a missing go.mod project.
This was caused by a bizarre bug in go list, which it couldn't locate the appropriate go module.

The issue caused a lot of silent errors which complained upon the issue described above. Up until go 1.18 it was probably silenced totally, but now it's just panicing.

Solution:

  1. Do not ignore errors when creating the Runtime :)
  2. Solve the root cause by adding a go module in the pkg/cli/alpha/config-gen/testdata
  3. Upgrade outdated dependencies

Notes:

This PR is high-priority since it's blocking other PRs
Closes #2567

That was a tricky one ;-)

@k8s-ci-robot k8s-ci-robot added the cncf-cla: yes Indicates the PR's author has signed the CNCF CLA. label Apr 1, 2022
@k8s-ci-robot
Copy link
Contributor

Hi @AlmogBaku. Thanks for your PR.

I'm waiting for a kubernetes-sigs member to verify that this patch is reasonable to test. If it is, they should reply with /ok-to-test on its own line. Until that is done, I will not automatically test new commits in this PR, but the usual testing commands by org members will still work. Regular contributors should join the org to skip this step.

Once the patch is verified, the new status will be reflected by the ok-to-test label.

I understand the commands that are listed here.

Instructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the kubernetes/test-infra repository.

@k8s-ci-robot k8s-ci-robot added needs-ok-to-test Indicates a PR that requires an org member to verify it is safe to test. size/XXL Denotes a PR that changes 1000+ lines, ignoring generated files. labels Apr 1, 2022
@AlmogBaku
Copy link
Member Author

/cc @camilamacedo86

@camilamacedo86
Copy link
Member

/ok-to-test

@k8s-ci-robot k8s-ci-robot added ok-to-test Indicates a non-member PR verified by an org member that is safe to test. and removed needs-ok-to-test Indicates a PR that requires an org member to verify it is safe to test. labels Apr 1, 2022
@camilamacedo86
Copy link
Member

It is broken the unit-test checks
Could you please check?

@AlmogBaku AlmogBaku force-pushed the fix-tests-2567 branch 2 times, most recently from 00203ed to a4d53f8 Compare April 1, 2022 14:43
@AlmogBaku
Copy link
Member Author

/retest

@camilamacedo86
Copy link
Member

/test pull-kubebuilder-e2e-k8s-1-16-15

go.mod Show resolved Hide resolved
go.mod Show resolved Hide resolved
go.mod Show resolved Hide resolved
go.mod Show resolved Hide resolved
go.mod Show resolved Hide resolved
go.mod Show resolved Hide resolved
@AlmogBaku AlmogBaku changed the title 🌱 fix unit tests (config-gen bug) 🌱 fix unit tests (config-gen bug) ✨ (config-gen alpha command): upgrade sigs.k8s.io/controller-tools from v0.7.0 to v0.8.0 Apr 2, 2022
@AlmogBaku AlmogBaku force-pushed the fix-tests-2567 branch 2 times, most recently from f8e60da to 8ed8a7e Compare April 2, 2022 19:36
Copy link
Member

@camilamacedo86 camilamacedo86 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@AlmogBaku , thank you for the great contribution 🥇

Just a nit: The title description shows not accurate
Why?

🌱 fix unit tests (config-gen bug)

We have no bug in the tests. They work.
The problem is faced only when we try to use go 1.18
So, we need to update the required deps used by config-gen

Then, could we keep only the text from the ✨ ?

Also, about the description? Could we update for something like follows?WDYT?

**Description**
Update the controller-tools dep from 0.7.0 to .0.8.0 in the Kubebuilder CLI go mod which is only used by config-gen (alpha command). 

**Motivation**
We could check that when we try to use the go version 1.18 the following errors are faced when the unit tests to check config-gen are executed. see :

/Users/AlmogBaku/go/pkg/mod/sigs.k8s.io/controller-runtime@v0.11.2/pkg/builder/webhook.go:27:2: missing go.sum entry for module providing package k8s.io/client-go/rest (imported by sigs.k8s.io/controller-runtime/pkg/builder); to add:
	go get sigs.k8s.io/controller-runtime/pkg/builder@v0.11.2
/Users/AlmogBaku/go/pkg/mod/sigs.k8s.io/controller-runtime@v0.11.2/pkg/client/patch.go:22:2: missing go.sum entry for module providing package github.com/evanphx/json-patch (imported by sigs.k8s.io/controller-runtime/pkg/client); to add:
	go get sigs.k8s.io/controller-runtime/pkg/client@v0.11.2
/Users/AlmogBaku/go/pkg/mod/k8s.io/kube-openapi@v0.0.0-20211115234752-e816edb12b65/pkg/util/proto/document.go:24:2: missing go.sum entry for module providing package github.com/googleapis/gnostic/openapiv2 (imported by k8s.io/kube-openapi/pkg/util/proto); to add:
	go get k8s.io/kube-openapi/pkg/util/proto@v0.0.0-20211115234752-e816edb12b65
/Users/AlmogBaku/go/pkg/mod/sigs.k8s.io/controller-runtime@v0.11.2/pkg/client/watch.go:26:2: missing go.sum entry for module providing package k8s.io/client-go/dynamic (imported by sigs.k8s.io/controller-runtime/pkg/client); to add:
	go get sigs.k8s.io/controller-runtime/pkg/client@v0.11.2

Otherwise,
/approved

@k8s-ci-robot
Copy link
Contributor

[APPROVALNOTIFIER] This PR is APPROVED

This pull-request has been approved by: AlmogBaku, camilamacedo86

The full list of commands accepted by this bot can be found here.

The pull request process is described here

Needs approval from an approver in each of these files:

Approvers can indicate their approval by writing /approve in a comment
Approvers can cancel approval by writing /approve cancel in a comment

@k8s-ci-robot k8s-ci-robot added the approved Indicates a PR has been approved by an approver from all required OWNERS files. label Apr 2, 2022
@camilamacedo86
Copy link
Member

camilamacedo86 commented Apr 2, 2022

The API diff fails here because of the changes in the yaml dep:

sigs.k8s.io/kustomize/kyaml/fn/framework
  Incompatible changes:
  - Field.CurrentValue: changed from string to interface{}
  - Field.SuggestedValue: removed
  - ResourceList.Result: removed
  - Result.Error: removed
  - Result.ExitCode: removed
  - Result.Items: removed
  - Result.Name: removed
  - ResultItem: removed

It is only used by config-gen:

sigs.k8s.io/kustomize/kyaml v0.10.21 // for `kubebuilder alpha config-ge

Config-gen is an alpha command.
So that is not a reason for we block this PR.

@AlmogBaku AlmogBaku changed the title 🌱 fix unit tests (config-gen bug) ✨ (config-gen alpha command): upgrade sigs.k8s.io/controller-tools from v0.7.0 to v0.8.0 ✨ (config-gen alpha command): upgrade sigs.k8s.io/controller-tools from v0.7.0 to v0.8.0 Apr 3, 2022
@AlmogBaku
Copy link
Member Author

AlmogBaku commented Apr 3, 2022

@camilamacedo86 done

Can you please LGTM it?

@camilamacedo86
Copy link
Member

/lgtm

@k8s-ci-robot k8s-ci-robot added the lgtm "Looks good to me", indicates that a PR is ready to be merged. label Apr 3, 2022
@camilamacedo86 camilamacedo86 merged commit b23e467 into kubernetes-sigs:master Apr 3, 2022
@ryantking ryantking mentioned this pull request Apr 27, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
approved Indicates a PR has been approved by an approver from all required OWNERS files. cncf-cla: yes Indicates the PR's author has signed the CNCF CLA. lgtm "Looks good to me", indicates that a PR is ready to be merged. ok-to-test Indicates a non-member PR verified by an org member that is safe to test. size/XXL Denotes a PR that changes 1000+ lines, ignoring generated files.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Unit tests are not working locally (go 1.17.5)
3 participants