Skip to content

Commit b8db76e

Browse files
authored
📖 update links to godoc.org to use pkg.go.dev (kubernetes-sigs#1756)
* change godoc.org to pkg.go.dev * fix badge
1 parent e52a8b1 commit b8db76e

File tree

12 files changed

+26
-26
lines changed

12 files changed

+26
-26
lines changed

FAQ.md

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -30,13 +30,13 @@ on your situation.
3030
take this approach: the StatefulSet controller appends a specific number
3131
to each pod that it creates, while the Deployment controller hashes the
3232
pod template spec and appends that.
33-
33+
3434
- In the few cases when you cannot take advantage of deterministic names
3535
(e.g. when using generateName), it may be useful in to track which
3636
actions you took, and assume that they need to be repeated if they don't
3737
occur after a given time (e.g. using a requeue result). This is what
3838
the ReplicaSet controller does.
39-
39+
4040
In general, write your controller with the assumption that information
4141
will eventually be correct, but may be slightly out of date. Make sure
4242
that your reconcile function enforces the entire state of the world each
@@ -48,17 +48,17 @@ generally cover most circumstances.
4848
### Q: Where's the fake client? How do I use it?
4949

5050
**A**: The fake client
51-
[exists](https://godoc.org/sigs.k8s.io/controller-runtime/pkg/client/fake),
51+
[exists](https://pkg.go.dev/sigs.k8s.io/controller-runtime/pkg/client/fake),
5252
but we generally recommend using
53-
[envtest.Environment](https://godoc.org/sigs.k8s.io/controller-runtime/pkg/envtest#Environment)
53+
[envtest.Environment](https://pkg.go.dev/sigs.k8s.io/controller-runtime/pkg/envtest#Environment)
5454
to test against a real API server. In our experience, tests using fake
5555
clients gradually re-implement poorly-written impressions of a real API
5656
server, which leads to hard-to-maintain, complex test code.
5757

5858
### Q: How should I write tests? Any suggestions for getting started?
5959

6060
- Use the aforementioned
61-
[envtest.Environment](https://godoc.org/sigs.k8s.io/controller-runtime/pkg/envtest#Environment)
61+
[envtest.Environment](https://pkg.go.dev/sigs.k8s.io/controller-runtime/pkg/envtest#Environment)
6262
to spin up a real API server instead of trying to mock one out.
6363

6464
- Structure your tests to check that the state of the world is as you
@@ -77,5 +77,5 @@ mapping between Go types and group-version-kinds in Kubernetes. In
7777
general, your application should have its own Scheme containing the types
7878
from the API groups that it needs (be they Kubernetes types or your own).
7979
See the [scheme builder
80-
docs](https://godoc.org/sigs.k8s.io/controller-runtime/pkg/scheme) for
80+
docs](https://pkg.go.dev/sigs.k8s.io/controller-runtime/pkg/scheme) for
8181
more information.

README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
[![Go Report Card](https://goreportcard.com/badge/sigs.k8s.io/controller-runtime)](https://goreportcard.com/report/sigs.k8s.io/controller-runtime)
2-
[![godoc](https://godoc.org/sigs.k8s.io/controller-runtime?status.svg)](https://godoc.org/sigs.k8s.io/controller-runtime)
2+
[![godoc](https://pkg.go.dev/badge/sigs.k8s.io/controller-runtime)](https://pkg.go.dev/sigs.k8s.io/controller-runtime)
33

44
# Kubernetes controller-runtime Project
55

designs/README.md

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@ Designs
22
=======
33

44
These are design documents for changes to Controller Runtime They exist
5-
to help document the design processes that go into writing Controller
5+
to help document the design processes that go into writing Controller
66
Runtime, but may not be up-to-date (more below).
77

88
Not all changes to Controller Runtime need a design document -- only major
@@ -17,7 +17,7 @@ proof-of-concept process can help iron out wrinkles and can help with the
1717
## Out-of-Date Designs
1818

1919
**Controller Runtime documentation
20-
[GoDoc](https://godoc.org/sigs.k8s.io/controller-runtime) should be
20+
[GoDoc](https://pkg.go.dev/sigs.k8s.io/controller-runtime) should be
2121
considered the canonical, update-to-date reference and architectural
2222
documentation** for Controller Runtime.
2323

@@ -33,4 +33,4 @@ This change is out of date. It turns out curly braces a frustrating to
3333
type, so we had to abandon functions entirely, and have users specify
3434
custom functionality using strings of Common LISP instead. See #000 for
3535
more information.
36-
```
36+
```

designs/component-config.md

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -37,7 +37,7 @@ Currently controllers that use `controller-runtime` need to configure the `ctrl.
3737

3838
## Motivation
3939

40-
This change is important because:
40+
This change is important because:
4141
- it will help make it easier for controllers to be configured by other machine processes
4242
- it will reduce the required flags required to start a controller
4343
- allow for configuration types which aren't natively supported by flags
@@ -65,7 +65,7 @@ This change is important because:
6565

6666
## Proposal
6767

68-
The `ctrl.Manager` _SHOULD_ support loading configurations from `ComponentConfig` like objects.
68+
The `ctrl.Manager` _SHOULD_ support loading configurations from `ComponentConfig` like objects.
6969
An interface for that object with getters for the specific configuration parameters is created to bridge existing patterns.
7070

7171
Without breaking the current `ctrl.NewManager` which uses an exported `ctrl.Options{}` the `manager.go` can expose a new func, `NewFromComponentConfig()` this would be able to loop through the getters to populate an internal `ctrl.Options{}` and pass that into `New()`.
@@ -101,7 +101,7 @@ type ManagerConfiguration interface {
101101
func NewFromComponentConfig(config *rest.Config, scheme *runtime.Scheme, filename string, managerconfig ManagerConfiguration) (Manager, error) {
102102
codecs := serializer.NewCodecFactory(scheme)
103103
if err := decodeComponentConfigFileInto(codecs, filename, managerconfig); err != nil {
104-
104+
105105
}
106106
options := Options{}
107107

@@ -139,7 +139,7 @@ import (
139139

140140
// ControllerManagerConfiguration defines the embedded RuntimeConfiguration for controller-runtime clients.
141141
type ControllerManagerConfiguration struct {
142-
Namespace string `json:"namespace,omitempty"`
142+
Namespace string `json:"namespace,omitempty"`
143143

144144
SyncPeriod *time.Duration `json:"syncPeriod,omitempty"`
145145

@@ -168,7 +168,7 @@ type ControllerManagerConfigurationHealth struct {
168168

169169
#### Default ComponentConfig Type
170170

171-
To enable `controller-runtime` to have a default `ComponentConfig` struct which can be used instead of requiring each controller or extension to build it's own `ComponentConfig` type, we can create a `DefaultControllerConfiguration` type which can exist in `pkg/api/config/v1alpha1/types.go`. This will allow the controller authors to use this before needing to implement their own type with additional configs.
171+
To enable `controller-runtime` to have a default `ComponentConfig` struct which can be used instead of requiring each controller or extension to build its own `ComponentConfig` type, we can create a `DefaultControllerConfiguration` type which can exist in `pkg/api/config/v1alpha1/types.go`. This will allow the controller authors to use this before needing to implement their own type with additional configs.
172172

173173
```golang
174174
// pkg/api/config/v1alpha1/types.go
@@ -212,12 +212,12 @@ if err != nil {
212212
}
213213
```
214214

215-
The above example uses `configname` which is the name of the file to load the configuration from and uses `scheme` to get the specific serializer, eg `serializer.NewCodecFactory(scheme)`. This will allow the configuration to be unmarshalled into the `runtime.Object` type and passed into the
215+
The above example uses `configname` which is the name of the file to load the configuration from and uses `scheme` to get the specific serializer, eg `serializer.NewCodecFactory(scheme)`. This will allow the configuration to be unmarshalled into the `runtime.Object` type and passed into the
216216
`ctrl.NewManagerFromComponentConfig()` as a `ManagerConfiguration` interface.
217217

218218
#### Using Flags w/ ComponentConfig
219219

220-
Since this design still requires setting up the initial `ComponentConfig` type and passing in a pointer to `ctrl.NewFromComponentConfig()` if you want to allow for the use of flags, your controller can use any of the different flagging interfaces. eg [`flag`](https://golang.org/pkg/flag/), [`pflag`](https://godoc.org/github.com/spf13/pflag), [`flagnum`](https://godoc.org/github.com/luci/luci-go/common/flag/flagenum) and set values on the `ComponentConfig` type prior to passing the pointer into the `ctrl.NewFromComponentConfig()`, example below.
220+
Since this design still requires setting up the initial `ComponentConfig` type and passing in a pointer to `ctrl.NewFromComponentConfig()` if you want to allow for the use of flags, your controller can use any of the different flagging interfaces. eg [`flag`](https://golang.org/pkg/flag/), [`pflag`](https://pkg.go.dev/github.com/spf13/pflag), [`flagnum`](https://pkg.go.dev/github.com/luci/luci-go/common/flag/flagenum) and set values on the `ComponentConfig` type prior to passing the pointer into the `ctrl.NewFromComponentConfig()`, example below.
221221

222222
```golang
223223
leaderElect := true
@@ -247,7 +247,7 @@ import (
247247
248248
metav1 "k8s.io/apimachinery/pkg/apis/meta/v1"
249249
configv1alpha1 "sigs.k8s.io/controller-runtime/pkg/apis/config/v1alpha1"
250-
)
250+
)
251251
252252
type ControllerNameConfigurationSpec struct {
253253
configv1alpha1.ControllerManagerConfiguration `json:",inline"`

doc.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -107,7 +107,7 @@ limitations under the License.
107107
//
108108
// Logging (pkg/log) in controller-runtime is done via structured logs, using a
109109
// log set of interfaces called logr
110-
// (https://godoc.org/github.com/go-logr/logr). While controller-runtime
110+
// (https://pkg.go.dev/github.com/go-logr/logr). While controller-runtime
111111
// provides easy setup for using Zap (https://go.uber.org/zap, pkg/log/zap),
112112
// you can provide any implementation of logr as the base logger for
113113
// controller-runtime.

pkg/client/fake/client.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -227,7 +227,7 @@ func (t versionedTracker) Create(gvr schema.GroupVersionResource, obj runtime.Ob
227227

228228
// convertFromUnstructuredIfNecessary will convert *unstructured.Unstructured for a GVK that is recocnized
229229
// by the schema into the whatever the schema produces with New() for said GVK.
230-
// This is required because the tracker unconditionally saves on manipulations, but it's List() implementation
230+
// This is required because the tracker unconditionally saves on manipulations, but its List() implementation
231231
// tries to assign whatever it finds into a ListType it gets from schema.New() - Thus we have to ensure
232232
// we save as the very same type, otherwise subsequent List requests will fail.
233233
func convertFromUnstructuredIfNecessary(s *runtime.Scheme, o runtime.Object) (runtime.Object, error) {

pkg/controller/controllerutil/controllerutil.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -345,7 +345,7 @@ func mutate(f MutateFn, key client.ObjectKey, obj client.Object) error {
345345
return nil
346346
}
347347

348-
// MutateFn is a function which mutates the existing object into it's desired state.
348+
// MutateFn is a function which mutates the existing object into its desired state.
349349
type MutateFn func() error
350350

351351
// AddFinalizer accepts an Object and adds the provided finalizer if not present.

pkg/log/deleg.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -177,7 +177,7 @@ func (l *DelegatingLogSink) Fulfill(actual logr.LogSink) {
177177
}
178178

179179
// NewDelegatingLogSink constructs a new DelegatingLogSink which uses
180-
// the given logger before it's promise is fulfilled.
180+
// the given logger before its promise is fulfilled.
181181
func NewDelegatingLogSink(initial logr.LogSink) *DelegatingLogSink {
182182
l := &DelegatingLogSink{
183183
logger: initial,

pkg/log/log.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,7 @@ limitations under the License.
2929
//
3030
// All logging in controller-runtime is structured, using a set of interfaces
3131
// defined by a package called logr
32-
// (https://godoc.org/github.com/go-logr/logr). The sub-package zap provides
32+
// (https://pkg.go.dev/github.com/go-logr/logr). The sub-package zap provides
3333
// helpers for setting up logr backed by Zap (go.uber.org/zap).
3434
package log
3535

pkg/log/warning_handler.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -47,7 +47,7 @@ type KubeAPIWarningLogger struct {
4747
}
4848

4949
// HandleWarningHeader handles logging for responses from API server that are
50-
// warnings with code being 299 and uses a logr.Logger for it's logging purposes.
50+
// warnings with code being 299 and uses a logr.Logger for its logging purposes.
5151
func (l *KubeAPIWarningLogger) HandleWarningHeader(code int, agent string, message string) {
5252
if code != 299 || len(message) == 0 {
5353
return

pkg/log/zap/zap.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -138,7 +138,7 @@ type Options struct {
138138
// console when Development is true and JSON otherwise
139139
Encoder zapcore.Encoder
140140
// EncoderConfigOptions can modify the EncoderConfig needed to initialize an Encoder.
141-
// See https://godoc.org/go.uber.org/zap/zapcore#EncoderConfig for the list of options
141+
// See https://pkg.go.dev/go.uber.org/zap/zapcore#EncoderConfig for the list of options
142142
// that can be configured.
143143
// Note that the EncoderConfigOptions are not applied when the Encoder option is already set.
144144
EncoderConfigOptions []EncoderConfigOption

tools/setup-envtest/store/store.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -229,7 +229,7 @@ func (s *Store) Remove(ctx context.Context, matching Filter) ([]Item, error) {
229229
func (s *Store) Path(item Item) (string, error) {
230230
path := s.unpackedPath(item.dirName())
231231
// NB(directxman12): we need root's realpath because RealPath only
232-
// looks at it's own path, and so thus doesn't prepend the underlying
232+
// looks at its own path, and so thus doesn't prepend the underlying
233233
// root's base path.
234234
//
235235
// Technically, if we're fed something that's double wrapped as root,

0 commit comments

Comments
 (0)