Skip to content

Commit 27771e4

Browse files
Copilotcircy9
andcommitted
Rename DeleteOptions to DeleteStrategy and move inside RolloutStrategy after ApplyStrategy
Co-authored-by: circy9 <[email protected]>
1 parent 804c9a0 commit 27771e4

10 files changed

+83
-51
lines changed

apis/placement/v1beta1/clusterresourceplacement_types.go

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -148,10 +148,6 @@ type PlacementSpec struct {
148148
// +kubebuilder:default=10
149149
// +kubebuilder:validation:Optional
150150
RevisionHistoryLimit *int32 `json:"revisionHistoryLimit,omitempty"`
151-
152-
// DeleteOptions configures the deletion behavior when the ClusterResourcePlacement is deleted.
153-
// +kubebuilder:validation:Optional
154-
DeleteOptions *DeleteOptions `json:"deleteOptions,omitempty"`
155151
}
156152

157153
// Tolerations returns tolerations for PlacementSpec to handle nil policy case.
@@ -492,6 +488,10 @@ type RolloutStrategy struct {
492488
// ApplyStrategy describes when and how to apply the selected resources to the target cluster.
493489
// +kubebuilder:validation:Optional
494490
ApplyStrategy *ApplyStrategy `json:"applyStrategy,omitempty"`
491+
492+
// DeleteStrategy configures the deletion behavior when the ClusterResourcePlacement is deleted.
493+
// +kubebuilder:validation:Optional
494+
DeleteStrategy *DeleteStrategy `json:"deleteStrategy,omitempty"`
495495
}
496496

497497
// ApplyStrategy describes when and how to apply the selected resource to the target cluster.
@@ -1323,8 +1323,8 @@ const (
13231323
PickFixedPlacementType PlacementType = "PickFixed"
13241324
)
13251325

