Skip to content
Merged
2 changes: 2 additions & 0 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -147,6 +147,8 @@ test: manifests generate fmt vet local-unit-test integration-test ## Run tests.
## workaround to bypass the pkg/controllers/workv1alpha1 tests failure
## rollout controller tests need a bit longer to complete, so we increase the timeout
##
# Set up the timeout parameters as some of the test lengths have exceeded the default 10 minute mark.
# TO-DO (chenyu1): enable parallelization for single package integration tests.
.PHONY: local-unit-test
local-unit-test: $(ENVTEST) ## Run tests.
export CGO_ENABLED=1 && \
Expand Down
24 changes: 24 additions & 0 deletions apis/cluster/v1beta1/membercluster_types.go
Original file line number Diff line number Diff line change
Expand Up @@ -74,6 +74,30 @@ type MemberClusterSpec struct {
// +kubebuilder:validation:MaxItems=100
// +optional
Taints []Taint `json:"taints,omitempty"`

// DeleteOptions for deleting the MemberCluster.
// +optional
DeleteOptions *DeleteOptions `json:"deleteOptions,omitempty"`
}

// DeleteValidationMode identifies the type of validation when deleting a MemberCluster.
// +enum
type DeleteValidationMode string

const (
// DeleteValidationModeSkip skips the validation when deleting a MemberCluster.
DeleteValidationModeSkip = "Skip"

// DeleteValidationModeStrict performs strict validation when deleting a MemberCluster.
DeleteValidationModeStrict = "Strict"
)

type DeleteOptions struct {
// Mode of validation. Can be "Skip", or "Strict". Default is Strict.
// +kubebuilder:validation:Enum=Skip;Strict
// +kubebuilder:default=Strict
// +kubebuilder:validation:Optional
ValidationMode DeleteValidationMode `json:"validationMode,omitempty"`
}

// PropertyName is the name of a cluster property; it should be a Kubernetes label name.
Expand Down
20 changes: 20 additions & 0 deletions apis/cluster/v1beta1/zz_generated.deepcopy.go

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

11 changes: 11 additions & 0 deletions apis/placement/v1beta1/clusterresourceplacement_types.go
Original file line number Diff line number Diff line change
Expand Up @@ -1287,6 +1287,17 @@ const (
// clusters, or an error has occurred.
// * Unknown: Fleet has not finished processing the diff reporting yet.
ClusterResourcePlacementDiffReportedConditionType ClusterResourcePlacementConditionType = "ClusterResourcePlacementDiffReported"

// ClusterResourcePlacementStatusSyncedConditionType indicates whether Fleet has successfully
// created or updated the ClusterResourcePlacementStatus object in the target namespace when
// StatusReportingScope is NamespaceAccessible.
//
// It can have the following condition statuses:
// * True: Fleet has successfully created or updated the ClusterResourcePlacementStatus object
// in the target namespace.
// * False: Fleet has failed to create or update the ClusterResourcePlacementStatus object
// in the target namespace.
ClusterResourcePlacementStatusSyncedConditionType ClusterResourcePlacementConditionType = "ClusterResourcePlacementStatusSynced"
)

// ResourcePlacementConditionType defines a specific condition of a resource placement object.
Expand Down
12 changes: 12 additions & 0 deletions config/crd/bases/cluster.kubernetes-fleet.io_memberclusters.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -432,6 +432,18 @@ spec:
spec:
description: The desired state of MemberCluster.
properties:
deleteOptions:
description: DeleteOptions for deleting the MemberCluster.
properties:
validationMode:
default: Strict
description: Mode of validation. Can be "Skip", or "Strict". Default
is Strict.
enum:
- Skip
- Strict
type: string
type: object
heartbeatPeriodSeconds:
default: 60
description: 'How often (in seconds) for the member cluster to send
Expand Down
Loading
Loading