Repository: knative/client
Pull request #1248 (2021-03-03 16:01:31)

chore: Update CRDs API version to v1
## Description

The CRDs `v1beta1` version is deprecated since K8s 1.16 and will be removed in `1.22`. However, it may produce a warning on newer Kubernetes clusters already.

We should probably handle the warning as well and don't fail prematurely. 

## Changes

<!-- Please add list of more detailed changes. These changes should be reflected also in the commit messages -->

* Update CRDs API version to `v1`

## Reference


Fixes N/A

<!--
Please add an entry to CHANGELOG.adoc file, too, as part of your Pull Request.

In the following cases, add a short description of PR to the unreleased section in CHANGELOG.adoc:

- 🎁 New feature
- 🐛 Bug fix
- ✨ Feature Update
- 🐣 Refactoring
- 🗑️ Remove feature or internal logic

See other entries in CHANGELOG.adoc as an example for how to add the entry, including a reference to the corresponding issue/PR

PLEASE DON'T ADD THAT LINE HERE IN THE PULL-REQUEST DESCRIPTION BUT DIRECTLY IN CHANGELOG.ADOC AND ADD CHANGELOG.ADOC AS PART OF YOUR PULL-REQUEST.
-->

<!--
To automatically lint go code in this pull request uncomment the line below. You get feedback as comments on your pull request then -->

<!--
/lint
-->


knative-prow-robot: [APPROVALNOTIFIER] This PR is **NOT APPROVED**

