You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
- Run `go mod tidy` to clean up the `go.mod` file.
218
+
- Run `go mod tidy` to clean up the `go.mod` file.
219
219
- In case of any go module loading errors, consult the default [`v0.8.2` go.mod dependencies][v0.8.2-go-mod] scaffolded by the operator-sdk to resolve any differences. You can also view this file by scaffolding a new project with operator-sdk `v0.8.2`.
220
220
- Ensure that you can build the project with `operator-sdk build`
221
221
- Finally remove `Gopkg.lock`, `Gopkg.toml` and the vendor directory.
Upon updating the project to `v0.8.2` the following breaking changes apply:
226
226
227
-
- On running the command `operator-sdk generate openapi`, the CRD manifests at `deploy/crds/<group>_<version>_<kind>.crd` for all API types will now be regenerated based on their source files `pkg/apis/..._types.go`. So if you have made any manual edits to the default generated CRD manifest, e.g manually written the validation block or specified the naming (`spec.names`), then that information be overwritten when the CRD is regenerated.
227
+
- On running the command `operator-sdk generate openapi`, the CRD manifests at `deploy/crds/<group>_<version>_<kind>.crd` for all API types will now be regenerated based on their source files `pkg/apis/..._types.go`. So if you have made any manual edits to the default generated CRD manifest, e.g manually written the validation block or specified the naming (`spec.names`), then that information be overwritten when the CRD is regenerated.
228
228
229
229
The correct way to specify CRD fields like naming, validation, subresources etc is by using `// +kubebuilder` marker comments. Consult the [legacy kubebuilder documentation][legacy-kubebuilder-doc-crd] to see what CRD fields can be generated via `// +kubebuilder` marker comments.
230
230
@@ -261,8 +261,8 @@ Upon updating the project to `v0.8.2` the following breaking changes apply:
261
261
262
262
## `v0.9.x`
263
263
264
-
- The function `ExposeMetricsPort()` has been replaced with `CreateMetricsService()`[#1560](https://github.com/operator-framework/operator-sdk/pull/1560).
265
-
264
+
- The function `ExposeMetricsPort()` has been replaced with `CreateMetricsService()`[#1560](https://github.com/operator-framework/operator-sdk/pull/1560).
265
+
266
266
Replace the following line in `cmd/manager/main.go`
- The scorecard configuration format for the `operator-sdk scorecard` command has changed. See [`doc/test-framework/scorecard`](../test-framework/scorecard.md) for more info.
341
+
- The CSV config field `role-path` is now `role-paths` and takes a list of strings.
342
+
Replace:
343
+
```yaml
344
+
role-path: path/to/role.yaml
345
+
```
346
+
with:
347
+
```yaml
348
+
role-paths:
349
+
- path/to/role.yaml
350
+
```
351
+
352
+
### modules
353
+
354
+
- Ensure the the following `replace` directives are present in your `go.mod` file:
**NOTE:** this version uses Kubernetes v1.14.x and controller-runtime v0.2.x, both of which have breaking API changes. See the [changelog][changelog] for more details.
372
+
373
+
### dep
374
+
375
+
- Remove the `required = [ ... ]` section and comment from the top of your `Gopkg.toml` file.
- Replace import `sigs.k8s.io/controller-runtime/pkg/runtime/scheme` with `sigs.k8s.io/controller-runtime/pkg/scheme` in:
439
+
- `./pkg/apis/<group>/<version>/register.go`
440
+
- Replace import `sigs.k8s.io/controller-runtime/pkg/runtime/log` with `sigs.k8s.io/controller-runtime/pkg/log` in:
441
+
- `cmd/manager/main.go`
442
+
- `./pkg/controller/<kind>/<kind>_controller.go`
443
+
- Replace import `sigs.k8s.io/controller-runtime/pkg/runtime/signals` with `sigs.k8s.io/controller-runtime/pkg/manager/signals` in:
444
+
- `cmd/manager/main.go`
445
+
446
+
### controller-runtime API updates
447
+
448
+
All method signatures for [`sigs.k8s.io/controller-runtime/pkg/client.Client`](https://github.com/kubernetes-sigs/controller-runtime/blob/v0.2.0/pkg/client/interfaces.go#L104) and [`sigs.k8s.io/controller-runtime/pkg/client.StatusWriter`](https://github.com/kubernetes-sigs/controller-runtime/blob/v0.2.0/pkg/client/interfaces.go#L91) (except for `Client.Get()`) have been updated. Each now uses a variadic option interface parameter typed for each method.
449
+
- `Client.List(ctx context.Context, opts *client.ListOptions, list runtime.Object) error`is now [`Client.List(ctx context.Context, list runtime.Object, opts ...client.ListOption) error`](https://github.com/kubernetes-sigs/controller-runtime/blob/v0.2.0/pkg/client/interfaces.go#L61).
- `Client.Create(ctx context.Context, obj runtime.Object) error`is now [`Client.Create(ctx context.Context, obj runtime.Object, opts ...client.CreateOption) error`](https://github.com/kubernetes-sigs/controller-runtime/blob/v0.2.0/pkg/client/interfaces.go#L67). No updates need to be made. See the [client doc][client-doc] for a discussion of `client.CreateOption`.
464
+
- `Client.Update(ctx context.Context, obj runtime.Object) error`is now [`Client.Update(ctx context.Context, obj runtime.Object, opts ...client.UpdateOption) error`](https://github.com/kubernetes-sigs/controller-runtime/blob/v0.2.0/pkg/client/interfaces.go#L74). No updates need to be made. See the [client doc][client-doc] for a discussion of `client.UpdateOption`.
465
+
- `Client.Delete(ctx context.Context, obj runtime.Object, opts ...DeleteOptionFunc) error`is now [`Client.Delete(ctx context.Context, obj runtime.Object, opts ...DeleteOption) error`](https://github.com/kubernetes-sigs/controller-runtime/blob/v0.2.0/pkg/client/interfaces.go#L70). Although the option interface has changed, the way each `client.DeleteOption` is created is the same as before. No updates need to be made. See the [client doc][client-doc] for a discussion of `client.DeleteOption`.
466
+
- `StatusWriter.Update(ctx context.Context, obj runtime.Object) error`is now [`Update(ctx context.Context, obj runtime.Object, opts ...UpdateOption) error`](https://github.com/kubernetes-sigs/controller-runtime/blob/v0.2.0/pkg/client/interfaces.go#L95). No updates need to be made. See the [client doc][client-doc] for a discussion of `client.UpdateOption`.
467
+
468
+
### Operator SDK updates
469
+
470
+
- [`pkg/test.FrameworkClient`](https://github.com/operator-framework/operator-sdk/blob/947a464/pkg/test/client.go#L33) `List()` and `Delete()` method invocations should be updated to match those of `Client.List()` and `Client.Delete()`, described above.
471
+
- The annotation to assign a scope to your CRD has changed. For the following changes, note that `<resource>` is the plural lower-case CRD Kind found at `spec.names.plural`.
472
+
- For `Namespaced`-scoped operators, add a `+kubebuilder:resource:path=<resource>,scope=Namespaced` comment above your kind type in `pkg/apis/<group>/<version>/<kind>_types.go`.
473
+
- For `Cluster`-scoped operators, replace the `+genclient:nonNamespaced` comment above your kind type in `pkg/apis/<group>/<version>/<kind>_types.go` with `+kubebuilder:resource:path=<resource>,scope=Cluster`.
474
+
- CRD file names now have the form `<full group>_<resource>_crd.yaml`, and CRD file names now have the form `<full group>_<version>_<kind>_cr.yaml`. `<full group>` is the full group name of your CRD found at `spec.group`, and `<resource>` is the plural lower-case CRD Kind found at `spec.names.plural`. To migrate:
475
+
- Run `operator-sdk generate openapi`. CRD manifest files with new names containing versioned validation and subresource blocks will be generated.
476
+
- Delete the old CRD manifest files.
477
+
- Rename CR manifest file names from `<group>_<version>_<kind>_cr.yaml` to `<full group>_<version>_<kind>_cr.yaml`.
0 commit comments