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

[WIP] Add subresource to our types via patch to support K8s 1.22 #11812

Closed
wants to merge 1 commit into from
Closed
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
12 changes: 9 additions & 3 deletions .github/workflows/kind-e2e.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -18,9 +18,10 @@ jobs:
fail-fast: false # Keep running if one leg fails.
matrix:
k8s-version:
- v1.19.11
- v1.20.7
- v1.21.1
#- v1.19.11
#- v1.20.7
#- v1.21.1
Copy link
Member

Choose a reason for hiding this comment

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

Probably don't want to leave this in :) (commenting to make sure we don't forget)

- v1.22.0

test-suite:
- ./test/conformance/runtime
Expand All @@ -47,6 +48,11 @@ jobs:
kind-image-sha: sha256:69860bda5563ac81e3c0057d654b5253219618a22ec3a346306239bba8cfa1a6
kingress: kourier
cluster-suffix: c${{ github.run_id }}.local
- k8s-version: v1.22.0
kind-version: v0.11.1
kind-image-sha: sha256:f97edf7f7ed53c57762b24f90a34fad101386c5bd4d93baeb45449557148c717
kingress: kourier
cluster-suffix: c${{ github.run_id }}.local

# The tests in api/v1alpha1 require the --enable-alpha flag to be set,
# and alpha components to be deployed.
Expand Down
20 changes: 20 additions & 0 deletions hack/patches/100-subresource.patch
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
diff --git a/vendor/k8s.io/apimachinery/pkg/apis/meta/v1/types.go b/vendor/k8s.io/apimachinery/pkg/apis/meta/v1/types.go
index d84878d7c..522336cba 100644
--- a/vendor/k8s.io/apimachinery/pkg/apis/meta/v1/types.go
+++ b/vendor/k8s.io/apimachinery/pkg/apis/meta/v1/types.go
@@ -1158,6 +1158,15 @@ type ManagedFieldsEntry struct {
// FieldsV1 holds the first JSON version format as described in the "FieldsV1" type.
// +optional
FieldsV1 *FieldsV1 `json:"fieldsV1,omitempty" protobuf:"bytes,7,opt,name=fieldsV1"`
+
+ // Subresource is the name of the subresource used to update that object, or
+ // empty string if the object was updated through the main resource. The
+ // value of this field is used to distinguish between managers, even if they
+ // share the same name. For example, a status update will be distinct from a
+ // regular update using the same manager name.
+ // Note that the APIVersion field is not related to the Subresource field and
+ // it always corresponds to the version of the main resource.
+ Subresource string `json:"subresource,omitempty" protobuf:"bytes,8,opt,name=subresource"`
}

// ManagedFieldsOperationType is the type of operation which lead to a ManagedFieldsEntry being created.
3 changes: 3 additions & 0 deletions hack/update-deps.sh
Original file line number Diff line number Diff line change
Expand Up @@ -21,3 +21,6 @@ set -o pipefail
source $(dirname "$0")/../vendor/knative.dev/hack/library.sh

go_update_deps "$@"

# Add the subresource field to older K8s libs so that we continue to work on K8s 1.22.
git apply "$(dirname "$0")/patches/100-subresource.patch"
9 changes: 9 additions & 0 deletions vendor/k8s.io/apimachinery/pkg/apis/meta/v1/types.go

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.