You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Fix compiler and test failures with latest version of sigs.k8s.io/controller-runtime (#7979)
# Description
A [recent
change](kubernetes-sigs/controller-runtime#2903)
to the
[`controller-runtime`](https://github.com/kubernetes-sigs/controller-runtime/)
package caused Radius compilation errors and test failures, as
referenced in #7882. Breaking changes in `controller-runtime` include
the removal of a configuration option, and a new validation that
prevents duplicate controller names. This PR makes changes to update the
packages referenced, fix the compilation errors, and address the test
failures.
Changes include:
- Updates to `go.mod` and `go.sum`.
- Fixed compiler errors by moving the warning suppression configuration
from the `controller-runtime/pkg/client` options to
`client-go/rest/Config`, as required by the changes in
`controller-runtime`.
- Fixed broken tests by adding the `SkipNameValidation` configuration
parameter to unit tests for creating new controllers.
- Some refactoring of commonly shared test functions and constants in
`cli/controller/reconciler` into `shared-test.go`.
> NOTE: The compilation fix in this PR did not change the behavior of
the `rad` cli--only the tests were changed. The assumption is that `rad`
does not ever create controllers with duplicate names, so suppressing
the duplicate controller name validation is not necessary, even though
it is necessary in the automated tests.
## Type of change
- This pull request fixes a bug in Radius and has an approved issue
(issue link required).
Fixes: #7882
## Contributor checklist
Please verify that the PR meets the following requirements, where
applicable:
- [ ] An overview of proposed schema changes is included in a linked
GitHub issue.
- [ ] A design document PR is created in the [design-notes
repository](https://github.com/radius-project/design-notes/), if new
APIs are being introduced.
- [ ] If applicable, design document has been reviewed and approved by
Radius maintainers/approvers.
- [ ] A PR for the [samples
repository](https://github.com/radius-project/samples) is created, if
existing samples are affected by the changes in this PR.
- [ ] A PR for the [documentation
repository](https://github.com/radius-project/docs) is created, if the
changes in this PR affect the documentation or any user facing updates
are made.
- [ ] A PR for the [recipes
repository](https://github.com/radius-project/recipes) is created, if
existing recipes are affected by the changes in this PR.
---------
Signed-off-by: Brooke Hamilton <[email protected]>
Copy file name to clipboardExpand all lines: .devcontainer/contributor/devcontainer.json
+1-1Lines changed: 1 addition & 1 deletion
Original file line number
Diff line number
Diff line change
@@ -43,7 +43,7 @@
43
43
},
44
44
// Prerequisite for Code Generation, see https://github.com/radius-project/radius/tree/main/docs/contributing/contributing-code/contributing-code-prerequisites#code-generation
45
45
// Adding workspace as safe directory to avoid permission issues
46
-
"postCreateCommand": "git config --global --add safe.directory /workspaces/radius && cd typespec && npm ci && npm install -g autorest && npm install -g oav && go install sigs.k8s.io/controller-tools/cmd/controller-gen@v0.15.0 && go install go.uber.org/mock/[email protected]",
46
+
"postCreateCommand": "git config --global --add safe.directory /workspaces/radius && cd typespec && npm ci && npm install -g autorest && npm install -g oav && go install sigs.k8s.io/controller-tools/cmd/controller-gen@v0.16.0 && go install go.uber.org/mock/[email protected]",
0 commit comments