Skip to content

Commit

Permalink
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Bump github.com/gardener/gardener@v1.103.0
Browse files Browse the repository at this point in the history
afritzler committed Oct 9, 2024
1 parent 4680dee commit 633244f
Showing 22 changed files with 294 additions and 124 deletions.
4 changes: 2 additions & 2 deletions cmd/gardener-extension-provider-metal/app/app.go
Original file line number Diff line number Diff line change
@@ -188,8 +188,8 @@ func NewControllerManagerCommand(ctx context.Context) *cobra.Command {
heartbeatCtrlOpts.Completed().Apply(&heartbeat.DefaultAddOptions)
infraCtrlOpts.Completed().Apply(&infrastructurecontroller.DefaultAddOptions.Controller)
workerCtrlOpts.Completed().Apply(&workercontroller.DefaultAddOptions.Controller)
reconcileOpts.Completed().Apply(&infrastructurecontroller.DefaultAddOptions.IgnoreOperationAnnotation)
reconcileOpts.Completed().Apply(&workercontroller.DefaultAddOptions.IgnoreOperationAnnotation)
reconcileOpts.Completed().Apply(&infrastructurecontroller.DefaultAddOptions.IgnoreOperationAnnotation, &infrastructurecontroller.DefaultAddOptions.ExtensionClass)
reconcileOpts.Completed().Apply(&workercontroller.DefaultAddOptions.IgnoreOperationAnnotation, &workercontroller.DefaultAddOptions.ExtensionClass)
workercontroller.DefaultAddOptions.GardenCluster = gardenCluster

if _, err := webhookOptions.Completed().AddToManager(ctx, mgr, nil); err != nil {
7 changes: 7 additions & 0 deletions example/20-crd-extensions.gardener.cloud_backupbuckets.yaml
Original file line number Diff line number Diff line change
@@ -61,6 +61,13 @@ spec:
Specification of the BackupBucket.
If the object's deletion timestamp is set, this field is immutable.
properties:
class:
description: Class holds the extension class used to control the responsibility
for multiple provider extensions.
type: string
x-kubernetes-validations:
- message: Value is immutable
rule: self == oldSelf
providerConfig:
description: ProviderConfig is the provider specific configuration.
type: object
7 changes: 7 additions & 0 deletions example/20-crd-extensions.gardener.cloud_backupentries.yaml
Original file line number Diff line number Diff line change
@@ -75,6 +75,13 @@ spec:
description: BucketName is the name of backup bucket for this Backup
Entry.
type: string
class:
description: Class holds the extension class used to control the responsibility
for multiple provider extensions.
type: string
x-kubernetes-validations:
- message: Value is immutable
rule: self == oldSelf
providerConfig:
description: ProviderConfig is the provider specific configuration.
type: object
7 changes: 7 additions & 0 deletions example/20-crd-extensions.gardener.cloud_bastions.yaml
Original file line number Diff line number Diff line change
@@ -56,6 +56,13 @@ spec:
Spec is the specification of this Bastion.
If the object's deletion timestamp is set, this field is immutable.
properties:
class:
description: Class holds the extension class used to control the responsibility
for multiple provider extensions.
type: string
x-kubernetes-validations:
- message: Value is immutable
rule: self == oldSelf
ingress:
description: Ingress controls from where the created bastion host
should be reachable.
Original file line number Diff line number Diff line change
@@ -61,6 +61,13 @@ spec:
description: BinaryPath is the Worker's machine path where container
runtime extensions should copy the binaries to.
type: string
class:
description: Class holds the extension class used to control the responsibility
for multiple provider extensions.
type: string
x-kubernetes-validations:
- message: Value is immutable
rule: self == oldSelf
providerConfig:
description: ProviderConfig is the provider specific configuration.
type: object
7 changes: 7 additions & 0 deletions example/20-crd-extensions.gardener.cloud_controlplanes.yaml
Original file line number Diff line number Diff line change
@@ -60,6 +60,13 @@ spec:
Specification of the ControlPlane.
If the object's deletion timestamp is set, this field is immutable.
properties:
class:
description: Class holds the extension class used to control the responsibility
for multiple provider extensions.
type: string
x-kubernetes-validations:
- message: Value is immutable
rule: self == oldSelf
infrastructureProviderStatus:
description: |-
InfrastructureProviderStatus contains the provider status that has
7 changes: 7 additions & 0 deletions example/20-crd-extensions.gardener.cloud_dnsrecords.yaml
Original file line number Diff line number Diff line change
@@ -62,6 +62,13 @@ spec:
Specification of the DNSRecord.
If the object's deletion timestamp is set, this field is immutable.
properties:
class:
description: Class holds the extension class used to control the responsibility
for multiple provider extensions.
type: string
x-kubernetes-validations:
- message: Value is immutable
rule: self == oldSelf
name:
description: Name is the fully qualified domain name, e.g. "api.<shoot
domain>". This field is immutable.
7 changes: 7 additions & 0 deletions example/20-crd-extensions.gardener.cloud_extensions.yaml
Original file line number Diff line number Diff line change
@@ -56,6 +56,13 @@ spec:
Specification of the Extension.
If the object's deletion timestamp is set, this field is immutable.
properties:
class:
description: Class holds the extension class used to control the responsibility
for multiple provider extensions.
type: string
x-kubernetes-validations:
- message: Value is immutable
rule: self == oldSelf
providerConfig:
description: ProviderConfig is the provider specific configuration.
type: object
7 changes: 7 additions & 0 deletions example/20-crd-extensions.gardener.cloud_infrastructures.yaml
Original file line number Diff line number Diff line change
@@ -60,6 +60,13 @@ spec:
Specification of the Infrastructure.
If the object's deletion timestamp is set, this field is immutable.
properties:
class:
description: Class holds the extension class used to control the responsibility
for multiple provider extensions.
type: string
x-kubernetes-validations:
- message: Value is immutable
rule: self == oldSelf
providerConfig:
description: ProviderConfig is the provider specific configuration.
type: object
7 changes: 7 additions & 0 deletions example/20-crd-extensions.gardener.cloud_networks.yaml
Original file line number Diff line number Diff line change
@@ -62,6 +62,13 @@ spec:
Specification of the Network.
If the object's deletion timestamp is set, this field is immutable.
properties:
class:
description: Class holds the extension class used to control the responsibility
for multiple provider extensions.
type: string
x-kubernetes-validations:
- message: Value is immutable
rule: self == oldSelf
ipFamilies:
description: |-
IPFamilies specifies the IP protocol versions to use for shoot networking. This field is immutable.
117 changes: 115 additions & 2 deletions example/20-crd-extensions.gardener.cloud_operatingsystemconfigs.yaml
Original file line number Diff line number Diff line change
@@ -61,14 +61,127 @@ spec:
Specification of the OperatingSystemConfig.
If the object's deletion timestamp is set, this field is immutable.
properties:
class:
description: Class holds the extension class used to control the responsibility
for multiple provider extensions.
type: string
x-kubernetes-validations:
- message: Value is immutable
rule: self == oldSelf
criConfig:
description: CRI config is a structure contains configurations of
the CRI library
properties:
cgroupDriver:
description: CgroupDriver configures the CRI's cgroup driver.
Supported values are `cgroupfs` or `systemd`.
type: string
containerd:
description: |-
ContainerdConfig is the containerd configuration.
Only to be set for OperatingSystemConfigs with purpose 'reconcile'.
properties:
plugins:
description: Plugins configures the plugins section in containerd's
config.toml.
items:
description: PluginConfig contains configuration values
for the containerd plugins section.
properties:
op:
description: Op is the operation for the given path.
Possible values are 'add' and 'remove', defaults to
'add'.
type: string
path:
description: Path is a list of elements that construct
the path in the plugins section.
items:
type: string
type: array
values:
description: |-
Values are the values configured at the given path. If defined, it is expected as json format:
- A given json object will be put to the given path.
- If not configured, only the table entry to be created.
x-kubernetes-preserve-unknown-fields: true
required:
- path
type: object
type: array
registries:
description: Registries configures the registry hosts for
containerd.
items:
description: RegistryConfig contains registry configuration
options.
properties:
hosts:
description: |-
Hosts are the registry hosts.
It corresponds to the host fields in the `hosts.toml` file, see https://github.com/containerd/containerd/blob/c51463010e0682f76dfdc10edc095e6596e2764b/docs/hosts.md#host-fields-in-the-toml-table-format for more information.
items:
description: RegistryHost contains configuration values
for a registry host.
properties:
caCerts:
description: CACerts are paths to public key certificates
used for TLS.
items:
type: string
type: array
capabilities:
description: |-
Capabilities determine what operations a host is
capable of performing. Defaults to
- pull
- resolve
items:
description: RegistryCapability specifies an
action a client can perform against a registry.
type: string
type: array
url:
description: URL is the endpoint address of the
registry mirror.
type: string
required:
- url
type: object
type: array
readinessProbe:
description: ReadinessProbe determines if host registry
endpoints should be probed before they are added to
the containerd config.
type: boolean
server:
description: |-
Server is the URL to registry server of this upstream.
It corresponds to the server field in the `hosts.toml` file, see https://github.com/containerd/containerd/blob/c51463010e0682f76dfdc10edc095e6596e2764b/docs/hosts.md#server-field for more information.
type: string
upstream:
description: Upstream is the upstream name of the registry.
type: string
required:
- upstream
type: object
type: array
sandboxImage:
description: SandboxImage configures the sandbox image for
containerd.
type: string
required:
- sandboxImage
type: object
name:
description: Name is a mandatory string containing the name of
the CRI library. Supported values are `containerd`.
enum:
- containerd
type: string
x-kubernetes-validations:
- message: Value is immutable
rule: self == oldSelf
required:
- name
type: object
@@ -141,7 +254,7 @@ spec:
permissions:
description: |-
Permissions describes with which permissions the file should get written to the file system.
Should be defaulted to octal 0644.
If no permissions are set, the operating system's defaults are used.
format: int32
type: integer
required:
@@ -355,7 +468,7 @@ spec:
permissions:
description: |-
Permissions describes with which permissions the file should get written to the file system.
Should be defaulted to octal 0644.
If no permissions are set, the operating system's defaults are used.
format: int32
type: integer
required:
11 changes: 10 additions & 1 deletion example/20-crd-extensions.gardener.cloud_workers.yaml
Original file line number Diff line number Diff line change
@@ -58,6 +58,13 @@ spec:
Specification of the Worker.
If the object's deletion timestamp is set, this field is immutable.
properties:
class:
description: Class holds the extension class used to control the responsibility
for multiple provider extensions.
type: string
x-kubernetes-validations:
- message: Value is immutable
rule: self == oldSelf
infrastructureProviderStatus:
description: |-
InfrastructureProviderStatus is a raw extension field that contains the provider status that has
@@ -285,8 +292,10 @@ spec:
UserData is a base64-encoded string that contains the data that is sent to the provider's APIs
when a new machine/VM that is part of this worker pool shall be spawned.
Either this or UserDataSecretRef must be provided.
Deprecated: This field will be removed in future release.
TODO(rfranzke): Remove this field after v1.100 has been released.
TODO(rfranzke): Remove this field after v1.104 has been released.
format: byte
type: string
userDataSecretRef:
53 changes: 27 additions & 26 deletions go.mod
Original file line number Diff line number Diff line change
@@ -7,7 +7,7 @@
github.com/ahmetb/gen-crd-api-reference-docs v0.3.0
github.com/coreos/go-systemd/v22 v22.5.0
github.com/gardener/etcd-druid v0.22.5
github.com/gardener/gardener v1.99.4
github.com/gardener/gardener v1.103.0
github.com/gardener/machine-controller-manager v0.53.1
github.com/go-logr/logr v1.4.2
github.com/ironcore-dev/controller-utils v0.9.3
@@ -20,26 +20,27 @@
go.uber.org/zap v1.27.0
golang.org/x/tools v0.26.0
k8s.io/api v0.30.2
k8s.io/apiextensions-apiserver v0.29.6
k8s.io/apiextensions-apiserver v0.29.8
k8s.io/apimachinery v0.30.2
k8s.io/autoscaler/vertical-pod-autoscaler v1.2.1
k8s.io/client-go v0.29.6
k8s.io/code-generator v0.29.6
k8s.io/component-base v0.29.6
k8s.io/kubelet v0.29.6
k8s.io/utils v0.0.0-20240502163921-fe8a2dddb1d0
sigs.k8s.io/controller-runtime v0.17.5
k8s.io/client-go v0.29.8
k8s.io/code-generator v0.29.8
k8s.io/component-base v0.29.8
k8s.io/kubelet v0.29.8
k8s.io/utils v0.0.0-20240902221715-702e33fdd3c3
sigs.k8s.io/controller-runtime v0.17.6
sigs.k8s.io/controller-tools v0.14.0
)

require (
dario.cat/mergo v1.0.1 // indirect
github.com/BurntSushi/toml v1.3.2 // indirect
github.com/Masterminds/goutils v1.1.1 // indirect
github.com/Masterminds/sprig/v3 v3.2.3 // indirect
github.com/Masterminds/sprig/v3 v3.3.0 // indirect

Check warning on line 39 in go.mod

In Solidarity / Inclusive Language

Match Found

Please consider an alternative to `Master`. Possibilities include: `primary`, `main`, `leader`, `active`, `writer`
Raw output
/master/gi
github.com/andybalholm/brotli v1.1.0 // indirect
github.com/beorn7/perks v1.0.1 // indirect
github.com/blang/semver/v4 v4.0.0 // indirect
github.com/cespare/xxhash/v2 v2.2.0 // indirect
github.com/cespare/xxhash/v2 v2.3.0 // indirect
github.com/cyphar/filepath-securejoin v0.2.4 // indirect
github.com/davecgh/go-spew v1.1.2-0.20180830191138-d8f796af33cc // indirect
github.com/emicklei/go-restful/v3 v3.11.0 // indirect
@@ -49,7 +50,7 @@
github.com/fluent/fluent-operator/v2 v2.9.0 // indirect
github.com/fsnotify/fsnotify v1.7.0 // indirect
github.com/gardener/cert-management v0.15.0 // indirect
github.com/gardener/hvpa-controller/api v0.15.0 // indirect
github.com/gardener/hvpa-controller/api v0.16.0 // indirect
github.com/go-logr/zapr v1.3.0 // indirect
github.com/go-openapi/errors v0.20.4 // indirect
github.com/go-openapi/jsonpointer v0.20.0 // indirect
@@ -69,16 +70,16 @@
github.com/gorilla/websocket v1.5.0 // indirect
github.com/hashicorp/errwrap v1.1.0 // indirect
github.com/hashicorp/go-multierror v1.1.1 // indirect
github.com/huandu/xstrings v1.4.0 // indirect
github.com/huandu/xstrings v1.5.0 // indirect
github.com/imdario/mergo v0.3.16 // indirect
github.com/inconshreveable/mousetrap v1.1.0 // indirect
github.com/josharian/intern v1.0.0 // indirect
github.com/json-iterator/go v1.1.12 // indirect
github.com/klauspost/compress v1.17.9 // indirect
github.com/kubernetes-csi/external-snapshotter/client/v4 v4.2.0 // indirect
github.com/mailru/easyjson v0.7.7 // indirect
github.com/mattn/go-colorable v0.1.13 // indirect
github.com/mattn/go-isatty v0.0.20 // indirect
github.com/matttproud/golang_protobuf_extensions/v2 v2.0.0 // indirect
github.com/mitchellh/copystructure v1.2.0 // indirect
github.com/mitchellh/hashstructure/v2 v2.0.2 // indirect
github.com/mitchellh/reflectwalk v1.0.2 // indirect
@@ -89,44 +90,44 @@
github.com/mxk/go-flowrate v0.0.0-20140419014527-cca7078d478f // indirect
github.com/pkg/errors v0.9.1 // indirect
github.com/prometheus-operator/prometheus-operator/pkg/apis/monitoring v0.74.0 // indirect
github.com/prometheus/client_golang v1.18.0 // indirect
github.com/prometheus/client_model v0.6.0 // indirect
github.com/prometheus/common v0.45.0 // indirect
github.com/prometheus/procfs v0.12.0 // indirect
github.com/prometheus/client_golang v1.20.0 // indirect
github.com/prometheus/client_model v0.6.1 // indirect
github.com/prometheus/common v0.58.0 // indirect
github.com/prometheus/procfs v0.15.1 // indirect
github.com/russross/blackfriday/v2 v2.1.0 // indirect
github.com/shopspring/decimal v1.3.1 // indirect
github.com/shopspring/decimal v1.4.0 // indirect
github.com/spf13/afero v1.11.0 // indirect
github.com/spf13/cast v1.6.0 // indirect
github.com/spf13/cast v1.7.0 // indirect
github.com/xeipuuv/gojsonpointer v0.0.0-20190905194746-02993c407bfb // indirect
github.com/xeipuuv/gojsonreference v0.0.0-20180127040603-bd5ef7bd5415 // indirect
github.com/xeipuuv/gojsonschema v1.2.0 // indirect
go.uber.org/multierr v1.11.0 // indirect
golang.org/x/crypto v0.28.0 // indirect
golang.org/x/exp v0.0.0-20240719175910-8a7402abbf56 // indirect
golang.org/x/exp v0.0.0-20240823005443-9b4947da3948 // indirect
golang.org/x/mod v0.21.0 // indirect
golang.org/x/net v0.30.0 // indirect
golang.org/x/oauth2 v0.20.0 // indirect
golang.org/x/oauth2 v0.22.0 // indirect
golang.org/x/sync v0.8.0 // indirect
golang.org/x/sys v0.26.0 // indirect
golang.org/x/term v0.25.0 // indirect
golang.org/x/text v0.19.0 // indirect
golang.org/x/time v0.5.0 // indirect
golang.org/x/time v0.6.0 // indirect
gomodules.xyz/jsonpatch/v2 v2.4.0 // indirect
google.golang.org/genproto/googleapis/api v0.0.0-20240318140521-94a12d6c2237 // indirect
google.golang.org/protobuf v1.34.1 // indirect
google.golang.org/protobuf v1.34.2 // indirect
gopkg.in/inf.v0 v0.9.1 // indirect
gopkg.in/yaml.v2 v2.4.0 // indirect
gopkg.in/yaml.v3 v3.0.1 // indirect
helm.sh/helm/v3 v3.14.4 // indirect
istio.io/api v1.22.2 // indirect
istio.io/api v1.22.4 // indirect
istio.io/client-go v1.22.0 // indirect
k8s.io/gengo v0.0.0-20230829151522-9cce18d56c01 // indirect
k8s.io/gengo/v2 v2.0.0-20240228010128-51d4e06bde70 // indirect
k8s.io/klog v1.0.0 // indirect
k8s.io/klog/v2 v2.120.1 // indirect
k8s.io/kube-aggregator v0.29.6 // indirect
k8s.io/kube-aggregator v0.29.8 // indirect
k8s.io/kube-openapi v0.0.0-20240228011516-70dd3763d340 // indirect
k8s.io/metrics v0.29.6 // indirect
k8s.io/metrics v0.29.8 // indirect
sigs.k8s.io/json v0.0.0-20221116044647-bc3834ca7abd // indirect
sigs.k8s.io/structured-merge-diff/v4 v4.4.1 // indirect
sigs.k8s.io/yaml v1.4.0 // indirect
141 changes: 58 additions & 83 deletions go.sum

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion imagevector/imagevector.go
Original file line number Diff line number Diff line change
@@ -22,7 +22,7 @@ func init() {
imageVector, err = imagevector.Read([]byte(imagesYAML))
runtime.Must(err)

imageVector, err = imagevector.WithEnvOverride(imageVector)
imageVector, err = imagevector.WithEnvOverride(imageVector, imagevector.OverrideChartsEnv)
runtime.Must(err)
}

2 changes: 1 addition & 1 deletion pkg/admission/validator/shoot.go
Original file line number Diff line number Diff line change
@@ -143,7 +143,7 @@ func newValidationContext(ctx context.Context, decoder runtime.Decoder, c client
}

cloudProfile := &gardencorev1beta1.CloudProfile{}
if err := c.Get(ctx, client.ObjectKey{Name: shoot.Spec.CloudProfileName}, cloudProfile); err != nil {
if err := c.Get(ctx, client.ObjectKey{Name: shoot.Spec.CloudProfile.Name}, cloudProfile); err != nil {
return nil, err
}

4 changes: 2 additions & 2 deletions pkg/apis/metal/helper/scheme.go
Original file line number Diff line number Diff line change
@@ -8,10 +8,10 @@ import (

"github.com/gardener/gardener/extensions/pkg/controller"
extensionsv1alpha1 "github.com/gardener/gardener/pkg/apis/extensions/v1alpha1"
kutil "github.com/gardener/gardener/pkg/utils/kubernetes"
"k8s.io/apimachinery/pkg/runtime"
"k8s.io/apimachinery/pkg/runtime/serializer"
utilruntime "k8s.io/apimachinery/pkg/util/runtime"
"sigs.k8s.io/controller-runtime/pkg/client"

api "github.com/ironcore-dev/gardener-extension-provider-metal/pkg/apis/metal"
"github.com/ironcore-dev/gardener-extension-provider-metal/pkg/apis/metal/install"
@@ -67,7 +67,7 @@ func CloudProfileConfigFromCluster(cluster *controller.Cluster) (*api.CloudProfi
if cluster != nil && cluster.CloudProfile != nil && cluster.CloudProfile.Spec.ProviderConfig != nil && cluster.CloudProfile.Spec.ProviderConfig.Raw != nil {
cloudProfileConfig = &api.CloudProfileConfig{}
if _, _, err := decoder.Decode(cluster.CloudProfile.Spec.ProviderConfig.Raw, nil, cloudProfileConfig); err != nil {
return nil, fmt.Errorf("could not decode providerConfig of cloudProfile for '%s': %w", kutil.ObjectName(cluster.CloudProfile), err)
return nil, fmt.Errorf("could not decode providerConfig of cloudProfile for '%s': %w", client.ObjectKeyFromObject(cluster.CloudProfile), err)
}
}
return cloudProfileConfig, nil
4 changes: 2 additions & 2 deletions pkg/controller/controlplane/valuesprovider.go
Original file line number Diff line number Diff line change
@@ -190,7 +190,7 @@ func (vp *valuesProvider) GetControlPlaneChartValues(
cpConfig := &apismetal.ControlPlaneConfig{}
if cp.Spec.ProviderConfig != nil {
if _, _, err := vp.decoder.Decode(cp.Spec.ProviderConfig.Raw, nil, cpConfig); err != nil {
return nil, fmt.Errorf("could not decode providerConfig of controlplane '%s': %w", kutil.ObjectName(cp), err)
return nil, fmt.Errorf("could not decode providerConfig of controlplane '%s': %w", client.ObjectKeyFromObject(cp), err)
}
}

@@ -211,7 +211,7 @@ func (vp *valuesProvider) GetControlPlaneShootChartValues(
cpConfig := &apismetal.ControlPlaneConfig{}
if cp.Spec.ProviderConfig != nil {
if _, _, err := vp.decoder.Decode(cp.Spec.ProviderConfig.Raw, nil, cpConfig); err != nil {
return nil, fmt.Errorf("could not decode providerConfig of controlplane '%s': %w", kutil.ObjectName(cp), err)
return nil, fmt.Errorf("could not decode providerConfig of controlplane '%s': %w", client.ObjectKeyFromObject(cp), err)
}
}
return vp.getControlPlaneShootChartValues(cluster, cpConfig)
5 changes: 5 additions & 0 deletions pkg/controller/infrastructure/add.go
Original file line number Diff line number Diff line change
@@ -6,6 +6,8 @@ package infrastructure
import (
"context"

extensionsv1alpha1 "github.com/gardener/gardener/pkg/apis/extensions/v1alpha1"

"github.com/gardener/gardener/extensions/pkg/controller/infrastructure"
"sigs.k8s.io/controller-runtime/pkg/controller"
"sigs.k8s.io/controller-runtime/pkg/log"
@@ -25,6 +27,8 @@ type AddOptions struct {
Controller controller.Options
// IgnoreOperationAnnotation specifies whether to ignore the operation annotation or not.
IgnoreOperationAnnotation bool
// ExtensionClass defines the extension class this extension is responsible for.
ExtensionClass extensionsv1alpha1.ExtensionClass
}

// AddToManagerWithOptions adds a controller with the given AddOptions to the given manager.
@@ -36,6 +40,7 @@ func AddToManagerWithOptions(ctx context.Context, mgr manager.Manager, opts AddO
ControllerOptions: opts.Controller,
Predicates: infrastructure.DefaultPredicates(ctx, mgr, opts.IgnoreOperationAnnotation),
Type: metal.Type,
ExtensionClass: opts.ExtensionClass,
})
}

5 changes: 5 additions & 0 deletions pkg/controller/worker/add.go
Original file line number Diff line number Diff line change
@@ -6,6 +6,8 @@ package worker
import (
"context"

extensionsv1alpha1 "github.com/gardener/gardener/pkg/apis/extensions/v1alpha1"

"github.com/gardener/gardener/extensions/pkg/controller/worker"
machinev1alpha1 "github.com/gardener/machine-controller-manager/pkg/apis/machine/v1alpha1"
apiextensionsscheme "k8s.io/apiextensions-apiserver/pkg/client/clientset/clientset/scheme"
@@ -33,6 +35,8 @@ type AddOptions struct {
// IgnoreOperationAnnotation specifies whether to ignore the operation annotation or not.
IgnoreOperationAnnotation bool
RecoverPanic *bool
// ExtensionClass defines the extension class this extension is responsible for.
ExtensionClass extensionsv1alpha1.ExtensionClass
}

// AddToManagerWithOptions adds a controller with the given Options to the given manager.
@@ -51,6 +55,7 @@ func AddToManagerWithOptions(ctx context.Context, mgr manager.Manager, opts AddO
ControllerOptions: opts.Controller,
Predicates: worker.DefaultPredicates(ctx, mgr, opts.IgnoreOperationAnnotation),
Type: metal.Type,
ExtensionClass: opts.ExtensionClass,
})
}

5 changes: 2 additions & 3 deletions pkg/controller/worker/machine_images.go
Original file line number Diff line number Diff line change
@@ -9,7 +9,6 @@ import (

"github.com/gardener/gardener/extensions/pkg/controller/worker"
v1beta1constants "github.com/gardener/gardener/pkg/apis/core/v1beta1/constants"
kutil "github.com/gardener/gardener/pkg/utils/kubernetes"
metav1 "k8s.io/apimachinery/pkg/apis/meta/v1"
"k8s.io/apimachinery/pkg/runtime"
"k8s.io/utils/ptr"
@@ -60,7 +59,7 @@ func (w *workerDelegate) findMachineImage(name, version string, architecture *st
if providerStatus := w.worker.Status.ProviderStatus; providerStatus != nil {
workerStatus := &apiv1alpha1.WorkerStatus{}
if _, _, err := w.decoder.Decode(providerStatus.Raw, nil, workerStatus); err != nil {
return "", fmt.Errorf("could not decode worker status of worker '%s': %w", kutil.ObjectName(w.worker), err)
return "", fmt.Errorf("could not decode worker status of worker '%s': %w", client.ObjectKeyFromObject(w.worker), err)
}

machineImage, err := helper.FindMachineImage(workerStatus.MachineImages, name, version, architecture)
@@ -89,7 +88,7 @@ func (w *workerDelegate) decodeWorkerProviderStatus() (*apiv1alpha1.WorkerStatus
}

if _, _, err := w.decoder.Decode(w.worker.Status.ProviderStatus.Raw, nil, workerStatus); err != nil {
return nil, fmt.Errorf("could not decode WorkerStatus '%s': %w", kutil.ObjectName(w.worker), err)
return nil, fmt.Errorf("could not decode WorkerStatus '%s': %w", client.ObjectKeyFromObject(w.worker), err)
}

return workerStatus, nil
2 changes: 1 addition & 1 deletion pkg/webhook/controlplane/ensurer_test.go
Original file line number Diff line number Diff line change
@@ -243,7 +243,7 @@ var _ = Describe("Ensurer", func() {
ensurer = NewEnsurer(logger, true)
DeferCleanup(testutils.WithVar(&ImageVector, imagevectorutils.ImageVector{{
Name: "machine-controller-manager-provider-metal",
Repository: "foo",
Repository: ptr.To("foo"),
Tag: ptr.To[string]("bar"),
}}))
})

0 comments on commit 633244f

Please sign in to comment.