Skip to content
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
2 changes: 1 addition & 1 deletion .github/workflows/unit-test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ jobs:
- name: Set up Go 1.x
uses: actions/setup-go@v2
with:
go-version: ^1.17
go-version: 1.17

- name: Check out code into the Go module directory
uses: actions/checkout@v2
Expand Down
2 changes: 1 addition & 1 deletion controllers/providers/kubernetes/utils.go
Original file line number Diff line number Diff line change
Expand Up @@ -218,7 +218,7 @@ func GetKubernetesLocalConfig() (*rest.Config, error) {
}

func CRDExists(kubeClient dynamic.Interface, name string) bool {
CRDSchema := schema.GroupVersionResource{Group: "apiextensions.k8s.io", Version: "v1beta1", Resource: "customresourcedefinitions"}
CRDSchema := schema.GroupVersionResource{Group: "apiextensions.k8s.io", Version: "v1", Resource: "customresourcedefinitions"}
Copy link
Collaborator

Choose a reason for hiding this comment

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

oh wow, nice catch, didn't see this one when evaluating deprecated APIs
This would probably not be backwards compatible though, would it? i.e. what happens to people who are still running 1.19 once we change this.

Copy link
Collaborator

Choose a reason for hiding this comment

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

(I believe this deprecation happens in 1.22 which is pretty new)

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

V1 went GA in 1.16 IIRC

Copy link
Collaborator Author

@backjo backjo Apr 5, 2022

Choose a reason for hiding this comment

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

Yep, per https://kubernetes.io/blog/2021/07/14/upcoming-changes-in-kubernetes-1-22/ - V1 has been available since 1.16. Deprecation happened in 1.16, removal happens in 1.22.

Copy link
Collaborator

@eytan-avisror eytan-avisror Apr 5, 2022

Choose a reason for hiding this comment

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

CRDExists is used by upgrade stratgegy for crd strategy if you want to use some CRD to upgrade.
In this case, if you were using upgrade-manager's RollingUpgrade CRD, but you are still using v1beta1 version of it, you would have a problem right?

Copy link
Collaborator

Choose a reason for hiding this comment

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

Thats fine then, we should just probably add a release note on this being a potentially breaking change

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

You shouldn't - per Kubernetes docs

For example, suppose there are two API versions, v1 and v1beta1, for the same resource. If you originally created an object using the v1beta1 version of its API, you can later read, update, or delete that object using either the v1beta1 or the v1 API version.

Copy link
Collaborator

Choose a reason for hiding this comment

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

Right, so I guess it's a storedVersion for CRD type

_, err := kubeClient.Resource(CRDSchema).Get(context.Background(), name, metav1.GetOptions{})
if err != nil {
return false
Expand Down
2 changes: 1 addition & 1 deletion controllers/provisioners/eks/eks_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -281,7 +281,7 @@ func MockCustomResourceSpec() *unstructured.Unstructured {
func MockCustomResourceDefinition() *unstructured.Unstructured {
return &unstructured.Unstructured{
Object: map[string]interface{}{
"apiVersion": "apiextensions.k8s.io/v1beta1",
"apiVersion": "apiextensions.k8s.io/v1",
"kind": "CustomResourceDefinition",
"metadata": map[string]interface{}{
"name": "dogs.instancemgr.keikoproj.io",
Expand Down