Skip to content

Commit 8b2a237

Browse files
authored
Merge pull request #11735 from tsuzu/use-labels-for-kustomize
🌱 Use labels for kustomize
2 parents 8a141c5 + 2907067 commit 8b2a237

File tree

5 files changed

+29
-23
lines changed

5 files changed

+29
-23
lines changed

docs/book/src/developer/providers/contracts/bootstrap-config.md

Lines changed: 6 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -135,13 +135,14 @@ The value is an underscore-delimited (_) list of versions. Each value MUST point
135135
The label allows Cluster API controllers to perform automatic conversions for object references, the controllers will pick
136136
the last available version in the list if multiple versions are found.
137137

138-
To apply the label to CRDs it’s possible to use commonLabels in your `kustomize.yaml` file, usually in `config/crd`:
138+
To apply the label to CRDs it’s possible to use labels in your `kustomization.yaml` file, usually in `config/crd`:
139139

140140
```yaml
141-
commonLabels:
142-
cluster.x-k8s.io/v1alpha2: v1alpha1
143-
cluster.x-k8s.io/v1alpha3: v1alpha2
144-
cluster.x-k8s.io/v1beta1: v1beta1
141+
labels:
142+
- pairs:
143+
cluster.x-k8s.io/v1alpha2: v1alpha1
144+
cluster.x-k8s.io/v1alpha3: v1alpha2
145+
cluster.x-k8s.io/v1beta1: v1beta1
145146
```
146147

147148
An example of this is in the [Kubeadm Bootstrap provider](https://github.com/kubernetes-sigs/cluster-api/blob/release-1.1/controlplane/kubeadm/config/crd/kustomization.yaml).

docs/book/src/developer/providers/contracts/control-plane.md

Lines changed: 6 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -160,13 +160,14 @@ The value is an underscore-delimited (_) list of versions. Each value MUST point
160160
The label allows Cluster API controllers to perform automatic conversions for object references, the controllers will pick
161161
the last available version in the list if multiple versions are found.
162162

163-
To apply the label to CRDs it’s possible to use commonLabels in your `kustomize.yaml` file, usually in `config/crd`:
163+
To apply the label to CRDs it’s possible to use labels in your `kustomization.yaml` file, usually in `config/crd`:
164164

165165
```yaml
166-
commonLabels:
167-
cluster.x-k8s.io/v1alpha2: v1alpha1
168-
cluster.x-k8s.io/v1alpha3: v1alpha2
169-
cluster.x-k8s.io/v1beta1: v1beta1
166+
labels:
167+
- pairs:
168+
cluster.x-k8s.io/v1alpha2: v1alpha1
169+
cluster.x-k8s.io/v1alpha3: v1alpha2
170+
cluster.x-k8s.io/v1beta1: v1beta1
170171
```
171172

172173
An example of this is in the [Kubeadm Bootstrap provider](https://github.com/kubernetes-sigs/cluster-api/blob/release-1.1/controlplane/kubeadm/config/crd/kustomization.yaml).

docs/book/src/developer/providers/contracts/infra-cluster.md

Lines changed: 6 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -144,13 +144,14 @@ The value is an underscore-delimited (_) list of versions. Each value MUST point
144144
The label allows Cluster API controllers to perform automatic conversions for object references, the controllers will pick
145145
the last available version in the list if multiple versions are found.
146146

147-
To apply the label to CRDs it’s possible to use commonLabels in your `kustomize.yaml` file, usually in `config/crd`:
147+
To apply the label to CRDs it’s possible to use labels in your `kustomization.yaml` file, usually in `config/crd`:
148148

149149
```yaml
150-
commonLabels:
151-
cluster.x-k8s.io/v1alpha2: v1alpha1
152-
cluster.x-k8s.io/v1alpha3: v1alpha2
153-
cluster.x-k8s.io/v1beta1: v1beta1
150+
labels:
151+
- pairs:
152+
cluster.x-k8s.io/v1alpha2: v1alpha1
153+
cluster.x-k8s.io/v1alpha3: v1alpha2
154+
cluster.x-k8s.io/v1beta1: v1beta1
154155
```
155156

156157
An example of this is in the [Kubeadm Bootstrap provider](https://github.com/kubernetes-sigs/cluster-api/blob/release-1.1/controlplane/kubeadm/config/crd/kustomization.yaml).

docs/book/src/developer/providers/contracts/infra-machine.md

Lines changed: 6 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -135,13 +135,14 @@ The value is an underscore-delimited (_) list of versions. Each value MUST point
135135
The label allows Cluster API controllers to perform automatic conversions for object references, the controllers will pick
136136
the last available version in the list if multiple versions are found.
137137

138-
To apply the label to CRDs it’s possible to use commonLabels in your `kustomize.yaml` file, usually in `config/crd`:
138+
To apply the label to CRDs it’s possible to use labels in your `kustomization.yaml` file, usually in `config/crd`:
139139

140140
```yaml
141-
commonLabels:
142-
cluster.x-k8s.io/v1alpha2: v1alpha1
143-
cluster.x-k8s.io/v1alpha3: v1alpha2
144-
cluster.x-k8s.io/v1beta1: v1beta1
141+
labels:
142+
- pairs:
143+
cluster.x-k8s.io/v1alpha2: v1alpha1
144+
cluster.x-k8s.io/v1alpha3: v1alpha2
145+
cluster.x-k8s.io/v1beta1: v1beta1
145146
```
146147

147148
An example of this is in the [Kubeadm Bootstrap provider](https://github.com/kubernetes-sigs/cluster-api/blob/release-1.1/controlplane/kubeadm/config/crd/kustomization.yaml).

docs/book/src/developer/providers/getting-started/building-running-and-testing.md

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -59,9 +59,11 @@ Conditions:
5959

6060
In this guide, we are building an _infrastructure provider_. We must tell cluster-api and its developer tooling which type of provider it is. Edit `config/default/kustomization.yaml` and add the following common label. The prefix `infrastructure-` [is used][label_prefix] to detect the provider type.
6161

62-
```sh
63-
commonLabels:
64-
cluster.x-k8s.io/provider: infrastructure-mailgun
62+
```yaml
63+
labels:
64+
- includeSelectors: true
65+
pairs:
66+
cluster.x-k8s.io/provider: infrastructure-mailgun
6567
```
6668
6769
Now you can apply your provider as well:

0 commit comments

Comments
 (0)