Skip to content

Commit 9c0652c

Browse files
author
Ryan Zhang
committed
backport from kubefleet
2 parents 1ca5d9a + fafe73e commit 9c0652c

33 files changed

+5288
-1340
lines changed

Makefile

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -147,6 +147,8 @@ test: manifests generate fmt vet local-unit-test integration-test ## Run tests.
147147
## workaround to bypass the pkg/controllers/workv1alpha1 tests failure
148148
## rollout controller tests need a bit longer to complete, so we increase the timeout
149149
##
150+
# Set up the timeout parameters as some of the test lengths have exceeded the default 10 minute mark.
151+
# TO-DO (chenyu1): enable parallelization for single package integration tests.
150152
.PHONY: local-unit-test
151153
local-unit-test: $(ENVTEST) ## Run tests.
152154
export CGO_ENABLED=1 && \

apis/cluster/v1beta1/membercluster_types.go

Lines changed: 24 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -74,6 +74,30 @@ type MemberClusterSpec struct {
7474
// +kubebuilder:validation:MaxItems=100
7575
// +optional
7676
Taints []Taint `json:"taints,omitempty"`
77+
78+
// DeleteOptions for deleting the MemberCluster.
79+
// +optional
80+
DeleteOptions *DeleteOptions `json:"deleteOptions,omitempty"`
81+
}
82+
83+
// DeleteValidationMode identifies the type of validation when deleting a MemberCluster.
84+
// +enum
85+
type DeleteValidationMode string
86+
87+
const (
88+
// DeleteValidationModeSkip skips the validation when deleting a MemberCluster.
89+
DeleteValidationModeSkip = "Skip"
90+
91+
// DeleteValidationModeStrict performs strict validation when deleting a MemberCluster.
92+
DeleteValidationModeStrict = "Strict"
93+
)
94+
95+
type DeleteOptions struct {
96+
// Mode of validation. Can be "Skip", or "Strict". Default is Strict.
97+
// +kubebuilder:validation:Enum=Skip;Strict
98+
// +kubebuilder:default=Strict
99+
// +kubebuilder:validation:Optional
100+
ValidationMode DeleteValidationMode `json:"validationMode,omitempty"`
77101
}
78102

79103
// PropertyName is the name of a cluster property; it should be a Kubernetes label name.

apis/cluster/v1beta1/zz_generated.deepcopy.go

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

apis/placement/v1beta1/clusterresourceplacement_types.go

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1287,6 +1287,17 @@ const (
12871287
// clusters, or an error has occurred.
12881288
// * Unknown: Fleet has not finished processing the diff reporting yet.
12891289
ClusterResourcePlacementDiffReportedConditionType ClusterResourcePlacementConditionType = "ClusterResourcePlacementDiffReported"
1290+
1291+
// ClusterResourcePlacementStatusSyncedConditionType indicates whether Fleet has successfully
1292+
// created or updated the ClusterResourcePlacementStatus object in the target namespace when
1293+
// StatusReportingScope is NamespaceAccessible.
1294+
//
1295+
// It can have the following condition statuses:
1296+
// * True: Fleet has successfully created or updated the ClusterResourcePlacementStatus object
1297+
// in the target namespace.
1298+
// * False: Fleet has failed to create or update the ClusterResourcePlacementStatus object
1299+
// in the target namespace.
1300+
ClusterResourcePlacementStatusSyncedConditionType ClusterResourcePlacementConditionType = "ClusterResourcePlacementStatusSynced"
12901301
)
12911302

12921303
// ResourcePlacementConditionType defines a specific condition of a resource placement object.

config/crd/bases/cluster.kubernetes-fleet.io_memberclusters.yaml

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -432,6 +432,18 @@ spec:
432432
spec:
433433
description: The desired state of MemberCluster.
434434
properties:
435+
deleteOptions:
436+
description: DeleteOptions for deleting the MemberCluster.
437+
properties:
438+
validationMode:
439+
default: Strict
440+
description: Mode of validation. Can be "Skip", or "Strict". Default
441+
is Strict.
442+
enum:
443+
- Skip
444+
- Strict
445+
type: string
446+
type: object
435447
heartbeatPeriodSeconds:
436448
default: 60
437449
description: 'How often (in seconds) for the member cluster to send

0 commit comments

Comments
 (0)