From 6cd14a872f72d46a9f359444381379f8edacc63f Mon Sep 17 00:00:00 2001 From: Kevin Wang Date: Sat, 27 Feb 2021 10:31:19 +0800 Subject: [PATCH] Add clusterPropagationPolicy API Signed-off-by: Kevin Wang --- pkg/apis/policy/v1alpha1/propagation_types.go | 27 +++++++++++++++++++ 1 file changed, 27 insertions(+) diff --git a/pkg/apis/policy/v1alpha1/propagation_types.go b/pkg/apis/policy/v1alpha1/propagation_types.go index cdea2b19e..656935e77 100644 --- a/pkg/apis/policy/v1alpha1/propagation_types.go +++ b/pkg/apis/policy/v1alpha1/propagation_types.go @@ -160,3 +160,30 @@ type PropagationPolicyList struct { metav1.ListMeta `json:"metadata,omitempty"` Items []PropagationPolicy `json:"items"` } + +// +genclient +// +genclient:nonNamespaced +// +kubebuilder:resource:scope="Cluster" +// +k8s:deepcopy-gen:interfaces=k8s.io/apimachinery/pkg/runtime.Object + +// ClusterPropagationPolicy represents the cluster-wide policy that propagates a group of resources to one or more clusters. +// Different with PropagationPolicy that could only propagate resources in its own namespace, ClusterPropagationPolicy +// is able to propagate cluster level resources and resources in any namespace other than system reserved ones. +// System reserved namespaces are: karmada-system, karmada-cluster, karmada-es-*. +type ClusterPropagationPolicy struct { + metav1.TypeMeta `json:",inline"` + metav1.ObjectMeta `json:"metadata,omitempty"` + + // Spec represents the desired behavior of ClusterPropagationPolicy. + Spec PropagationSpec `json:"spec"` +} + +// +kubebuilder:resource:scope="Cluster" +// +k8s:deepcopy-gen:interfaces=k8s.io/apimachinery/pkg/runtime.Object + +// ClusterPropagationPolicyList contains a list of ClusterPropagationPolicy. +type ClusterPropagationPolicyList struct { + metav1.TypeMeta `json:",inline"` + metav1.ListMeta `json:"metadata,omitempty"` + Items []ClusterPropagationPolicy `json:"items"` +}