Skip to content

Commit 18c9bfa

Browse files
vdemeestertekton-robot
authored andcommitted
update-deps.sh: apply patches on updating deps
This applies any patches that would be in `hack/patches` but not committing them as it would be repeating the same commit over and over. Signed-off-by: Vincent Demeester <[email protected]>
1 parent 2945543 commit 18c9bfa

File tree

2 files changed

+47
-1
lines changed

2 files changed

+47
-1
lines changed
Lines changed: 38 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,38 @@
1+
From 041c3e5eb0cd8bd2f96946692acdf86822737d54 Mon Sep 17 00:00:00 2001
2+
From: Vincent Demeester <[email protected]>
3+
Date: Tue, 17 Aug 2021 09:44:24 +0200
4+
Subject: [PATCH] Patch vendor/ apimachinery to work on 1.22
5+
6+
A new field is there in k8s 1.22, name subresource in the
7+
managedfields. This proves to make knative based types to not be valid
8+
on 1.22 and above, making tektoncd/pipeline as well as any other
9+
component using knative/pkg to be broken on 1.22 and above.
10+
11+
Signed-off-by: Vincent Demeester <[email protected]>
12+
---
13+
vendor/k8s.io/apimachinery/pkg/apis/meta/v1/types.go | 9 +++++++++
14+
1 file changed, 9 insertions(+)
15+
16+
diff --git a/vendor/k8s.io/apimachinery/pkg/apis/meta/v1/types.go b/vendor/k8s.io/apimachinery/pkg/apis/meta/v1/types.go
17+
index d84878d7..522336cb 100644
18+
--- a/vendor/k8s.io/apimachinery/pkg/apis/meta/v1/types.go
19+
+++ b/vendor/k8s.io/apimachinery/pkg/apis/meta/v1/types.go
20+
@@ -1158,6 +1158,15 @@ type ManagedFieldsEntry struct {
21+
// FieldsV1 holds the first JSON version format as described in the "FieldsV1" type.
22+
// +optional
23+
FieldsV1 *FieldsV1 `json:"fieldsV1,omitempty" protobuf:"bytes,7,opt,name=fieldsV1"`
24+
+
25+
+ // Subresource is the name of the subresource used to update that object, or
26+
+ // empty string if the object was updated through the main resource. The
27+
+ // value of this field is used to distinguish between managers, even if they
28+
+ // share the same name. For example, a status update will be distinct from a
29+
+ // regular update using the same manager name.
30+
+ // Note that the APIVersion field is not related to the Subresource field and
31+
+ // it always corresponds to the version of the main resource.
32+
+ Subresource string `json:"subresource,omitempty" protobuf:"bytes,8,opt,name=subresource"`
33+
}
34+
35+
// ManagedFieldsOperationType is the type of operation which lead to a ManagedFieldsEntry being created.
36+
--
37+
2.32.0
38+

hack/update-deps.sh

Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -46,9 +46,17 @@ if (( GO_GET )); then
4646
go get -d ${FLOATING_DEPS[@]}
4747
fi
4848

49-
5049
# Prune modules.
5150
go mod tidy
5251
go mod vendor
5352

53+
# Applying patches
54+
if [[ -d hack/patches ]];then
55+
for f in hack/patches/*.patch;do
56+
[[ -f ${f} ]] || continue
57+
# Apply patches but do not commit
58+
git apply ${f}
59+
done
60+
fi
61+
5462
update_licenses third_party/

0 commit comments

Comments
 (0)