1326-
// DeleteOptions configures the deletion behavior when a placement is deleted.
1327-
type DeleteOptions struct {
1326+
// DeleteStrategy configures the deletion behavior when a placement is deleted.
1327+
type DeleteStrategy struct {
13281328
// PropagationPolicy controls how the deletion is propagated to placed resources.
13291329
// Defaults to "Abandon".
13301330
//

apis/placement/v1beta1/zz_generated.deepcopy.go

Lines changed: 9 additions & 9 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

config/crd/bases/placement.kubernetes-fleet.io_clusterresourcebindings.yaml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -542,8 +542,8 @@ spec:
542542
managed by Fleet (i.e., specified in the hub cluster manifest). This is the default
543543
option.
544544
545-
Note that this option would revert any ad-hoc changes made on the member cluster side in
546-
the managed fields; if you would like to make temporary edits on the member cluster side
545+
Note that this option would revert any ad-hoc changes made on the member cluster side in the
546+
managed fields; if you would like to make temporary edits on the member cluster side
547547
in the managed fields, switch to IfNotDrifted option. Note that changes in unmanaged
548548
fields will be left alone; if you use the FullDiff compare option, such changes will
549549
be reported as drifts.

config/crd/bases/placement.kubernetes-fleet.io_clusterresourceplacements.yaml

Lines changed: 24 additions & 24 deletions
Original file line numberDiff line numberDiff line change
@@ -1144,28 +1144,6 @@ spec:
11441144
spec:
11451145
description: The desired state of ClusterResourcePlacement.
11461146
properties:
1147-
deleteOptions:
1148-
description: DeleteOptions configures the deletion behavior when the
1149-
ClusterResourcePlacement is deleted.
1150-
properties:
1151-
propagationPolicy:
1152-
default: Abandon
1153-
description: |-
1154-
PropagationPolicy controls how the deletion is propagated to placed resources.
1155-
Defaults to "Abandon".
1156-
1157-
Available options:
1158-
1159-
* Abandon: all placed resources on member clusters will be left intact (abandoned)
1160-
when the ClusterResourcePlacement is deleted. This is the default behavior.
1161-
1162-
* Delete: all placed resources on member clusters will be deleted when the
1163-
ClusterResourcePlacement is deleted.
1164-
enum:
1165-
- Abandon
1166-
- Delete
1167-
type: string
1168-
type: object
11691147
policy:
11701148
description: |-
11711149
Policy defines how to select member clusters to place the selected resources.
@@ -1829,8 +1807,8 @@ spec:
18291807
managed by Fleet (i.e., specified in the hub cluster manifest). This is the default
18301808
option.
18311809
1832-
Note that this option would revert any ad-hoc changes made on the member cluster side in
1833-
the managed fields; if you would like to make temporary edits on the member cluster side
1810+
Note that this option would revert any ad-hoc changes made on the member cluster side in the
1811+
managed fields; if you would like to make temporary edits on the member cluster side
18341812
in the managed fields, switch to IfNotDrifted option. Note that changes in unmanaged
18351813
fields will be left alone; if you use the FullDiff compare option, such changes will
18361814
be reported as drifts.
@@ -1927,6 +1905,28 @@ spec:
19271905
- Never
19281906
type: string
19291907
type: object
1908+
deleteStrategy:
1909+
description: DeleteStrategy configures the deletion behavior when
1910+
the ClusterResourcePlacement is deleted.
1911+
properties:
1912+
propagationPolicy:
1913+
default: Abandon
1914+
description: |-
1915+
PropagationPolicy controls how the deletion is propagated to placed resources.
1916+
Defaults to "Abandon".
1917+
1918+
Available options:
1919+
1920+
* Abandon: all placed resources on member clusters will be left intact (abandoned)
1921+
when the ClusterResourcePlacement is deleted. This is the default behavior.
1922+
1923+
* Delete: all placed resources on member clusters will be deleted when the
1924+
ClusterResourcePlacement is deleted.
1925+
enum:
1926+
- Abandon
1927+
- Delete
1928+
type: string
1929+
type: object
19301930
rollingUpdate:
19311931
description: Rolling update config params. Present only if RolloutStrategyType
19321932
= RollingUpdate.

config/crd/bases/placement.kubernetes-fleet.io_clusterresourcesnapshots.yaml

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -40,6 +40,8 @@ spec:
4040
Each snapshot MUST have the following labels:
4141
- `CRPTrackingLabel` which points to its owner CRP.
4242
- `ResourceIndexLabel` which is the index of the snapshot group.
43+
44+
The first snapshot of the index group MAY have the following labels:
4345
- `IsLatestSnapshotLabel` which indicates whether the snapshot is the latest one.
4446
4547
All the snapshots within the same index group must have the same ResourceIndexLabel.
@@ -50,6 +52,9 @@ spec:
5052
5153
Each snapshot (excluding the first snapshot) MUST have the following annotations:
5254
- `SubindexOfResourceSnapshotAnnotation` to store the subindex of resource snapshot in the group.
55+
56+
Snapshot may have the following annotations to indicate the time of next resourceSnapshot candidate detected by the controller:
57+
- `NextResourceSnapshotCandidateDetectionTimeAnnotation` to store the time of next resourceSnapshot candidate detected by the controller.
5358
properties:
5459
apiVersion:
5560
description: |-
@@ -186,6 +191,9 @@ spec:
186191
187192
Each snapshot (excluding the first snapshot) MUST have the following annotations:
188193
- `SubindexOfResourceSnapshotAnnotation` to store the subindex of resource snapshot in the group.
194+
195+
Snapshot may have the following annotations to indicate the time of next resourceSnapshot candidate detected by the controller:
196+
- `NextResourceSnapshotCandidateDetectionTimeAnnotation` to store the time of next resourceSnapshot candidate detected by the controller.
189197
properties:
190198
apiVersion:
191199
description: |-

config/crd/bases/placement.kubernetes-fleet.io_clusterstagedupdateruns.yaml

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -235,8 +235,8 @@ spec:
235235
managed by Fleet (i.e., specified in the hub cluster manifest). This is the default
236236
option.
237237
238-
Note that this option would revert any ad-hoc changes made on the member cluster side in
239-
the managed fields; if you would like to make temporary edits on the member cluster side
238+
Note that this option would revert any ad-hoc changes made on the member cluster side in the
239+
managed fields; if you would like to make temporary edits on the member cluster side
240240
in the managed fields, switch to IfNotDrifted option. Note that changes in unmanaged
241241
fields will be left alone; if you use the FullDiff compare option, such changes will
242242
be reported as drifts.
@@ -1315,8 +1315,8 @@ spec:
13151315
managed by Fleet (i.e., specified in the hub cluster manifest). This is the default
13161316
option.
13171317
1318-
Note that this option would revert any ad-hoc changes made on the member cluster side in
1319-
the managed fields; if you would like to make temporary edits on the member cluster side
1318+
Note that this option would revert any ad-hoc changes made on the member cluster side in the
1319+
managed fields; if you would like to make temporary edits on the member cluster side
13201320
in the managed fields, switch to IfNotDrifted option. Note that changes in unmanaged
13211321
fields will be left alone; if you use the FullDiff compare option, such changes will
13221322
be reported as drifts.

config/crd/bases/placement.kubernetes-fleet.io_resourcebindings.yaml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -190,8 +190,8 @@ spec:
190190
managed by Fleet (i.e., specified in the hub cluster manifest). This is the default
191191
option.
192192
193-
Note that this option would revert any ad-hoc changes made on the member cluster side in
194-
the managed fields; if you would like to make temporary edits on the member cluster side
193+
Note that this option would revert any ad-hoc changes made on the member cluster side in the
194+
managed fields; if you would like to make temporary edits on the member cluster side
195195
in the managed fields, switch to IfNotDrifted option. Note that changes in unmanaged
196196
fields will be left alone; if you use the FullDiff compare option, such changes will
197197
be reported as drifts.

config/crd/bases/placement.kubernetes-fleet.io_resourceplacements.yaml

Lines changed: 24 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -742,8 +742,8 @@ spec:
742742
managed by Fleet (i.e., specified in the hub cluster manifest). This is the default
743743
option.
744744
745-
Note that this option would revert any ad-hoc changes made on the member cluster side in
746-
the managed fields; if you would like to make temporary edits on the member cluster side
745+
Note that this option would revert any ad-hoc changes made on the member cluster side in the
746+
managed fields; if you would like to make temporary edits on the member cluster side
747747
in the managed fields, switch to IfNotDrifted option. Note that changes in unmanaged
748748
fields will be left alone; if you use the FullDiff compare option, such changes will
749749
be reported as drifts.
@@ -840,6 +840,28 @@ spec:
840840
- Never
841841
type: string
842842
type: object
843+
deleteStrategy:
844+
description: DeleteStrategy configures the deletion behavior when
845+
the ClusterResourcePlacement is deleted.
846+
properties:
847+
propagationPolicy:
848+
default: Abandon
849+
description: |-
850+
PropagationPolicy controls how the deletion is propagated to placed resources.
851+
Defaults to "Abandon".
852+
853+
Available options:
854+
855+
* Abandon: all placed resources on member clusters will be left intact (abandoned)
856+
when the ClusterResourcePlacement is deleted. This is the default behavior.
857+
858+
* Delete: all placed resources on member clusters will be deleted when the
859+
ClusterResourcePlacement is deleted.
860+
enum:
861+
- Abandon
862+
- Delete
863+
type: string
864+
type: object
843865
rollingUpdate:
844866
description: Rolling update config params. Present only if RolloutStrategyType
845867
= RollingUpdate.

config/crd/bases/placement.kubernetes-fleet.io_resourcesnapshots.yaml

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -40,6 +40,8 @@ spec:
4040
Each snapshot MUST have the following labels:
4141
- `CRPTrackingLabel` which points to its owner resource placement.
4242
- `ResourceIndexLabel` which is the index of the snapshot group.
43+
44+
The first snapshot of the index group MAY have the following labels:
4345
- `IsLatestSnapshotLabel` which indicates whether the snapshot is the latest one.
4446
4547
All the snapshots within the same index group must have the same ResourceIndexLabel.

config/crd/bases/placement.kubernetes-fleet.io_works.yaml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -433,8 +433,8 @@ spec:
433433
managed by Fleet (i.e., specified in the hub cluster manifest). This is the default
434434
option.
435435
436-
Note that this option would revert any ad-hoc changes made on the member cluster side in
437-
the managed fields; if you would like to make temporary edits on the member cluster side
436+
Note that this option would revert any ad-hoc changes made on the member cluster side in the
437+
managed fields; if you would like to make temporary edits on the member cluster side
438438
in the managed fields, switch to IfNotDrifted option. Note that changes in unmanaged
439439
fields will be left alone; if you use the FullDiff compare option, such changes will
440440
be reported as drifts.

0 commit comments

Comments
 (0)