Skip to content

Commit

Permalink
Merge pull request #4704 from Madhur97/capi
Browse files Browse the repository at this point in the history
📖 CRS API does not allow empty selectors
  • Loading branch information
k8s-ci-robot authored Jun 1, 2021
2 parents 53b581e + 356dee9 commit cd3a694
Show file tree
Hide file tree
Showing 3 changed files with 4 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -199,7 +199,8 @@ spec:
clusterSelector:
description: Label selector for Clusters. The Clusters that are selected
by this will be the ones affected by this ClusterResourceSet. It
must match the Cluster labels. This field is immutable.
must match the Cluster labels. This field is immutable. Label selector
cannot be empty.
properties:
matchExpressions:
description: matchExpressions is a list of label selector requirements.
Expand Down
2 changes: 1 addition & 1 deletion docs/proposals/20200220-cluster-resource-set.md
Original file line number Diff line number Diff line change
Expand Up @@ -96,7 +96,7 @@ None. We are planning to implement this feature without modifying any of the exi

#### ClusterResourceSet Object Definition

This is the CRD that has a set of components (resources) to be applied to clusters that match the label selector in it.
This is the CRD that has a set of components (resources) to be applied to clusters that match the label selector in it. The label selector cannot be empty.

The resources field is a list of `Secrets`/`ConfigMaps` which should be in the same namespace with `ClusterResourceSet`. The clusterSelector field is a Kubernetes [label selector](https://kubernetes.io/docs/concepts/overview/working-with-objects/labels/#resources-that-support-set-based-requirements) that matches against labels on clusters (only the clusters in the same namespace with the ClusterResourceSet resource).
ClusterResourceSet is namespace-scoped, all resources and clusters needs to be in the same namespace as the ClusterResourceSet.
Expand Down
1 change: 1 addition & 0 deletions exp/addons/api/v1alpha4/clusterresourceset_types.go
Original file line number Diff line number Diff line change
Expand Up @@ -37,6 +37,7 @@ type ClusterResourceSetSpec struct {
// Label selector for Clusters. The Clusters that are
// selected by this will be the ones affected by this ClusterResourceSet.
// It must match the Cluster labels. This field is immutable.
// Label selector cannot be empty.
ClusterSelector metav1.LabelSelector `json:"clusterSelector"`

// Resources is a list of Secrets/ConfigMaps where each contains 1 or more resources to be applied to remote clusters.
Expand Down

0 comments on commit cd3a694

Please sign in to comment.