This pull-request has been approved by:
To complete the [pull request process](https://git.k8s.io/community/contributors/guide/owners.md#the-code-review-process), please assign **maximilien** after the PR has been reviewed.
You can assign the PR to them by writing `/assign @maximilien` in a comment when ready.

The full list of commands accepted by this bot can be found [here](https://go.k8s.io/bot-commands?repo=knative%2Fclient).

<details open>
Needs approval from an approver in each of these files:

- **[OWNERS](https://github.com/knative/client/blob/master/OWNERS)**

Approvers can indicate their approval by writing `/approve` in a comment
Approvers can cancel approval by writing `/approve cancel` in a comment
</details>
<!-- META={"approvers":["maximilien"]} -->
knative-prow-robot: [APPROVALNOTIFIER] This PR is **APPROVED**

This pull-request has been approved by: *<a href="https://github.com/knative/client/pull/1248#pullrequestreview-603100573" title="LGTM">maximilien</a>*

The full list of commands accepted by this bot can be found [here](https://go.k8s.io/bot-commands?repo=knative%2Fclient).

The pull request process is described [here](https://git.k8s.io/community/contributors/guide/owners.md#the-code-review-process)

<details >
Needs approval from an approver in each of these files:

- ~~[OWNERS](https://github.com/knative/client/blob/master/OWNERS)~~ [maximilien]

Approvers can indicate their approval by writing `/approve` in a comment
Approvers can cancel approval by writing `/approve cancel` in a comment
</details>
<!-- META={"approvers":[]} -->
knative-prow-robot: @dsimansk: The following test **failed**, say `/retest` to rerun all failed tests:

Test name | Commit | Details | Rerun command
--- | --- | --- | ---
pull-knative-client-integration-tests-latest-release | e1435dc5e17a8e241616266dfe57c29620292c86 | [link](https://prow.knative.dev/view/gs/knative-prow/pr-logs/pull/knative_client/1248/pull-knative-client-integration-tests-latest-release/1367152365127340032) | `/test pull-knative-client-integration-tests-latest-release`

[Full PR test history](https://gubernator.knative.dev/pr/knative_client/1248). [Your PR dashboard](https://gubernator.knative.dev/pr/dsimansk).

<details>

Instructions for interacting with me using PR comments are available [here](https://git.k8s.io/community/contributors/guide/pull-requests.md).  If you have questions or suggestions related to my behavior, please file an issue against the [kubernetes/test-infra](https://github.com/kubernetes/test-infra/issues/new?title=Prow%20issue:) repository. I understand the commands that are listed [here](https://go.k8s.io/bot-commands).
</details>
<!-- test report -->
knative-prow-robot: @dsimansk: The following tests **failed**, say `/retest` to rerun all failed tests:

Test name | Commit | Details | Rerun command
--- | --- | --- | ---
pull-knative-client-integration-tests-latest-release | e1435dc5e17a8e241616266dfe57c29620292c86 | [link](https://prow.knative.dev/view/gs/knative-prow/pr-logs/pull/knative_client/1248/pull-knative-client-integration-tests-latest-release/1367152365127340032) | `/test pull-knative-client-integration-tests-latest-release`
pull-knative-client-integration-tests | e1435dc5e17a8e241616266dfe57c29620292c86 | [link](https://prow.knative.dev/view/gs/knative-prow/pr-logs/pull/knative_client/1248/pull-knative-client-integration-tests/1367152365093785600) | `/test pull-knative-client-integration-tests`

[Full PR test history](https://gubernator.knative.dev/pr/knative_client/1248). [Your PR dashboard](https://gubernator.knative.dev/pr/dsimansk).

<details>

Instructions for interacting with me using PR comments are available [here](https://git.k8s.io/community/contributors/guide/pull-requests.md).  If you have questions or suggestions related to my behavior, please file an issue against the [kubernetes/test-infra](https://github.com/kubernetes/test-infra/issues/new?title=Prow%20issue:) repository. I understand the commands that are listed [here](https://go.k8s.io/bot-commands).
</details>
<!-- test report -->
knative-prow-robot: New changes are detected. LGTM label has been removed.
knative-prow-robot: [APPROVALNOTIFIER] This PR is **APPROVED**

This pull-request has been approved by: *<a href="https://github.com/knative/client/pull/1248#pullrequestreview-603100573" title="LGTM">maximilien</a>*, *<a href="https://github.com/knative/client/pull/1248#pullrequestreview-603935366" title="Approved">rhuss</a>*

The full list of commands accepted by this bot can be found [here](https://go.k8s.io/bot-commands?repo=knative%2Fclient).

The pull request process is described [here](https://git.k8s.io/community/contributors/guide/owners.md#the-code-review-process)

<details >
Needs approval from an approver in each of these files:

- ~~[OWNERS](https://github.com/knative/client/blob/master/OWNERS)~~ [maximilien,rhuss]

Approvers can indicate their approval by writing `/approve` in a comment
Approvers can cancel approval by writing `/approve cancel` in a comment
</details>
<!-- META={"approvers":[]} -->

Patch:
diff --git a/CHANGELOG.adoc b/CHANGELOG.adoc
index 5e36c203..b36b5295 100644
--- a/CHANGELOG.adoc
+++ b/CHANGELOG.adoc
@@ -12,6 +12,17 @@
 | https://github.com/knative/client/pull/[#]
 ////
 
+## (Unreleased)
+[cols="1,10,3", options="header", width="100%"]
+|===
+| | Description | PR
+
+| ✨
+| Update CRDs API version to `v1`
+| https://github.com/knative/client/issues/1248[#1248]
+
+|===
+
 ## v0.21.0 (2021-02-23)
 [cols="1,10,3", options="header", width="100%"]
 |===
diff --git a/pkg/dynamic/client.go b/pkg/dynamic/client.go
index d7b6789e..c5bb80c3 100644
--- a/pkg/dynamic/client.go
+++ b/pkg/dynamic/client.go
@@ -31,7 +31,7 @@ import (
 
 const (
 	crdGroup           = "apiextensions.k8s.io"
-	crdVersion         = "v1beta1"
+	crdVersion         = "v1"
 	crdKind            = "CustomResourceDefinition"
 	crdKinds           = "customresourcedefinitions"
 	sourcesLabelKey    = "duck.knative.dev/source"


Test patch:
diff --git a/pkg/kn/commands/channel/list_types_test.go b/pkg/kn/commands/channel/list_types_test.go
index 7726855f..32e5b462 100644
--- a/pkg/kn/commands/channel/list_types_test.go
+++ b/pkg/kn/commands/channel/list_types_test.go
@@ -36,7 +36,7 @@ import (
 
 const (
 	crdGroup           = "apiextensions.k8s.io"
-	crdVersion         = "v1beta1"
+	crdVersion         = "v1"
 	crdKind            = "CustomResourceDefinition"
 	testNamespace      = "current"
 	channelLabelValue  = "true"
diff --git a/pkg/kn/commands/source/list_test.go b/pkg/kn/commands/source/list_test.go
index daec2260..3cf09dde 100644
--- a/pkg/kn/commands/source/list_test.go
+++ b/pkg/kn/commands/source/list_test.go
@@ -31,7 +31,7 @@ import (
 
 const (
 	crdGroup          = "apiextensions.k8s.io"
-	crdVersion        = "v1beta1"
+	crdVersion        = "v1"
 	crdKind           = "CustomResourceDefinition"
 	sourcesLabelKey   = "duck.knative.dev/source"
 	sourcesLabelValue = "true"
diff --git a/test/e2e/source_list_test.go b/test/e2e/source_list_test.go
index 32224493..af8c00d2 100644
--- a/test/e2e/source_list_test.go
+++ b/test/e2e/source_list_test.go
@@ -44,7 +44,7 @@ func TestSourceListTypes(t *testing.T) {
 	t.Log("List available source types in YAML format")
 
 	output = sourceListTypes(r, "-oyaml")
-	assert.Check(t, util.ContainsAll(output, "apiextensions.k8s.io/v1beta1", "CustomResourceDefinition", "Ping", "ApiServer"))
+	assert.Check(t, util.ContainsAll(output, "apiextensions.k8s.io/v1", "CustomResourceDefinition", "Ping", "ApiServer"))
 }
 
 func TestSourceList(t *testing.T) {