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

(feat) add new validator for deprecated apis #5216

Merged
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
17 changes: 17 additions & 0 deletions changelog/fragments/add-alpha-validator.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
# entries is a list of entries to include in
# release notes and/or the migration guide
entries:
- description: >
Add new optional validator `alpha-deprecated-apis` for the command bundle validate to help you verify if your bundle uses Kubernetes deprecated APIs.

# kind is one of:
# - addition
# - change
# - deprecation
# - removal
# - bugfix
kind: "addition"

# Is this a breaking change?
breaking: false

23 changes: 11 additions & 12 deletions go.mod
Original file line number Diff line number Diff line change
Expand Up @@ -12,8 +12,8 @@ require (
github.com/markbates/inflect v1.0.4
github.com/maxbrunsfeld/counterfeiter/v6 v6.2.2
github.com/onsi/ginkgo v1.16.4
github.com/onsi/gomega v1.13.0
github.com/operator-framework/api v0.10.5
github.com/onsi/gomega v1.15.0
github.com/operator-framework/api v0.10.6-0.20210916204207-e2541569a535
github.com/operator-framework/java-operator-plugins v0.1.0
github.com/operator-framework/operator-lib v0.6.0
github.com/operator-framework/operator-registry v1.17.4
Expand All @@ -22,24 +22,23 @@ require (
github.com/sergi/go-diff v1.1.0
github.com/sirupsen/logrus v1.8.1
github.com/spf13/afero v1.6.0
github.com/spf13/cobra v1.1.3
github.com/spf13/cobra v1.2.1
github.com/spf13/pflag v1.0.5
github.com/spf13/viper v1.7.0
github.com/spf13/viper v1.8.1
github.com/stretchr/testify v1.7.0
github.com/thoas/go-funk v0.8.0
golang.org/x/lint v0.0.0-20210508222113-6edffad5e616 // indirect
golang.org/x/mod v0.4.2
golang.org/x/tools v0.1.3
golang.org/x/tools v0.1.5
gomodules.xyz/jsonpatch/v3 v3.0.1
helm.sh/helm/v3 v3.6.2
k8s.io/api v0.21.2
k8s.io/apiextensions-apiserver v0.21.2
k8s.io/apimachinery v0.21.2
k8s.io/api v0.22.1
k8s.io/apiextensions-apiserver v0.22.1
k8s.io/apimachinery v0.22.1
k8s.io/cli-runtime v0.21.0
k8s.io/client-go v0.21.2
k8s.io/client-go v0.22.1
Copy link
Member

@varshaprasad96 varshaprasad96 Sep 16, 2021

Choose a reason for hiding this comment

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

we haven't bumped the dependencies to 1.22 yet, since kb didn't bump it yet. Though this just bumps the deps in SDK binary and not in the plugin, do we still wait till that is done?

Copy link
Member

Choose a reason for hiding this comment

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

This is certainly different than what we've done in the past right? @camilamacedo86 is this really needed for this change?

Copy link
Contributor Author

@camilamacedo86 camilamacedo86 Sep 17, 2021

Choose a reason for hiding this comment

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

The API is bumped. So, when we bump the API that is automatic.
KB does not use these deps in the CLI tool as well.
It has only k8s.io/apimachinery v0.21.3 which is used for the alpha-gen.

If I am not wrong, we needed first to ensure the controller runtime was updated.
Then, we could bump the scaffolds in KB and then here.

Copy link
Contributor Author

@camilamacedo86 camilamacedo86 Sep 17, 2021

Choose a reason for hiding this comment

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

Copy link
Member

@joelanford joelanford Sep 17, 2021

Choose a reason for hiding this comment

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

As long as we're:

  • not somehow using the deps of operator-sdk itself in the code that SDK scaffolds
  • able to pin our test environments (kind, envtest, etc.) to use the versions we want, not the versions of SDK's deps

I don't see how this API bump would be a problem. Since no one should be able to import SDK code anymore, this should have no affect on anything except the operator-sdk binary itself.

Is there a specific reason we know of that forces us to keep aligned with kubebuilder and/or our scaffolded code?

Copy link
Contributor Author

@camilamacedo86 camilamacedo86 Sep 17, 2021

Choose a reason for hiding this comment

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

Thank you for your input and help 🥇
I think the concern only comes because usually, we bumped KB first to also get the scaffolds updated as well.

@jmrodri @varshaprasad96 could we move forward?

k8s.io/kubectl v0.21.0
sigs.k8s.io/controller-runtime v0.9.2
sigs.k8s.io/controller-tools v0.6.0
sigs.k8s.io/controller-runtime v0.10.0
sigs.k8s.io/controller-tools v0.6.2
sigs.k8s.io/kubebuilder/v3 v3.0.0-alpha.0.0.20210803185103-51e4a9aa5055
sigs.k8s.io/yaml v1.2.0
)
Expand Down
Loading