Skip to content

Commit da3322d

Browse files
⚠️ deprecate component config and no longer able to ensure that it is functioning as intended
1 parent cef5f4c commit da3322d

File tree

82 files changed

+84
-3282
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

82 files changed

+84
-3282
lines changed

docs/book/src/component-config-tutorial/api-changes.md

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,17 @@
11
# Changing things up
22

3+
<aside class="note warning">
4+
<h1>Component Config is deprecated</h1>
5+
6+
The ComponentConfig has been deprecated in the Controller-Runtime since its version 0.15.0. [More info](https://github.com/kubernetes-sigs/controller-runtime/issues/895)
7+
Moreover, it has undergone breaking changes and is no longer functioning as intended.
8+
As a result, Kubebuilder, which heavily relies on the Controller Runtime, has also deprecated this feature,
9+
no longer guaranteeing its functionality from version 3.11.0 onwards. You can find additional details on this issue [here](https://github.com/kubernetes-sigs/controller-runtime/issues/2370).
10+
11+
Please, be aware that it will force Kubebuilder remove this option soon in future release.
12+
13+
</aside>
14+
315
This tutorial will show you how to create a custom configuration file for your
416
project by modifying a project generated with the `--component-config` flag
517
passed to the `init` command. The full tutorial's source can be found

docs/book/src/component-config-tutorial/config-type.md

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,17 @@
11
# Adding a new Config Type
22

3+
<aside class="note warning">
4+
<h1>Component Config is deprecated</h1>
5+
6+
The ComponentConfig has been deprecated in the Controller-Runtime since its version 0.15.0. [More info](https://github.com/kubernetes-sigs/controller-runtime/issues/895)
7+
Moreover, it has undergone breaking changes and is no longer functioning as intended.
8+
As a result, Kubebuilder, which heavily relies on the Controller Runtime, has also deprecated this feature,
9+
no longer guaranteeing its functionality from version 3.11.0 onwards. You can find additional details on this issue [here](https://github.com/kubernetes-sigs/controller-runtime/issues/2370).
10+
11+
Please, be aware that it will force Kubebuilder remove this option soon in future release.
12+
13+
</aside>
14+
315
To scaffold out a new config Kind, we can use `kubebuilder create api`.
416

517
```bash

docs/book/src/component-config-tutorial/custom-type.md

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,17 @@
11
# Using a Custom Type
22

3+
<aside class="note warning">
4+
<h1>Component Config is deprecated</h1>
5+
6+
The ComponentConfig has been deprecated in the Controller-Runtime since its version 0.15.0. [More info](https://github.com/kubernetes-sigs/controller-runtime/issues/895)
7+
Moreover, it has undergone breaking changes and is no longer functioning as intended.
8+
As a result, Kubebuilder, which heavily relies on the Controller Runtime, has also deprecated this feature,
9+
no longer guaranteeing its functionality from version 3.11.0 onwards. You can find additional details on this issue [here](https://github.com/kubernetes-sigs/controller-runtime/issues/2370).
10+
11+
Please, be aware that it will force Kubebuilder remove this option soon in future release.
12+
13+
</aside>
14+
315
<aside class="note warning">
416

517
<h1>Built-in vs Custom Type</h1>

docs/book/src/component-config-tutorial/define-config.md

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,17 @@
11
# Defining your Config
22

3+
<aside class="note warning">
4+
<h1>Component Config is deprecated</h1>
5+
6+
The ComponentConfig has been deprecated in the Controller-Runtime since its version 0.15.0. [More info](https://github.com/kubernetes-sigs/controller-runtime/issues/895)
7+
Moreover, it has undergone breaking changes and is no longer functioning as intended.
8+
As a result, Kubebuilder, which heavily relies on the Controller Runtime, has also deprecated this feature,
9+
no longer guaranteeing its functionality from version 3.11.0 onwards. You can find additional details on this issue [here](https://github.com/kubernetes-sigs/controller-runtime/issues/2370).
10+
11+
Please, be aware that it will force Kubebuilder remove this option soon in future release.
12+
13+
</aside>
14+
315
Now that you have a component config base project we need to customize the
416
values that are passed into the controller, to do this we can take a look at
517
`config/manager/controller_manager_config.yaml`.

docs/book/src/component-config-tutorial/define-custom-config.md

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,17 @@
11
# Defining your Custom Config
22

3+
<aside class="note warning">
4+
<h1>Component Config is deprecated</h1>
5+
6+
The ComponentConfig has been deprecated in the Controller-Runtime since its version 0.15.0. [More info](https://github.com/kubernetes-sigs/controller-runtime/issues/895)
7+
Moreover, it has undergone breaking changes and is no longer functioning as intended.
8+
As a result, Kubebuilder, which heavily relies on the Controller Runtime, has also deprecated this feature,
9+
no longer guaranteeing its functionality from version 3.11.0 onwards. You can find additional details on this issue [here](https://github.com/kubernetes-sigs/controller-runtime/issues/2370).
10+
11+
Please, be aware that it will force Kubebuilder remove this option soon in future release.
12+
13+
</aside>
14+
315
Now that you have a custom component config we change the
416
`config/manager/controller_manager_config.yaml` to use the new GVK you defined.
517

docs/book/src/component-config-tutorial/tutorial.md

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,17 @@
11
# Tutorial: ComponentConfig
22

3+
<aside class="note warning">
4+
<h1>Component Config is deprecated</h1>
5+
6+
The ComponentConfig has been deprecated in the Controller-Runtime since its version 0.15.0. [More info](https://github.com/kubernetes-sigs/controller-runtime/issues/895)
7+
Moreover, it has undergone breaking changes and is no longer functioning as intended.
8+
As a result, Kubebuilder, which heavily relies on the Controller Runtime, has also deprecated this feature,
9+
no longer guaranteeing its functionality from version 3.11.0 onwards. You can find additional details on this issue [here](https://github.com/kubernetes-sigs/controller-runtime/issues/2370).
10+
11+
Please, be aware that it will force Kubebuilder remove this option soon in future release.
12+
13+
</aside>
14+
315
Nearly every project that is built for Kubernetes will eventually need to
416
support passing in additional configurations into the controller. These could
517
be to enable better logging, turn on/off specific feature gates, set the sync

docs/book/src/component-config-tutorial/updating-main.md

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,17 @@
11
# Updating main
22

3+
<aside class="note warning">
4+
<h1>Component Config is deprecated</h1>
5+
6+
The ComponentConfig has been deprecated in the Controller-Runtime since its version 0.15.0. [More info](https://github.com/kubernetes-sigs/controller-runtime/issues/895)
7+
Moreover, it has undergone breaking changes and is no longer functioning as intended.
8+
As a result, Kubebuilder, which heavily relies on the Controller Runtime, has also deprecated this feature,
9+
no longer guaranteeing its functionality from version 3.11.0 onwards. You can find additional details on this issue [here](https://github.com/kubernetes-sigs/controller-runtime/issues/2370).
10+
11+
Please, be aware that it will force Kubebuilder remove this option soon in future release.
12+
13+
</aside>
14+
315
Once you have defined your new custom component config type we need to make
416
sure our new config type has been imported and the types are registered with
517
the scheme. _If you used `kubebuilder create api` this should have been

test/e2e/v4/generate_test.go

Lines changed: 0 additions & 171 deletions
Original file line numberDiff line numberDiff line change
@@ -203,177 +203,6 @@ Count int `+"`"+`json:"count,omitempty"`+"`"+`
203203
}
204204
}
205205

206-
// GenerateV4 implements a go/v4(-alpha) plugin project defined by a TestContext.
207-
func GenerateV4ComponentConfig(kbc *utils.TestContext) {
208-
var err error
209-
210-
By("initializing a project")
211-
err = kbc.Init(
212-
"--plugins", "go/v4",
213-
"--project-version", "3",
214-
"--domain", kbc.Domain,
215-
"--component-config=true",
216-
)
217-
ExpectWithOffset(1, err).NotTo(HaveOccurred())
218-
219-
By("creating API definition")
220-
err = kbc.CreateAPI(
221-
"--group", kbc.Group,
222-
"--version", kbc.Version,
223-
"--kind", kbc.Kind,
224-
"--namespaced",
225-
"--resource",
226-
"--controller",
227-
"--make=false",
228-
)
229-
ExpectWithOffset(1, err).NotTo(HaveOccurred())
230-
231-
By("implementing the API")
232-
ExpectWithOffset(1, pluginutil.InsertCode(
233-
filepath.Join(kbc.Dir, "api", kbc.Version, fmt.Sprintf("%s_types.go", strings.ToLower(kbc.Kind))),
234-
fmt.Sprintf(`type %sSpec struct {
235-
`, kbc.Kind),
236-
` // +optional
237-
Count int `+"`"+`json:"count,omitempty"`+"`"+`
238-
`)).Should(Succeed())
239-
240-
By("scaffolding mutating and validating webhooks")
241-
err = kbc.CreateWebhook(
242-
"--group", kbc.Group,
243-
"--version", kbc.Version,
244-
"--kind", kbc.Kind,
245-
"--defaulting",
246-
"--programmatic-validation",
247-
)
248-
ExpectWithOffset(1, err).NotTo(HaveOccurred())
249-
250-
By("implementing the mutating and validating webhooks")
251-
err = pluginutil.ImplementWebhooks(filepath.Join(
252-
kbc.Dir, "api", kbc.Version,
253-
fmt.Sprintf("%s_webhook.go", strings.ToLower(kbc.Kind))))
254-
ExpectWithOffset(1, err).NotTo(HaveOccurred())
255-
256-
By("uncomment kustomization.yaml to enable webhook and ca injection")
257-
ExpectWithOffset(1, pluginutil.UncommentCode(
258-
filepath.Join(kbc.Dir, "config", "default", "kustomization.yaml"),
259-
"#- ../webhook", "#")).To(Succeed())
260-
ExpectWithOffset(1, pluginutil.UncommentCode(
261-
filepath.Join(kbc.Dir, "config", "default", "kustomization.yaml"),
262-
"#- ../certmanager", "#")).To(Succeed())
263-
ExpectWithOffset(1, pluginutil.UncommentCode(
264-
filepath.Join(kbc.Dir, "config", "default", "kustomization.yaml"),
265-
"#- ../prometheus", "#")).To(Succeed())
266-
ExpectWithOffset(1, pluginutil.UncommentCode(
267-
filepath.Join(kbc.Dir, "config", "default", "kustomization.yaml"),
268-
"#- manager_webhook_patch.yaml", "#")).To(Succeed())
269-
ExpectWithOffset(1, pluginutil.UncommentCode(
270-
filepath.Join(kbc.Dir, "config", "default", "kustomization.yaml"),
271-
"#- webhookcainjection_patch.yaml", "#")).To(Succeed())
272-
ExpectWithOffset(1, pluginutil.UncommentCode(filepath.Join(kbc.Dir, "config", "default", "kustomization.yaml"),
273-
`#replacements:
274-
# - source: # Add cert-manager annotation to ValidatingWebhookConfiguration, MutatingWebhookConfiguration and CRDs
275-
# kind: Certificate
276-
# group: cert-manager.io
277-
# version: v1
278-
# name: serving-cert # this name should match the one in certificate.yaml
279-
# fieldPath: .metadata.namespace # namespace of the certificate CR
280-
# targets:
281-
# - select:
282-
# kind: ValidatingWebhookConfiguration
283-
# fieldPaths:
284-
# - .metadata.annotations.[cert-manager.io/inject-ca-from]
285-
# options:
286-
# delimiter: '/'
287-
# index: 0
288-
# create: true
289-
# - select:
290-
# kind: MutatingWebhookConfiguration
291-
# fieldPaths:
292-
# - .metadata.annotations.[cert-manager.io/inject-ca-from]
293-
# options:
294-
# delimiter: '/'
295-
# index: 0
296-
# create: true
297-
# - select:
298-
# kind: CustomResourceDefinition
299-
# fieldPaths:
300-
# - .metadata.annotations.[cert-manager.io/inject-ca-from]
301-
# options:
302-
# delimiter: '/'
303-
# index: 0
304-
# create: true
305-
# - source:
306-
# kind: Certificate
307-
# group: cert-manager.io
308-
# version: v1
309-
# name: serving-cert # this name should match the one in certificate.yaml
310-
# fieldPath: .metadata.name
311-
# targets:
312-
# - select:
313-
# kind: ValidatingWebhookConfiguration
314-
# fieldPaths:
315-
# - .metadata.annotations.[cert-manager.io/inject-ca-from]
316-
# options:
317-
# delimiter: '/'
318-
# index: 1
319-
# create: true
320-
# - select:
321-
# kind: MutatingWebhookConfiguration
322-
# fieldPaths:
323-
# - .metadata.annotations.[cert-manager.io/inject-ca-from]
324-
# options:
325-
# delimiter: '/'
326-
# index: 1
327-
# create: true
328-
# - select:
329-
# kind: CustomResourceDefinition
330-
# fieldPaths:
331-
# - .metadata.annotations.[cert-manager.io/inject-ca-from]
332-
# options:
333-
# delimiter: '/'
334-
# index: 1
335-
# create: true
336-
# - source: # Add cert-manager annotation to the webhook Service
337-
# kind: Service
338-
# version: v1
339-
# name: webhook-service
340-
# fieldPath: .metadata.name # namespace of the service
341-
# targets:
342-
# - select:
343-
# kind: Certificate
344-
# group: cert-manager.io
345-
# version: v1
346-
# fieldPaths:
347-
# - .spec.dnsNames.0
348-
# - .spec.dnsNames.1
349-
# options:
350-
# delimiter: '.'
351-
# index: 0
352-
# create: true
353-
# - source:
354-
# kind: Service
355-
# version: v1
356-
# name: webhook-service
357-
# fieldPath: .metadata.namespace # namespace of the service
358-
# targets:
359-
# - select:
360-
# kind: Certificate
361-
# group: cert-manager.io
362-
# version: v1
363-
# fieldPaths:
364-
# - .spec.dnsNames.0
365-
# - .spec.dnsNames.1
366-
# options:
367-
# delimiter: '.'
368-
# index: 1
369-
# create: true`, "#")).To(Succeed())
370-
371-
if kbc.IsRestricted {
372-
By("uncomment kustomize files to ensure that pods are restricted")
373-
uncommentPodStandards(kbc)
374-
}
375-
}
376-
377206
func uncommentPodStandards(kbc *utils.TestContext) {
378207
configManager := filepath.Join(kbc.Dir, "config", "manager", "manager.yaml")
379208

test/e2e/v4/plugin_cluster_test.go

Lines changed: 0 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -87,13 +87,6 @@ var _ = Describe("kubebuilder", func() {
8787
GenerateV4(kbc)
8888
Run(kbc)
8989
})
90-
91-
It("should generate a runnable project"+
92-
" with restricted pods and with --component-config field enabled", func() {
93-
kbc.IsRestricted = true
94-
GenerateV4ComponentConfig(kbc)
95-
Run(kbc)
96-
})
9790
})
9891
})
9992

test/testdata/generate.sh

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -136,6 +136,5 @@ scaffold_test_project project-v3 --plugins="go/v3"
136136
scaffold_test_project project-v4 --plugins="go/v4"
137137
scaffold_test_project project-v4-multigroup --plugins="go/v4"
138138
scaffold_test_project project-v4-declarative-v1 --plugins="go/v4,declarative"
139-
scaffold_test_project project-v4-config --component-config --plugins="go/v4"
140139
scaffold_test_project project-v4-with-deploy-image --plugins="go/v4"
141140
scaffold_test_project project-v4-with-grafana --plugins="go/v4"

0 commit comments

Comments
 (0)