v0.46.0
What Changed in this Release
This release contains several bugfixes for API servers, including fixes to route naming and conversion, as well as enhancements to informer operation.
Breaking Changes
simple package changes
ErrorHandler has moved out of simple.AppInformerConfig and into the operator.InformerOptions in simple.AppInformerConfig.InformerOptions. Example fix:
cfg := simple.AppConfig{
Name: "myapp",
KubeConfig: cfg.KubeConfig,
InformerConfig: simple.AppInformerConfig{
ErrorHandler: func(ctx context.Context, err error) {
logging.FromContext(ctx).With("error", err).Error("Informer processing error")
},
},
ManagedKinds: managedKinds,
}to
cfg := simple.AppConfig{
Name: "myapp",
KubeConfig: cfg.KubeConfig,
InformerConfig: simple.AppInformerConfig{
InformerOptions: operator.InformerOptions{
ErrorHandler: func(ctx context.Context, err error) {
logging.FromContext(ctx).With("error", err).Error("Informer processing error")
},
},
},
ManagedKinds: managedKinds,
}simple.InformerSupplier's signature has changed, from
type InformerSupplier func(
kind resource.Kind, clients resource.ClientGenerator, options operator.ListWatchOptions,
) (operator.Informer, error)to
type InformerSupplier func(
kind resource.Kind, clients resource.ClientGenerator, options operator.InformerOptions,
) (operator.Informer, error)operator.ListWatchOptions can be found in operator.InformerOptions.ListWatchOptions, this new signature now exposes more config to be passed into the supplier.
Codegen changes
Custom route codegen now automatically produces go types which are compatible with kubernetes' runtime.Object. This also means that generated custom route responses now contain metav1.TypeMeta fields, which expose apiVersion and kind in their response data. This may break API contracts, so it can be turned off (or can be disabled for any other reason) by adding
responseMetadata: typeMeta: falsealongside your response in the custom route. See this PR for more details on configuring kubernetes response metadata.
Custom route response go type filenames have also changed from (<kind>_)<routename>_types_gen.go to (<kind>_)<routename>_response_(object|body)_types_gen.go. Regenerating code may end up with duplicate types between the file with the old name and the one with the new name. Files with the old naming scheme should be deleted.
Changelog
- bba9b39 Add EventTimeout option and use contextual
cache.ListWatchmethods (#895) - fa67af1 Bump the all group in /plugin with 2 updates (#996)
- 03318a5 Bump the all group with 2 updates (#995)
- dfc817c Update cog to 0.0.41 (#998)
- e50a1e5 [APIServer] Fix conversion handling and PreferredVersion (#1001)
- 4f939f8 [AppManifest] Add apiVersion, kind, metadata, and spec as required fields when calling AsKubeOpenAPI (#1000)
- b394bb9 [codegen/apiserver] Fix Custom Routes Naming (#1003)
- 42a0d05 [codegen] Add Kubernetes Metadata to Custom Route Responses (#983)
- 8806623 [codegen] Prefix custom route go request types (#1002)