From 4c58281b76b5b054281ff33afb0a3cddc6a8f39f Mon Sep 17 00:00:00 2001 From: Rafael Franzke Date: Wed, 11 Oct 2023 16:21:51 +0200 Subject: [PATCH] [make revendor] --- .../operatingsystemconfig/oscommon/README.md | 82 ------------------- .../operatingsystemconfig/oscommon/add.go | 59 ------------- .../oscommon/cmd/options.go | 37 --------- vendor/modules.txt | 2 - 4 files changed, 180 deletions(-) delete mode 100644 vendor/github.com/gardener/gardener/extensions/pkg/controller/operatingsystemconfig/oscommon/README.md delete mode 100644 vendor/github.com/gardener/gardener/extensions/pkg/controller/operatingsystemconfig/oscommon/add.go delete mode 100644 vendor/github.com/gardener/gardener/extensions/pkg/controller/operatingsystemconfig/oscommon/cmd/options.go diff --git a/vendor/github.com/gardener/gardener/extensions/pkg/controller/operatingsystemconfig/oscommon/README.md b/vendor/github.com/gardener/gardener/extensions/pkg/controller/operatingsystemconfig/oscommon/README.md deleted file mode 100644 index bd092dfb8..000000000 --- a/vendor/github.com/gardener/gardener/extensions/pkg/controller/operatingsystemconfig/oscommon/README.md +++ /dev/null @@ -1,82 +0,0 @@ -# [Gardener Extension for OS Configurations](https://gardener.cloud) - -[![Go Report Card](https://goreportcard.com/badge/github.com/gardener/gardener/extensions/pkg/controller/operatingsystemconfig/oscommon)](https://goreportcard.com/report/github.com/gardener/gardener/extensions/pkg/controller/operatingsystemconfig/oscommon) - -**⚠️This package is deprecated and will be removed as soon as the [`UseGardenerNodeAgent` feature gate](../../../../../docs/deployment/feature_gates.md) has been promoted to GA.** - ---- - -Project Gardener implements the automated management and operation of [Kubernetes](https://kubernetes.io/) clusters as a service. Its main principle is to leverage Kubernetes concepts for all of its tasks. - -Recently, most of the vendor specific logic has been developed [in-tree](https://github.com/gardener/gardener). However, the project has grown to a size where it is very hard to extend, maintain, and test. With [GEP-1](https://github.com/gardener/gardener/blob/master/docs/proposals/01-extensibility.md) we have proposed how the architecture can be changed in a way to support external controllers that contain their very own vendor specifics. This way, we can keep Gardener core clean and independent. - -The `oscommon` offers a generic controller that operates on the `OperatingSystemConfig` resource in the `extensions.gardener.cloud/v1alpha1` API group. It manages those objects that are requesting for an specific operating system. - - -```yaml ---- -apiVersion: extensions.gardener.cloud/v1alpha1 -kind: OperatingSystemConfig -metadata: - name: pool-01-original - namespace: default -spec: - type: - units: - ... - files: - ... -``` - -Please find [a concrete example](example/operatingsystemconfig.yaml) in the `example` folder. - -After reconciliation the resulting data will be stored in a secret within the same namespace (as the config itself might contain confidential data). The name of the secret will be written into the resource's `.status` field: - -```yaml -... -status: - ... - cloudConfig: - secretRef: - name: osc-result-pool-01-original - namespace: default - command: - units: - - docker-monitor.service - - kubelet-monitor.service - - kubelet.service -``` -The secret has one data key `cloud_config` that stores the generation. - -The generation of this operating system representation is executed by a [`Generator`](generator/generator.go). A default implementation for the `generator` based on [go templates](https://golang.org/pkg/text/template/) is provided in [`template`](template). - -In addition, `oscommon` provides set of basic [`tests`](generator/test/README.md) which can be used to test the operating system specific generator. - -Please find more information regarding the extensibility concepts and a detailed proposal [here](https://github.com/gardener/gardener/blob/master/docs/proposals/01-extensibility.md). - ----- - -## How to use oscommon in a new operating system configuration controller - -When implementing a controller for a specific operating system, it is necessary to provide: -* A command line application for launching the controller -* A template for translating the `cloud-config` to the format requried by the operating system. -* Alternatively, a new generator can also be provided, in case the transformations required by -the operating system requires more complex logic than provided by go templates. -* A test that uses the test description provided in [`pkg/generator/test`] -* A directory with test files -* The [`helm`](https://github.com/helm/helm) Chart for operator registration and installation - -Please refer to the [`os-suse-chost controller`](https://github.com/gardener/gardener-extension-os-suse-chost) for a concrete example. - -## Feedback and Support - -Feedback and contributions are always welcome. Please report bugs or suggestions as [GitHub issues](https://github.com/gardener/gardener/issues) or join our [Slack channel #gardener](https://kubernetes.slack.com/messages/gardener) (please invite yourself to the Kubernetes workspace [here](http://slack.k8s.io)). - -## Learn more! - -Please find further resources about out project here: - -* [Our landing page gardener.cloud](https://gardener.cloud/) -* ["Gardener, the Kubernetes Botanist" blog on kubernetes.io](https://kubernetes.io/blog/2018/05/17/gardener/) -* [GEP-1 (Gardener Enhancement Proposal) on extensibility](https://github.com/gardener/gardener/blob/master/docs/proposals/01-extensibility.md) diff --git a/vendor/github.com/gardener/gardener/extensions/pkg/controller/operatingsystemconfig/oscommon/add.go b/vendor/github.com/gardener/gardener/extensions/pkg/controller/operatingsystemconfig/oscommon/add.go deleted file mode 100644 index 816f6a465..000000000 --- a/vendor/github.com/gardener/gardener/extensions/pkg/controller/operatingsystemconfig/oscommon/add.go +++ /dev/null @@ -1,59 +0,0 @@ -// Copyright 2019 SAP SE or an SAP affiliate company. All rights reserved. This file is licensed under the Apache Software License, v. 2 except as noted otherwise in the LICENSE file -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. - -package oscommon - -import ( - "context" - - "sigs.k8s.io/controller-runtime/pkg/controller" - "sigs.k8s.io/controller-runtime/pkg/manager" - - "github.com/gardener/gardener/extensions/pkg/controller/operatingsystemconfig" - "github.com/gardener/gardener/extensions/pkg/controller/operatingsystemconfig/oscommon/actuator" - "github.com/gardener/gardener/extensions/pkg/controller/operatingsystemconfig/oscommon/generator" -) - -// DefaultAddOptions are the default AddOptions for AddToManager. -var DefaultAddOptions = AddOptions{} - -// AddOptions are options to apply when adding the OSC controller to the manager. -type AddOptions struct { - // Controller are the controller.Options. - Controller controller.Options - // IgnoreOperationAnnotation specifies whether to ignore the operation annotation or not. - IgnoreOperationAnnotation bool -} - -// AddToManagerWithOptions adds a controller with the given Options to the given manager. -// The opts.Reconciler is being set with a newly instantiated actuator. -// Deprecated: The `oscommon` package is deprecated and will be removed as soon as the UseGardenerNodeAgent feature gate -// has been promoted to GA. -// TODO(rfranzke): Remove the `oscommon` package after the UseGardenerNodeAgent feature gate has been promoted to GA. -func AddToManagerWithOptions(ctx context.Context, mgr manager.Manager, ctrlName string, osTypes []string, generator generator.Generator, opts AddOptions) error { - return operatingsystemconfig.Add(mgr, operatingsystemconfig.AddArgs{ - Actuator: actuator.NewActuator(mgr, ctrlName, generator), - Predicates: operatingsystemconfig.DefaultPredicates(ctx, mgr, opts.IgnoreOperationAnnotation), - Types: osTypes, - ControllerOptions: opts.Controller, - }) -} - -// AddToManager adds a controller with the default Options. -// Deprecated: The `oscommon` package is deprecated and will be removed as soon as the UseGardenerNodeAgent feature gate -// has been promoted to GA. -// TODO(rfranzke): Remove the `oscommon` package after the UseGardenerNodeAgent feature gate has been promoted to GA. -func AddToManager(ctx context.Context, mgr manager.Manager, ctrlName string, osTypes []string, generator generator.Generator) error { - return AddToManagerWithOptions(ctx, mgr, ctrlName, osTypes, generator, DefaultAddOptions) -} diff --git a/vendor/github.com/gardener/gardener/extensions/pkg/controller/operatingsystemconfig/oscommon/cmd/options.go b/vendor/github.com/gardener/gardener/extensions/pkg/controller/operatingsystemconfig/oscommon/cmd/options.go deleted file mode 100644 index d74d02dca..000000000 --- a/vendor/github.com/gardener/gardener/extensions/pkg/controller/operatingsystemconfig/oscommon/cmd/options.go +++ /dev/null @@ -1,37 +0,0 @@ -// Copyright 2019 SAP SE or an SAP affiliate company. All rights reserved. This file is licensed under the Apache Software License, v. 2 except as noted otherwise in the LICENSE file -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. - -package cmd - -import ( - "context" - - "sigs.k8s.io/controller-runtime/pkg/manager" - - "github.com/gardener/gardener/extensions/pkg/controller/cmd" - extensionsheartbeatcontroller "github.com/gardener/gardener/extensions/pkg/controller/heartbeat" - "github.com/gardener/gardener/extensions/pkg/controller/operatingsystemconfig" - "github.com/gardener/gardener/extensions/pkg/controller/operatingsystemconfig/oscommon" - "github.com/gardener/gardener/extensions/pkg/controller/operatingsystemconfig/oscommon/generator" -) - -// SwitchOptions are the cmd.SwitchOptions for the provider controllers. -func SwitchOptions(ctrlName string, osTypes []string, generator generator.Generator) *cmd.SwitchOptions { - return cmd.NewSwitchOptions( - cmd.Switch(operatingsystemconfig.ControllerName, func(ctx context.Context, mgr manager.Manager) error { - return oscommon.AddToManager(ctx, mgr, ctrlName, osTypes, generator) - }), - cmd.Switch(extensionsheartbeatcontroller.ControllerName, extensionsheartbeatcontroller.AddToManager), - ) -} diff --git a/vendor/modules.txt b/vendor/modules.txt index c5c1af022..ccb29448b 100644 --- a/vendor/modules.txt +++ b/vendor/modules.txt @@ -76,9 +76,7 @@ github.com/gardener/gardener/extensions/pkg/controller/cmd github.com/gardener/gardener/extensions/pkg/controller/heartbeat github.com/gardener/gardener/extensions/pkg/controller/heartbeat/cmd github.com/gardener/gardener/extensions/pkg/controller/operatingsystemconfig -github.com/gardener/gardener/extensions/pkg/controller/operatingsystemconfig/oscommon github.com/gardener/gardener/extensions/pkg/controller/operatingsystemconfig/oscommon/actuator -github.com/gardener/gardener/extensions/pkg/controller/operatingsystemconfig/oscommon/cmd github.com/gardener/gardener/extensions/pkg/controller/operatingsystemconfig/oscommon/generator github.com/gardener/gardener/extensions/pkg/controller/operatingsystemconfig/oscommon/generator/test github.com/gardener/gardener/extensions/pkg/controller/operatingsystemconfig/oscommon/template