Repository: keikoproj/instance-manager
Pull request #355 (2022-04-05 22:53:53)

fix: use non-deprecated CRD api
Signed-off-by: Jonah Back <jonah@jonahback.com>

codecov[bot]: # [Codecov](https://codecov.io/gh/keikoproj/instance-manager/pull/355?src=pr&el=h1&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=keikoproj) Report
> Merging [#355](https://codecov.io/gh/keikoproj/instance-manager/pull/355?src=pr&el=desc&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=keikoproj) (1a22aa6) into [master](https://codecov.io/gh/keikoproj/instance-manager/commit/d1cd32a4353ccdfe8655c7aa14e9cce030851c30?el=desc&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=keikoproj) (d1cd32a) will **not change** coverage.
> The diff coverage is `0.00%`.

```diff
@@           Coverage Diff           @@
##           master     #355   +/-   ##
=======================================
  Coverage   51.44%   51.44%           
=======================================
  Files          33       33           
  Lines        4556     4556           
=======================================
  Hits         2344     2344           
  Misses       2065     2065           
  Partials      147      147           
```


| [Impacted Files](https://codecov.io/gh/keikoproj/instance-manager/pull/355?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=keikoproj) | Coverage Δ | |
|---|---|---|
| [controllers/providers/kubernetes/utils.go](https://codecov.io/gh/keikoproj/instance-manager/pull/355/diff?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=keikoproj#diff-Y29udHJvbGxlcnMvcHJvdmlkZXJzL2t1YmVybmV0ZXMvdXRpbHMuZ28=) | `5.42% <0.00%> (ø)` | |

------

[Continue to review full report at Codecov](https://codecov.io/gh/keikoproj/instance-manager/pull/355?src=pr&el=continue&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=keikoproj).
> **Legend** - [Click here to learn more](https://docs.codecov.io/docs/codecov-delta?utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=keikoproj)
> `Δ = absolute <relative> (impact)`, `ø = not affected`, `? = missing data`
> Powered by [Codecov](https://codecov.io/gh/keikoproj/instance-manager/pull/355?src=pr&el=footer&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=keikoproj). Last update [d1cd32a...1a22aa6](https://codecov.io/gh/keikoproj/instance-manager/pull/355?src=pr&el=lastupdated&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=keikoproj). Read the [comment docs](https://docs.codecov.io/docs/pull-request-comments?utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=keikoproj).


Patch:
diff --git a/controllers/providers/kubernetes/utils.go b/controllers/providers/kubernetes/utils.go
index b1c24f9..13bb31d 100644
--- a/controllers/providers/kubernetes/utils.go
+++ b/controllers/providers/kubernetes/utils.go
@@ -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"}
 	_, err := kubeClient.Resource(CRDSchema).Get(context.Background(), name, metav1.GetOptions{})
 	if err != nil {
 		return false


Test patch:
diff --git a/.github/workflows/unit-test.yml b/.github/workflows/unit-test.yml
index 384c955..06b29cd 100644
--- a/.github/workflows/unit-test.yml
+++ b/.github/workflows/unit-test.yml
@@ -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
diff --git a/controllers/provisioners/eks/eks_test.go b/controllers/provisioners/eks/eks_test.go
index b39ebb8..acba0f8 100644
--- a/controllers/provisioners/eks/eks_test.go
+++ b/controllers/provisioners/eks/eks_test.go
@@ -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",