Repository navigation
Closed
Labels
language/goIssue is related to a Go operator project
Description
Bug Report
What did you do?
Ran:
/usr/local/bin/operator-sdk bundle validate ./bundle --select-optional suite=operatorframework
What did you expect to see?
Well, nothing. PodDisruptionBudget policy/v1beta1 was deprecated, but not policy/v1.
What did you see instead? Under which circumstances?
WARN[0000] Warning: Value cass-operator.v1.14.0-dev.a6054d2-20221229: this bundle is using APIs which were deprecated and removed in v1.25. More info: https://kubernetes.io/docs/reference/using-api/deprecation-guide/#v1-25. Migrate the API(s) for events: (["ClusterServiceVersion.Spec.InstallStrategy.StrategySpec.Permissions[0].Rules[1]" "ClusterServiceVersion.Spec.InstallStrategy.StrategySpec.Permissions[0].Rules[10]" "ClusterServiceVersion.Spec.InstallStrategy.StrategySpec.Permissions[0].Rules[11]"]),poddisruptionbudgets: (["ClusterServiceVersion.Spec.InstallStrategy.StrategySpec.Permissions[0].Rules[13]"]),
Coming from this rule:
- apiGroups:
- policy
resources:
- poddisruptionbudgets
verbs:
- create
- delete
- get
- list
- patch
- update
- watchThis is generated by the kubebuilder line:
// +kubebuilder:rbac:groups=policy,namespace=cass-operator,resources=poddisruptionbudgets,verbs=get;list;watch;create;update;patch;deleteWith controller-tools 0.10.0. policy/v1 PodDisruptionBudget is used in the project (which was introduced in 1.21 and is definitely available in 1.25). This works fine. The validation does not seem to understand the difference between versions.
Environment
Operator type:
/language go
Kubernetes cluster type:
kind, 1.25.2 (not that it matters)
$ operator-sdk version
operator-sdk version: "v1.26.0", commit: "cbeec475e4612e19f1047ff7014342afe93f60d2", kubernetes version: "v1.25.0", go version: "go1.19.4", GOOS: "darwin", GOARCH: "amd64"
$ go version (if language is Go)
1.19
$ kubectl version
1.25.2
Possible Solution
Additional context
Metadata
Metadata
Assignees
Labels
language/goIssue is related to a Go operator project
Activity
everettraven commentedon Jan 3, 2023
@burmanm Thanks for raising this issue! This is something that is in the process of being resolved. There was an issue in the validation logic with operator-framework/api that didn't check the groups and only the resource names for permissions.
This should have been resolved in the api repo as of operator-framework/api@f1b7296 and we just need to update our dependency on it in Operator SDK (PR #6227 updated the master branch). I'm hoping to get this included in a
1.26patch release, but if for some reason that doesn't happen the fix should be included in the next release of Operator-SDK.burmanm commentedon Jan 3, 2023
Sounds good. I'll wait until 1.27 until I try to enforce those warnings as failures.
everettraven commentedon Jan 9, 2023
Since this issue is technically resolved as of #6227 I am going to close this issue
tesshuflower commentedon Mar 22, 2023
@everettraven I think I'm still hitting this issue even with operator-sdk v1.26.1 (which appears to have the fix from #6227). I also tried with 1.27.0 but got the same warning.
The changelog for v1.26.1 mentions this:
However I think the issue here is that we have a rule that has the same group and kind but has a different version.
v1beta1is deprecated but we're usingv1. In my case it's events.k8s.io but I think it matches the scenario above from @burmanm.kubebuilder line:
And resulting rule:
Neither of these mentions v1beta1 but I still get the validation warning: