Skip to content

Commit 99c10be

Browse files
committed
Implement ignoreFields in server side apply
Signed-off-by: Jian Qiu <[email protected]>
1 parent a967216 commit 99c10be

24 files changed

+881
-49
lines changed

deploy/cluster-manager/olm-catalog/latest/manifests/cluster-manager.clusterserviceversion.yaml

+1-1
Original file line numberDiff line numberDiff line change
@@ -59,7 +59,7 @@ metadata:
5959
categories: Integration & Delivery,OpenShift Optional
6060
certified: "false"
6161
containerImage: quay.io/open-cluster-management/registration-operator:latest
62-
createdAt: "2024-11-20T09:03:54Z"
62+
createdAt: "2024-12-02T08:08:47Z"
6363
description: Manages the installation and upgrade of the ClusterManager.
6464
operators.operatorframework.io/builder: operator-sdk-v1.32.0
6565
operators.operatorframework.io/project_layout: go.kubebuilder.io/v3

deploy/klusterlet/chart/klusterlet/crds/0000_00_operator.open-cluster-management.io_klusterlets.crd.yaml

+2
Original file line numberDiff line numberDiff line change
@@ -312,13 +312,15 @@ spec:
312312
The arn of the hub cluster (ie: an EKS cluster). This will be required to pass information to hub, which hub will use to create IAM identities for this klusterlet.
313313
Example - arn:eks:us-west-2:12345678910:cluster/hub-cluster1.
314314
minLength: 1
315+
pattern: ^arn:aws:eks:([a-zA-Z0-9-]+):(\d{12}):cluster/([a-zA-Z0-9-]+)$
315316
type: string
316317
managedClusterArn:
317318
description: |-
318319
The arn of the managed cluster (ie: an EKS cluster). This will be required to generate the md5hash which will be used as a suffix to create IAM role on hub
319320
as well as used by kluslerlet-agent, to assume role suffixed with the md5hash, on startup.
320321
Example - arn:eks:us-west-2:12345678910:cluster/managed-cluster1.
321322
minLength: 1
323+
pattern: ^arn:aws:eks:([a-zA-Z0-9-]+):(\d{12}):cluster/([a-zA-Z0-9-]+)$
322324
type: string
323325
type: object
324326
type: object

deploy/klusterlet/config/crds/0000_00_operator.open-cluster-management.io_klusterlets.crd.yaml

+2
Original file line numberDiff line numberDiff line change
@@ -312,13 +312,15 @@ spec:
312312
The arn of the hub cluster (ie: an EKS cluster). This will be required to pass information to hub, which hub will use to create IAM identities for this klusterlet.
313313
Example - arn:eks:us-west-2:12345678910:cluster/hub-cluster1.
314314
minLength: 1
315+
pattern: ^arn:aws:eks:([a-zA-Z0-9-]+):(\d{12}):cluster/([a-zA-Z0-9-]+)$
315316
type: string
316317
managedClusterArn:
317318
description: |-
318319
The arn of the managed cluster (ie: an EKS cluster). This will be required to generate the md5hash which will be used as a suffix to create IAM role on hub
319320
as well as used by kluslerlet-agent, to assume role suffixed with the md5hash, on startup.
320321
Example - arn:eks:us-west-2:12345678910:cluster/managed-cluster1.
321322
minLength: 1
323+
pattern: ^arn:aws:eks:([a-zA-Z0-9-]+):(\d{12}):cluster/([a-zA-Z0-9-]+)$
322324
type: string
323325
type: object
324326
type: object

deploy/klusterlet/olm-catalog/latest/manifests/klusterlet.clusterserviceversion.yaml

+1-1
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,7 @@ metadata:
3131
categories: Integration & Delivery,OpenShift Optional
3232
certified: "false"
3333
containerImage: quay.io/open-cluster-management/registration-operator:latest
34-
createdAt: "2024-11-20T09:03:55Z"
34+
createdAt: "2024-12-02T08:08:47Z"
3535
description: Manages the installation and upgrade of the Klusterlet.
3636
operators.operatorframework.io/builder: operator-sdk-v1.32.0
3737
operators.operatorframework.io/project_layout: go.kubebuilder.io/v3

deploy/klusterlet/olm-catalog/latest/manifests/operator.open-cluster-management.io_klusterlets.yaml

+2
Original file line numberDiff line numberDiff line change
@@ -312,13 +312,15 @@ spec:
312312
The arn of the hub cluster (ie: an EKS cluster). This will be required to pass information to hub, which hub will use to create IAM identities for this klusterlet.
313313
Example - arn:eks:us-west-2:12345678910:cluster/hub-cluster1.
314314
minLength: 1
315+
pattern: ^arn:aws:eks:([a-zA-Z0-9-]+):(\d{12}):cluster/([a-zA-Z0-9-]+)$
315316
type: string
316317
managedClusterArn:
317318
description: |-
318319
The arn of the managed cluster (ie: an EKS cluster). This will be required to generate the md5hash which will be used as a suffix to create IAM role on hub
319320
as well as used by kluslerlet-agent, to assume role suffixed with the md5hash, on startup.
320321
Example - arn:eks:us-west-2:12345678910:cluster/managed-cluster1.
321322
minLength: 1
323+
pattern: ^arn:aws:eks:([a-zA-Z0-9-]+):(\d{12}):cluster/([a-zA-Z0-9-]+)$
322324
type: string
323325
type: object
324326
type: object

go.mod

+1-1
Original file line numberDiff line numberDiff line change
@@ -32,7 +32,7 @@ require (
3232
k8s.io/kube-aggregator v0.31.3
3333
k8s.io/utils v0.0.0-20240921022957-49e7df575cb6
3434
open-cluster-management.io/addon-framework v0.11.1-0.20241129080247-57b1d2859f50
35-
open-cluster-management.io/api v0.15.1-0.20241120090202-cb7ce98ab874
35+
open-cluster-management.io/api v0.15.1-0.20241126073717-05ff7c1affe8
3636
open-cluster-management.io/sdk-go v0.15.1-0.20241125015855-1536c3970f8f
3737
sigs.k8s.io/cluster-inventory-api v0.0.0-20240730014211-ef0154379848
3838
sigs.k8s.io/controller-runtime v0.19.3

go.sum

+2-2
Original file line numberDiff line numberDiff line change
@@ -453,8 +453,8 @@ k8s.io/utils v0.0.0-20240921022957-49e7df575cb6 h1:MDF6h2H/h4tbzmtIKTuctcwZmY0tY
453453
k8s.io/utils v0.0.0-20240921022957-49e7df575cb6/go.mod h1:OLgZIPagt7ERELqWJFomSt595RzquPNLL48iOWgYOg0=
454454
open-cluster-management.io/addon-framework v0.11.1-0.20241129080247-57b1d2859f50 h1:TXRd6OdGjArh6cwlCYOqlIcyx21k81oUIYj4rmHlYx0=
455455
open-cluster-management.io/addon-framework v0.11.1-0.20241129080247-57b1d2859f50/go.mod h1:tsBSNs9mGfVQQjXBnjgpiX6r0UM+G3iNfmzQgKhEfw4=
456-
open-cluster-management.io/api v0.15.1-0.20241120090202-cb7ce98ab874 h1:WgkuYXTbJV7EK+qtiMq3soa21faGUKeTG5w0C8Mn1Ok=
457-
open-cluster-management.io/api v0.15.1-0.20241120090202-cb7ce98ab874/go.mod h1:9erZEWEn4bEqh0nIX2wA7f/s3KCuFycQdBrPrRzi0QM=
456+
open-cluster-management.io/api v0.15.1-0.20241126073717-05ff7c1affe8 h1:yKI2N8VN3zij+2O8kEOGfXBtZDs3pMey0BFfikgBpJM=
457+
open-cluster-management.io/api v0.15.1-0.20241126073717-05ff7c1affe8/go.mod h1:9erZEWEn4bEqh0nIX2wA7f/s3KCuFycQdBrPrRzi0QM=
458458
open-cluster-management.io/sdk-go v0.15.1-0.20241125015855-1536c3970f8f h1:zeC7QrFNarfK2zY6jGtd+mX+yDrQQmnH/J8A7n5Nh38=
459459
open-cluster-management.io/sdk-go v0.15.1-0.20241125015855-1536c3970f8f/go.mod h1:fi5WBsbC5K3txKb8eRLuP0Sim/Oqz/PHX18skAEyjiA=
460460
sigs.k8s.io/apiserver-network-proxy/konnectivity-client v0.30.3 h1:2770sDpzrjjsAtVhSeUFseziht227YAWYHLGNM8QPwY=

manifests/cluster-manager/hub/0000_00_work.open-cluster-management.io_manifestworkreplicasets.crd.yaml

+33-2
Original file line numberDiff line numberDiff line change
@@ -262,8 +262,8 @@ spec:
262262
properties:
263263
serverSideApply:
264264
description: |-
265-
serverSideApply defines the configuration for server side apply. It is honored only when
266-
type of updateStrategy is ServerSideApply
265+
serverSideApply defines the configuration for server side apply. It is honored only when the
266+
type of the updateStrategy is ServerSideApply
267267
properties:
268268
fieldManager:
269269
default: work-agent
@@ -276,6 +276,37 @@ spec:
276276
description: Force represents to force apply the
277277
manifest.
278278
type: boolean
279+
ignoreFields:
280+
description: IgnoreFields defines a list of json
281+
paths in the resource that will not be updated
282+
on the spoke.
283+
items:
284+
properties:
285+
condition:
286+
default: OnSpokePresent
287+
description: |-
288+
Condition defines the condition that the fields should be ignored when apply the resource.
289+
Fields in JSONPaths are all ignored when condition is met, otherwise no fields is ignored
290+
in the apply operation.
291+
enum:
292+
- OnSpokePresent
293+
- OnSpokeChange
294+
type: string
295+
jsonPaths:
296+
description: JSONPaths defines the list of
297+
json path in the resource to be ignored
298+
items:
299+
type: string
300+
minItems: 1
301+
type: array
302+
required:
303+
- condition
304+
- jsonPaths
305+
type: object
306+
type: array
307+
x-kubernetes-list-map-keys:
308+
- condition
309+
x-kubernetes-list-type: map
279310
type: object
280311
type:
281312
default: Update

manifests/cluster-manager/hub/0000_00_work.open-cluster-management.io_manifestworks.crd.yaml

+32-2
Original file line numberDiff line numberDiff line change
@@ -239,8 +239,8 @@ spec:
239239
properties:
240240
serverSideApply:
241241
description: |-
242-
serverSideApply defines the configuration for server side apply. It is honored only when
243-
type of updateStrategy is ServerSideApply
242+
serverSideApply defines the configuration for server side apply. It is honored only when the
243+
type of the updateStrategy is ServerSideApply
244244
properties:
245245
fieldManager:
246246
default: work-agent
@@ -252,6 +252,36 @@ spec:
252252
force:
253253
description: Force represents to force apply the manifest.
254254
type: boolean
255+
ignoreFields:
256+
description: IgnoreFields defines a list of json paths
257+
in the resource that will not be updated on the spoke.
258+
items:
259+
properties:
260+
condition:
261+
default: OnSpokePresent
262+
description: |-
263+
Condition defines the condition that the fields should be ignored when apply the resource.
264+
Fields in JSONPaths are all ignored when condition is met, otherwise no fields is ignored
265+
in the apply operation.
266+
enum:
267+
- OnSpokePresent
268+
- OnSpokeChange
269+
type: string
270+
jsonPaths:
271+
description: JSONPaths defines the list of json
272+
path in the resource to be ignored
273+
items:
274+
type: string
275+
minItems: 1
276+
type: array
277+
required:
278+
- condition
279+
- jsonPaths
280+
type: object
281+
type: array
282+
x-kubernetes-list-map-keys:
283+
- condition
284+
x-kubernetes-list-type: map
255285
type: object
256286
type:
257287
default: Update

manifests/cluster-manager/hub/0000_03_addon.open-cluster-management.io_addontemplates.crd.yaml

+33-2
Original file line numberDiff line numberDiff line change
@@ -255,8 +255,8 @@ spec:
255255
properties:
256256
serverSideApply:
257257
description: |-
258-
serverSideApply defines the configuration for server side apply. It is honored only when
259-
type of updateStrategy is ServerSideApply
258+
serverSideApply defines the configuration for server side apply. It is honored only when the
259+
type of the updateStrategy is ServerSideApply
260260
properties:
261261
fieldManager:
262262
default: work-agent
@@ -269,6 +269,37 @@ spec:
269269
description: Force represents to force apply the
270270
manifest.
271271
type: boolean
272+
ignoreFields:
273+
description: IgnoreFields defines a list of json
274+
paths in the resource that will not be updated
275+
on the spoke.
276+
items:
277+
properties:
278+
condition:
279+
default: OnSpokePresent
280+
description: |-
281+
Condition defines the condition that the fields should be ignored when apply the resource.
282+
Fields in JSONPaths are all ignored when condition is met, otherwise no fields is ignored
283+
in the apply operation.
284+
enum:
285+
- OnSpokePresent
286+
- OnSpokeChange
287+
type: string
288+
jsonPaths:
289+
description: JSONPaths defines the list of
290+
json path in the resource to be ignored
291+
items:
292+
type: string
293+
minItems: 1
294+
type: array
295+
required:
296+
- condition
297+
- jsonPaths
298+
type: object
299+
type: array
300+
x-kubernetes-list-map-keys:
301+
- condition
302+
x-kubernetes-list-type: map
272303
type: object
273304
type:
274305
default: Update

0 commit comments

Comments
 (0)