Skip to content

Commit

Permalink
fix add options extension class
Browse files Browse the repository at this point in the history
  • Loading branch information
ushabelgur committed Sep 17, 2024
1 parent 146734b commit d016e0f
Show file tree
Hide file tree
Showing 7 changed files with 25 additions and 7 deletions.
10 changes: 5 additions & 5 deletions cmd/gardener-extension-provider-ironcore/app/app.go
Original file line number Diff line number Diff line change
Expand Up @@ -214,11 +214,11 @@ func NewControllerManagerCommand(ctx context.Context) *cobra.Command {
bastionCtrlOpts.Completed().Apply(&bastioncontroller.DefaultAddOptions.Controller)
backupBucketCtrlOpts.Completed().Apply(&backupbucketcontroller.DefaultAddOptions.Controller)
backupEntryCtrlOpts.Completed().Apply(&backupentrycontroller.DefaultAddOptions.Controller)
reconcileOpts.Completed().Apply(&bastioncontroller.DefaultAddOptions.IgnoreOperationAnnotation, nil)
reconcileOpts.Completed().Apply(&infrastructurecontroller.DefaultAddOptions.IgnoreOperationAnnotation, nil)
reconcileOpts.Completed().Apply(&workercontroller.DefaultAddOptions.IgnoreOperationAnnotation, nil)
reconcileOpts.Completed().Apply(&backupbucketcontroller.DefaultAddOptions.IgnoreOperationAnnotation, nil)
reconcileOpts.Completed().Apply(&backupentrycontroller.DefaultAddOptions.IgnoreOperationAnnotation, nil)
reconcileOpts.Completed().Apply(&bastioncontroller.DefaultAddOptions.IgnoreOperationAnnotation, &bastioncontroller.DefaultAddOptions.ExtensionClass)
reconcileOpts.Completed().Apply(&infrastructurecontroller.DefaultAddOptions.IgnoreOperationAnnotation, &infrastructurecontroller.DefaultAddOptions.ExtensionClass)
reconcileOpts.Completed().Apply(&workercontroller.DefaultAddOptions.IgnoreOperationAnnotation, &workercontroller.DefaultAddOptions.ExtensionClass)
reconcileOpts.Completed().Apply(&backupbucketcontroller.DefaultAddOptions.IgnoreOperationAnnotation, &backupbucketcontroller.DefaultAddOptions.ExtensionClass)
reconcileOpts.Completed().Apply(&backupentrycontroller.DefaultAddOptions.IgnoreOperationAnnotation, &backupentrycontroller.DefaultAddOptions.ExtensionClass)
workercontroller.DefaultAddOptions.GardenCluster = gardenCluster

if _, err := webhookOptions.Completed().AddToManager(ctx, mgr, nil); err != nil {
Expand Down
2 changes: 0 additions & 2 deletions go.sum
Original file line number Diff line number Diff line change
Expand Up @@ -400,8 +400,6 @@ golang.org/x/crypto v0.0.0-20210921155107-089bfa567519/go.mod h1:GvvjBRRGRdwPK5y
golang.org/x/crypto v0.3.0/go.mod h1:hebNnKkNXi2UzZN1eVRvBB7co0a+JxK6XbPiWVs/3J4=
golang.org/x/crypto v0.26.0 h1:RrRspgV4mU+YwB4FYnuBoKsUapNIL5cohGAmSH3azsw=
golang.org/x/crypto v0.26.0/go.mod h1:GY7jblb9wI+FOo5y8/S2oY4zWP07AkOJ4+jxCqdqn54=
golang.org/x/crypto v0.26.0 h1:RrRspgV4mU+YwB4FYnuBoKsUapNIL5cohGAmSH3azsw=
golang.org/x/crypto v0.26.0/go.mod h1:GY7jblb9wI+FOo5y8/S2oY4zWP07AkOJ4+jxCqdqn54=
golang.org/x/exp v0.0.0-20190121172915-509febef88a4/go.mod h1:CJ0aWSM057203Lf6IL+f9T1iT9GByDxfZKAQTCR3kQA=
golang.org/x/exp v0.0.0-20190306152737-a1d7652674e8/go.mod h1:CJ0aWSM057203Lf6IL+f9T1iT9GByDxfZKAQTCR3kQA=
golang.org/x/exp v0.0.0-20190510132918-efd6b22b2522/go.mod h1:ZjyILWgesfNpC6sMxTJOJm9Kp84zZh5NQWvqDGG3Qr8=
Expand Down
4 changes: 4 additions & 0 deletions pkg/controller/backupbucket/add.go
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@ import (
"context"

"github.com/gardener/gardener/extensions/pkg/controller/backupbucket"
extensionsv1alpha1 "github.com/gardener/gardener/pkg/apis/extensions/v1alpha1"
"sigs.k8s.io/controller-runtime/pkg/controller"
"sigs.k8s.io/controller-runtime/pkg/manager"

Expand All @@ -27,6 +28,8 @@ type AddOptions struct {
IgnoreOperationAnnotation bool
// BackupBucketConfig contains config for the BackupBucket config.
BackupBucketConfig controllerconfig.BackupBucketConfig
// 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.
Expand All @@ -37,6 +40,7 @@ func AddToManagerWithOptions(ctx context.Context, mgr manager.Manager, opts AddO
ControllerOptions: opts.Controller,
Predicates: backupbucket.DefaultPredicates(opts.IgnoreOperationAnnotation),
Type: ironcore.Type,
ExtensionClass: opts.ExtensionClass,
})
}

Expand Down
4 changes: 4 additions & 0 deletions pkg/controller/backupentry/add.go
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@ import (

"github.com/gardener/gardener/extensions/pkg/controller/backupentry"
"github.com/gardener/gardener/extensions/pkg/controller/backupentry/genericactuator"
extensionsv1alpha1 "github.com/gardener/gardener/pkg/apis/extensions/v1alpha1"
"sigs.k8s.io/controller-runtime/pkg/controller"
"sigs.k8s.io/controller-runtime/pkg/manager"

Expand All @@ -25,6 +26,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 Options to the given manager.
Expand All @@ -35,6 +38,7 @@ func AddToManagerWithOptions(ctx context.Context, mgr manager.Manager, opts AddO
ControllerOptions: opts.Controller,
Predicates: backupentry.DefaultPredicates(opts.IgnoreOperationAnnotation),
Type: ironcore.Type,
ExtensionClass: opts.ExtensionClass,
})
}

Expand Down
4 changes: 4 additions & 0 deletions pkg/controller/bastion/add.go
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@ import (
"context"

"github.com/gardener/gardener/extensions/pkg/controller/bastion"
extensionsv1alpha1 "github.com/gardener/gardener/pkg/apis/extensions/v1alpha1"
"sigs.k8s.io/controller-runtime/pkg/controller"
"sigs.k8s.io/controller-runtime/pkg/log"
"sigs.k8s.io/controller-runtime/pkg/manager"
Expand All @@ -28,6 +29,8 @@ type AddOptions struct {
IgnoreOperationAnnotation bool
// BastionConfig contains config for the Bastion config.
BastionConfig controllerconfig.BastionConfig
// 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.
Expand All @@ -39,6 +42,7 @@ func AddToManagerWithOptions(mgr manager.Manager, opts AddOptions) error {
ControllerOptions: opts.Controller,
Predicates: bastion.DefaultPredicates(opts.IgnoreOperationAnnotation),
Type: ironcore.Type,
ExtensionClass: opts.ExtensionClass,
})
}

Expand Down
4 changes: 4 additions & 0 deletions pkg/controller/infrastructure/add.go
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@ import (
"context"

"github.com/gardener/gardener/extensions/pkg/controller/infrastructure"
extensionsv1alpha1 "github.com/gardener/gardener/pkg/apis/extensions/v1alpha1"
"sigs.k8s.io/controller-runtime/pkg/controller"
"sigs.k8s.io/controller-runtime/pkg/log"
"sigs.k8s.io/controller-runtime/pkg/manager"
Expand All @@ -25,6 +26,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.
Expand All @@ -36,6 +39,7 @@ func AddToManagerWithOptions(ctx context.Context, mgr manager.Manager, opts AddO
ControllerOptions: opts.Controller,
Predicates: infrastructure.DefaultPredicates(ctx, mgr, opts.IgnoreOperationAnnotation),
Type: ironcore.Type,
ExtensionClass: opts.ExtensionClass,
})
}

Expand Down
4 changes: 4 additions & 0 deletions pkg/controller/worker/add.go
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@ import (
"context"

"github.com/gardener/gardener/extensions/pkg/controller/worker"
extensionsv1alpha1 "github.com/gardener/gardener/pkg/apis/extensions/v1alpha1"
machinev1alpha1 "github.com/gardener/machine-controller-manager/pkg/apis/machine/v1alpha1"
apiextensionsscheme "k8s.io/apiextensions-apiserver/pkg/client/clientset/clientset/scheme"
"k8s.io/utils/ptr"
Expand All @@ -33,6 +34,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.
Expand All @@ -51,6 +54,7 @@ func AddToManagerWithOptions(ctx context.Context, mgr manager.Manager, opts AddO
ControllerOptions: opts.Controller,
Predicates: worker.DefaultPredicates(ctx, mgr, opts.IgnoreOperationAnnotation),
Type: ironcore.Type,
ExtensionClass: opts.ExtensionClass,
})
}

Expand Down

0 comments on commit d016e0f

Please sign in to comment.