Skip to content

Commit 0d54bbd

Browse files
authored
Fix documentation link issues: (#6766)
* Pin reference for component-config-tutorial to use v3 of the kubebuilder book documentation since it is no longer supported in v4 * Updated link reference to kuttl to chainsaw * Removed link to structured log in logging.md as the site is no longer available (www.client9.com) Signed-off-by: Jordi Gil <[email protected]>
1 parent 5f68865 commit 0d54bbd

File tree

6 files changed

+56
-58
lines changed

6 files changed

+56
-58
lines changed

website/content/en/docs/building-operators/golang/migration.md

+3-4
Original file line numberDiff line numberDiff line change
@@ -156,7 +156,7 @@ type MemcachedList struct {...}
156156

157157
### Webhooks
158158

159-
SDK version `1.0.0` and later has support for webhooks by the CLI. If your project doesn't require any webhooks, you can skip this section. However, if you have been using it via customizations in your project, you should use the tool to re-scaffold the webhooks.
159+
SDK version `1.0.0` and later has support for webhooks by the CLI. If your project doesn't require any webhooks, you can skip this section. However, if you have been using it via customizations in your project, you should use the tool to re-scaffold the webhooks.
160160

161161
A webhook can only be scaffolded for a pre-existent API in your project. Then, for each case you will run the command `operator-sdk create webhook` providing the `--group`, `--kind` and `version` of the API based on the flags that need to be used.
162162

@@ -225,7 +225,7 @@ In the Memcached example, they look like the following:
225225
//+kubebuilder:rbac:groups=core,resources=pods,verbs=get;list
226226
```
227227

228-
To update `config/rbac/role.yaml` after changing the markers, run `make manifests`.
228+
To update `config/rbac/role.yaml` after changing the markers, run `make manifests`.
229229

230230
By default, new projects are cluster-scoped (i.e. they have cluster-scoped permissions and watch all namespaces). Read the [operator scope documentation][operator-scope] for more information about changing the scope of your operator.
231231

@@ -330,7 +330,7 @@ kubectl apply -f https://raw.githubusercontent.com/coreos/prometheus-operator/re
330330
331331
#### Use Handler from `operator-lib`
332332

333-
By using the [InstrumentedEnqueueRequestForObject](https://pkg.go.dev/github.com/operator-framework/[email protected]/handler?tab=doc#InstrumentedEnqueueRequestForObject) you will be able to export metrics from your Custom Resources. In our example, it would look like:
333+
By using the [InstrumentedEnqueueRequestForObject](https://pkg.go.dev/github.com/operator-framework/[email protected]/handler?tab=doc#InstrumentedEnqueueRequestForObject) you will be able to export metrics from your Custom Resources. In our example, it would look like:
334334

335335
```go
336336
import (
@@ -445,7 +445,6 @@ For further steps regarding the deployment of the operator, creation of custom r
445445
[healthz-ping]: https://pkg.go.dev/sigs.k8s.io/controller-runtime/pkg/healthz#CheckHandler
446446
[controller-runtime]: https://github.com/kubernetes-sigs/controller-runtime/releases
447447
[component-proposal]: https://github.com/kubernetes-sigs/controller-runtime/blob/master/designs/component-config.md
448-
[component-config-tutorial]: https://github.com/kubernetes-sigs/kubebuilder/blob/master/docs/book/src/component-config-tutorial/tutorial.md
449448
[plugins-phase1-design-doc]: https://github.com/kubernetes-sigs/kubebuilder/blob/master/designs/extensible-cli-and-scaffolding-plugins-phase-1.md
450449
[migration-doc]: /docs/upgrading-sdk-version/
451450
[tutorial-deploy]: /docs/building-operators/golang/tutorial/#run-the-operator

website/content/en/docs/building-operators/golang/references/logging.md

+1-2
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@ weight: 20
66

77
# Overview
88

9-
Operator SDK-generated operators use the [`logr`][godoc_logr] interface to log. This log interface has several backends such as [`zap`][repo_zapr], which the SDK uses in generated code by default. [`logr.Logger`][godoc_logr_logger] exposes [structured logging][site_struct_logging] methods that help create machine-readable logs and adding a wealth of information to log records.
9+
Operator SDK-generated operators use the [`logr`][godoc_logr] interface to log. This log interface has several backends such as [`zap`][repo_zapr], which the SDK uses in generated code by default. [`logr.Logger`][godoc_logr_logger] exposes structured logging methods that help create machine-readable logs and adding a wealth of information to log records.
1010

1111
## Default zap logger
1212

@@ -258,7 +258,6 @@ If you do not want to use `logr` as your logging tool, you can remove `logr`-spe
258258
[godoc_logr]:https://pkg.go.dev/github.com/go-logr/logr
259259
[repo_zapr]:https://pkg.go.dev/github.com/go-logr/zapr
260260
[godoc_logr_logger]:https://pkg.go.dev/github.com/go-logr/logr#Logger
261-
[site_struct_logging]:https://www.client9.com/structured-logging-in-golang/
262261
[code_memcached_controller]: https://github.com/operator-framework/operator-sdk/blob/v1.2.0/testdata/go/memcached-operator/controllers/memcached_controller.go
263262
[logfmt_repo]:https://github.com/jsternberg/zap-logfmt
264263
[controller_runtime_zap]:https://github.com/kubernetes-sigs/controller-runtime/tree/master/pkg/log/zap

website/content/en/docs/building-operators/golang/testing.md

+5-5
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
---
22
title: Testing your Operator project
33
linkTitle: Testing with EnvTest
4-
description: Learn how to ensure the quality of your Operator project
4+
description: Learn how to ensure the quality of your Operator project
55
weight: 70
66
---
77

@@ -20,13 +20,13 @@ These tests are runnable as native Go tests:
2020
go test controllers/ -v -ginkgo.v
2121
```
2222

23-
The projects generated by using the SDK tool have a Makefile which contains the target tests which executes when you run `make test`. Note that this target will also execute when you run `make docker-build IMG=<some-registry>/<project-name>:<tag>`.
23+
The projects generated by using the SDK tool have a Makefile which contains the target tests which executes when you run `make test`. Note that this target will also execute when you run `make docker-build IMG=<some-registry>/<project-name>:<tag>`.
2424

25-
Operator SDK adopted this stack to write tests for its operators. It might be useful to check [writing controller tests][writing-controller-tests] documentation and examples to learn how to better write tests for your operator. See, for example, that [controller-runtime](https://github.com/kubernetes-sigs/controller-runtime) is covered by tests using the same stack as well.
25+
Operator SDK adopted this stack to write tests for its operators. It might be useful to check [writing controller tests][writing-controller-tests] documentation and examples to learn how to better write tests for your operator. See, for example, that [controller-runtime](https://github.com/kubernetes-sigs/controller-runtime) is covered by tests using the same stack as well.
2626

2727
## e2e Integration tests
2828

29-
- **For Golang-based operators**: you can create the e2e tests using Go. See the `test` directory for the Memcached sample
29+
- **For Golang-based operators**: you can create the e2e tests using Go. See the `test` directory for the Memcached sample
3030
under the [testdata/go/v3/memcached-operator][sample] to see an example of e2e tests.
3131
- **For Ansible-based operators**: you can use [Molecule][molecule], an Ansible testing framework. For further information see [Testing with Molecule][molecule-tests].
3232
- **For Helm-based operators**: you can also use [Chart tests][helm-chart-tests].
@@ -62,4 +62,4 @@ To implement application-specific tests, the SDK's test harness, [scorecard][sco
6262
[helm-legacy-shell]: https://github.com/operator-framework/operator-sdk/blob/v1.0.0/hack/tests/e2e-helm.sh
6363
[ansible-legacy-shell]: https://github.com/operator-framework/operator-sdk/blob/v1.0.0/hack/tests/e2e-ansible.sh
6464
[chainsaw]: https://kyverno.github.io/chainsaw/latest/
65-
[from-kuttl-to-chainsaw]: https://kyverno.github.io/chainsaw/latest/more/kuttl-migration/
65+
[from-kuttl-to-chainsaw]: https://kyverno.github.io/chainsaw/latest/guides/kuttl-migration

website/content/en/docs/upgrading-sdk-version/v1.21.0.md

+1-1
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@ such as `api/webhook_suitetest.go` directory as for your controllers in `control
1818

1919
_See [#4863](https://github.com/operator-framework/operator-sdk/pull/4863) for more details._
2020

21-
## For Golang-based operators, update Dockerfile if you are using the [declarative/v1 plugin](https://book.kubebuilder.io/plugins/declarative-v1.html)
21+
## For Golang-based operators, update Dockerfile if you are using the [declarative/v1 plugin](https://book-v3.book.kubebuilder.io/plugins/declarative-v1.html)
2222

2323
If you are using the declarative/v1 plugin for your scaffolds, then following the steps to update the Dockerfile.
2424
a) After `COPY controllers/ controllers/` add:

website/content/en/docs/upgrading-sdk-version/v1.7.0.md

+23-23
Original file line numberDiff line numberDiff line change
@@ -5,13 +5,13 @@ weight: 998993000
55

66
## Add the manager config patch to config/default/kustomization.yaml
77

8-
The scaffolded `--config` flag was not added to either ansible-/helm-operator binary when [config file](https://master.book.kubebuilder.io/component-config-tutorial/tutorial.html) support was originally added, so does not currently work. The `--config` flag supports configuration of both binaries by file; this method of configuration only applies to the underlying [controller manager](https://pkg.go.dev/sigs.k8s.io/controller-runtime/pkg/manager#Manager), not the operator as a whole. To optionally configure the operator's Deployment with a config file, make the following update to config/default/kustomization.yaml:
9-
```diff
10-
# If you want your controller-manager to expose the /metrics # endpoint w/o any authn/z, please comment the following line.
11-
- manager_auth_proxy_patch.yaml
12-
+# Mount the controller config file for loading manager configurations
13-
+# through a ComponentConfig type
14-
+- manager_config_patch.yaml
8+
The scaffolded `--config` flag was not added to either ansible-/helm-operator binary when [config file](https://book-v3.book.kubebuilder.io/component-config-tutorial/tutorial.html) support was originally added, so does not currently work. The `--config` flag supports configuration of both binaries by file; this method of configuration only applies to the underlying [controller manager](https://pkg.go.dev/sigs.k8s.io/controller-runtime/pkg/manager#Manager), not the operator as a whole. To optionally configure the operator's Deployment with a config file, make the following update to config/default/kustomization.yaml:
9+
```diff
10+
# If you want your controller-manager to expose the /metrics # endpoint w/o any authn/z, please comment the following line.
11+
- manager_auth_proxy_patch.yaml
12+
+# Mount the controller config file for loading manager configurations
13+
+# through a ComponentConfig type
14+
+- manager_config_patch.yaml
1515
```
1616
This feature is opt-in: flags can be used as-is or to override config file values.
1717

@@ -32,16 +32,16 @@ rules: \- apiGroups:
3232
- - coordination.k8s.io
3333
resources:
3434
- configmaps
35-
+ verbs:
36-
+- get
37-
+- list
38-
+- watch
39-
+- create
40-
+- update
41-
+- patch
42-
+- delete
43-
+- apiGroups:
44-
+- coordination.k8s.io
35+
+ verbs:
36+
+- get
37+
+- list
38+
+- watch
39+
+- create
40+
+- update
41+
+- patch
42+
+- delete
43+
+- apiGroups:
44+
+- coordination.k8s.io
4545
+ resources:
4646
- leases
4747
verbs:
@@ -56,11 +56,11 @@ Importing `setup-envtest.sh` needs bash, so your Makefile's `SHELL` variable sho
5656
```diff
5757
else GOBIN=$(shell go env GOBIN)
5858
endif
59-
+# Setting SHELL to bash allows bash commands to be executed by recipes.
60-
+# This is a requirement for 'setup-envtest.sh' in the test target.
61-
+# Options are set to exit when a recipe line exits non-zero or a piped command fails.
62-
+SHELL = /usr/bin/env bash -o pipefail
63-
+.SHELLFLAGS = -ec
64-
+ all: build
59+
+# Setting SHELL to bash allows bash commands to be executed by recipes.
60+
+# This is a requirement for 'setup-envtest.sh' in the test target.
61+
+# Options are set to exit when a recipe line exits non-zero or a piped command fails.
62+
+SHELL = /usr/bin/env bash -o pipefail
63+
+.SHELLFLAGS = -ec
64+
+ all: build
6565
```
6666
_See [#4835](https://github.com/operator-framework/operator-sdk/pull/4835) for more details._

website/content/en/docs/upgrading-sdk-version/v1.7.1.md

+23-23
Original file line numberDiff line numberDiff line change
@@ -5,13 +5,13 @@ weight: 998992999
55

66
## Add the manager config patch to config/default/kustomization.yaml
77

8-
The scaffolded `--config` flag was not added to either ansible-/helm-operator binary when [config file](https://master.book.kubebuilder.io/component-config-tutorial/tutorial.html) support was originally added, so does not currently work. The `--config` flag supports configuration of both binaries by file; this method of configuration only applies to the underlying [controller manager](https://pkg.go.dev/sigs.k8s.io/controller-runtime/pkg/manager#Manager), not the operator as a whole. To optionally configure the operator's Deployment with a config file, make the following update to config/default/kustomization.yaml:
9-
```diff
10-
# If you want your controller-manager to expose the /metrics # endpoint w/o any authn/z, please comment the following line.
11-
\- manager_auth_proxy_patch.yaml
12-
+# Mount the controller config file for loading manager configurations
13-
+# through a ComponentConfig type
14-
+- manager_config_patch.yaml
8+
The scaffolded `--config` flag was not added to either ansible-/helm-operator binary when [config file](https://book-v3.book.kubebuilder.io/component-config-tutorial/tutorial.html) support was originally added, so does not currently work. The `--config` flag supports configuration of both binaries by file; this method of configuration only applies to the underlying [controller manager](https://pkg.go.dev/sigs.k8s.io/controller-runtime/pkg/manager#Manager), not the operator as a whole. To optionally configure the operator's Deployment with a config file, make the following update to config/default/kustomization.yaml:
9+
```diff
10+
# If you want your controller-manager to expose the /metrics # endpoint w/o any authn/z, please comment the following line.
11+
\- manager_auth_proxy_patch.yaml
12+
+# Mount the controller config file for loading manager configurations
13+
+# through a ComponentConfig type
14+
+- manager_config_patch.yaml
1515
```
1616
This feature is opt-in: flags can be used as-is or to override config file values.
1717

@@ -33,16 +33,16 @@ rules:
3333
- - coordination.k8s.io
3434
resources:
3535
- configmaps
36-
+ verbs:
37-
+- get
38-
+- list
39-
+- watch
40-
+- create
41-
+- update
42-
+- patch
43-
+- delete
44-
+- apiGroups:
45-
+- coordination.k8s.io
36+
+ verbs:
37+
+- get
38+
+- list
39+
+- watch
40+
+- create
41+
+- update
42+
+- patch
43+
+- delete
44+
+- apiGroups:
45+
+- coordination.k8s.io
4646
+ resources:
4747
- leases
4848
verbs:
@@ -57,12 +57,12 @@ Importing `setup-envtest.sh` needs bash, so your Makefile's `SHELL` variable sho
5757
```diff
5858
else GOBIN=$(shell go env GOBIN)
5959
endif
60-
+# Setting SHELL to bash allows bash commands to be executed by recipes.
61-
+# This is a requirement for 'setup-envtest.sh' in the test target.
62-
+# Options are set to exit when a recipe line exits non-zero or a piped command fails.
63-
+SHELL = /usr/bin/env bash -o pipefail
64-
+.SHELLFLAGS = -ec
65-
+ all: build
60+
+# Setting SHELL to bash allows bash commands to be executed by recipes.
61+
+# This is a requirement for 'setup-envtest.sh' in the test target.
62+
+# Options are set to exit when a recipe line exits non-zero or a piped command fails.
63+
+SHELL = /usr/bin/env bash -o pipefail
64+
+.SHELLFLAGS = -ec
65+
+ all: build
6666
```
6767
_See [#4835](https://github.com/operator-framework/operator-sdk/pull/4835) for more details._
6868

0 commit comments

Comments
 (0)