From dc831615a7a6438588ae959e03f7702db753b0e9 Mon Sep 17 00:00:00 2001
From: Sujeet Packages:
- Package v1alpha1 contains the onmetal provider API resources. Package v1alpha1 contains the ironcore provider API resources.
-onmetal.provider.extensions.gardener.cloud/v1alpha1
+ironcore.provider.extensions.gardener.cloud/v1alpha1
CloudProfileConfig contains provider-specific configuration that is embedded into Gardener’s CloudProfile
@@ -36,7 +36,7 @@ resource.
-onmetal.provider.extensions.gardener.cloud/v1alpha1
+ironcore.provider.extensions.gardener.cloud/v1alpha1
machineImages
-
+
[]MachineImages
@@ -65,7 +65,7 @@ logical names and versions to provider-specific identifiers.
regionConfigs
-
+
[]RegionConfig
@@ -78,7 +78,7 @@ logical names and versions to provider-specific identifiers.
storageClasses
-
+
StorageClasses
@@ -90,7 +90,7 @@ StorageClasses
-
ControlPlaneConfig contains configuration settings for the control plane.
@@ -109,7 +109,7 @@ StorageClasses string
-onmetal.provider.extensions.gardener.cloud/v1alpha1
+ironcore.provider.extensions.gardener.cloud/v1alpha1
cloudControllerManager
-
+
CloudControllerManagerConfig
@@ -136,7 +136,7 @@ CloudControllerManagerConfig
-
InfrastructureConfig infrastructure configuration resource
@@ -155,7 +155,7 @@ CloudControllerManagerConfig string
-onmetal.provider.extensions.gardener.cloud/v1alpha1
+ironcore.provider.extensions.gardener.cloud/v1alpha1
(Appears on: -ControlPlaneConfig) +ControlPlaneConfig)
CloudControllerManagerConfig contains configuration settings for the cloud-controller-manager.
@@ -212,7 +212,7 @@ map[string]bool -
InfrastructureStatus contains information about created infrastructure resources.
@@ -229,8 +229,8 @@ map[string]boolnetworkRef
-
-github.com/onmetal/onmetal-api/api/common/v1alpha1.LocalUIDReference
+
+github.com/ironcore-dev/ironcore/api/common/v1alpha1.LocalUIDReference
natGatewayRef
-
-github.com/onmetal/onmetal-api/api/common/v1alpha1.LocalUIDReference
+
+github.com/ironcore-dev/ironcore/api/common/v1alpha1.LocalUIDReference
prefixRef
-
-github.com/onmetal/onmetal-api/api/common/v1alpha1.LocalUIDReference
+
+github.com/ironcore-dev/ironcore/api/common/v1alpha1.LocalUIDReference
(Appears on: -WorkerStatus) +WorkerStatus)
-
MachineImage is a mapping from logical names and versions to onmetal-specific identifiers.
+MachineImage is a mapping from logical names and versions to ironcore-specific identifiers.
(Appears on: -MachineImages) +MachineImages)
MachineImageVersion contains a version and a provider-specific identifier.
@@ -383,11 +383,11 @@ string -(Appears on: -CloudProfileConfig) +CloudProfileConfig)
MachineImages is a mapping from logical names and versions to provider-specific identifiers.
@@ -415,7 +415,7 @@ stringversions
-
+
[]MachineImageVersion
@@ -426,11 +426,11 @@ string
-(Appears on: -CloudProfileConfig) +CloudProfileConfig)
RegionConfig is the definition of a region.
@@ -478,11 +478,11 @@ string -(Appears on: -StorageClasses) +StorageClasses)
StorageClass is a definition of a storageClass
@@ -519,11 +519,11 @@ string -(Appears on: -CloudProfileConfig) +CloudProfileConfig)
StorageClasses is a definition of a storageClasses
@@ -540,7 +540,7 @@ stringdefault
-
+
StorageClass
@@ -554,7 +554,7 @@ StorageClass
additional
-
+
[]StorageClass
@@ -566,7 +566,7 @@ StorageClass
-
WorkerStatus contains information about created worker resources.
@@ -583,7 +583,7 @@ StorageClassmachineImages
-
+
[]MachineImage
diff --git a/hack/api-reference/config.md b/hack/api-reference/config.md
index 042a20b2..4f178abe 100644
--- a/hack/api-reference/config.md
+++ b/hack/api-reference/config.md
@@ -1,21 +1,21 @@
Packages:
-
Package v1alpha1 contains the onmetal provider configuration API resources.
+Package v1alpha1 contains the ironcore provider configuration API resources.
Resource Types: --
ControllerConfiguration defines the configuration for the onmetal provider.
+ControllerConfiguration defines the configuration for the ironcore provider.
-onmetal.provider.extensions.config.gardener.cloud/v1alpha1
+ironcore.provider.extensions.config.gardener.cloud/v1alpha1
|
@@ -61,7 +61,7 @@ settings for the proxy server to use when communicating with the apiserver.
etcd
-
+
ETCD
@@ -102,7 +102,7 @@ Default: nil
|
bastionConfig
-
+
BastionConfig
@@ -116,7 +116,7 @@ BastionConfig
|
backupBucketConfig
-
+
BackupBucketConfig
@@ -127,11 +127,11 @@ BackupBucketConfig
|
(Appears on: -ControllerConfiguration) +ControllerConfiguration)
BackupBucketConfig is config for Backup Bucket
@@ -152,16 +152,16 @@ stringBucketClassName is the name of the onmetal BucketClass to use for the BackupBucket
+BucketClassName is the name of the ironcore BucketClass to use for the BackupBucket
(Appears on: -ControllerConfiguration) +ControllerConfiguration)
BastionConfig is the config for the Bastion
@@ -193,7 +193,7 @@ stringMachineClassName is the name of the onmetal MachineClass to use for the Bastion host
+MachineClassName is the name of the ironcore MachineClass to use for the Bastion host
VolumeClassName is the name of the onmetal VolumeClass to use for the Bastion host root disk volume
+VolumeClassName is the name of the ironcore VolumeClass to use for the Bastion host root disk volume
(Appears on: -ControllerConfiguration) +ControllerConfiguration)
ETCD is an etcd configuration.
@@ -230,7 +230,7 @@ stringstorage
-
+
ETCDStorage
@@ -243,7 +243,7 @@ ETCDStorage
backup
-
+
ETCDBackup
@@ -254,11 +254,11 @@ ETCDBackup
-
ETCDBackup is an etcd backup configuration.
@@ -285,11 +285,11 @@ string -
ETCDStorage is an etcd storage configuration.
diff --git a/hack/api-reference/template/tools.go b/hack/api-reference/template/tools.go index ade632cc..321c2137 100644 --- a/hack/api-reference/template/tools.go +++ b/hack/api-reference/template/tools.go @@ -1,4 +1,4 @@ -// Copyright 2023 OnMetal authors +// Copyright 2023 IronCore authors // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. diff --git a/hack/boilerplate.go.txt b/hack/boilerplate.go.txt index e5a66c44..285c20fb 100644 --- a/hack/boilerplate.go.txt +++ b/hack/boilerplate.go.txt @@ -1,5 +1,5 @@ /* - * Copyright (c) 2021 by the OnMetal authors. + * Copyright (c) 2021 by the IronCore authors. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/hack/dev-setup-admission-onmetal.sh b/hack/dev-setup-admission-ironcore.sh similarity index 92% rename from hack/dev-setup-admission-onmetal.sh rename to hack/dev-setup-admission-ironcore.sh index ede9a52e..e55e5f1c 100755 --- a/hack/dev-setup-admission-onmetal.sh +++ b/hack/dev-setup-admission-ironcore.sh @@ -16,8 +16,8 @@ is_nodeless() { IP_ROUTE=$(ip route get 1) IP_ADDRESS=$(echo ${IP_ROUTE#*src} | awk '{print $1}') -ADMISSION_SERVICE_NAME="gardener-extension-admission-onmetal" -ADMISSION_ENDPOINT_NAME="gardener-extension-admission-onmetal" +ADMISSION_SERVICE_NAME="gardener-extension-admission-ironcore" +ADMISSION_ENDPOINT_NAME="gardener-extension-admission-ironcore" ADMISSION_EXTERNAL_NAME=gardener.localhost if [[ "$(uname -s)" == *"Darwin"* ]] || [[ "$(uname -s)" == "Linux" && "$(uname -r)" =~ "microsoft-standard" ]] ; then diff --git a/hack/update-codegen.sh b/hack/update-codegen.sh index 2c4c04c8..a2162e5e 100755 --- a/hack/update-codegen.sh +++ b/hack/update-codegen.sh @@ -65,7 +65,7 @@ echo "Generating ${blue}deepcopy${normal}" "$DEEPCOPY_GEN" \ --output-base "$GOPATH/src" \ --go-header-file "$SCRIPT_DIR/boilerplate.go.txt" \ - --input-dirs "$(qualify-gvs "github.com/onmetal/gardener-extension-provider-onmetal/pkg/apis" "config:v1alpha1 onmetal:v1alpha1")" \ + --input-dirs "$(qualify-gvs "github.com/ironcore-dev/gardener-extension-provider-ironcore/pkg/apis" "config:v1alpha1 ironcore:v1alpha1")" \ -O zz_generated.deepcopy echo "${bold}Internal types${normal}" @@ -74,20 +74,20 @@ echo "Generating ${blue}deepcopy${normal}" "$DEEPCOPY_GEN" \ --output-base "$GOPATH/src" \ --go-header-file "$SCRIPT_DIR/boilerplate.go.txt" \ - --input-dirs "$(qualify-gs "github.com/onmetal/gardener-extension-provider-onmetal/pkg/apis" "config onmetal")" \ + --input-dirs "$(qualify-gs "github.com/ironcore-dev/gardener-extension-provider-ironcore/pkg/apis" "config ironcore")" \ -O zz_generated.deepcopy echo "Generating ${blue}defaulter${normal}" "$DEFAULTER_GEN" \ --output-base "$GOPATH/src" \ --go-header-file "$SCRIPT_DIR/boilerplate.go.txt" \ - --input-dirs "$(qualify-gvs "github.com/onmetal/gardener-extension-provider-onmetal/pkg/apis" "config:v1alpha1 onmetal:v1alpha1")" \ + --input-dirs "$(qualify-gvs "github.com/ironcore-dev/gardener-extension-provider-ironcore/pkg/apis" "config:v1alpha1 ironcore:v1alpha1")" \ -O zz_generated.defaults echo "Generating ${blue}conversion${normal}" "$CONVERSION_GEN" \ --output-base "$GOPATH/src" \ --go-header-file "$SCRIPT_DIR/boilerplate.go.txt" \ - --input-dirs "$(qualify-gs "github.com/onmetal/gardener-extension-provider-onmetal/pkg/apis" "config onmetal")" \ - --input-dirs "$(qualify-gvs "github.com/onmetal/gardener-extension-provider-onmetal/pkg/apis" "config:v1alpha1 onmetal:v1alpha1")" \ + --input-dirs "$(qualify-gs "github.com/ironcore-dev/gardener-extension-provider-ironcore/pkg/apis" "config ironcore")" \ + --input-dirs "$(qualify-gvs "github.com/ironcore-dev/gardener-extension-provider-ironcore/pkg/apis" "config:v1alpha1 ironcore:v1alpha1")" \ -O zz_generated.conversion diff --git a/hack/update-github-templates.sh b/hack/update-github-templates.sh index b66ea88f..a5ed3965 100755 --- a/hack/update-github-templates.sh +++ b/hack/update-github-templates.sh @@ -12,6 +12,6 @@ for file in `find "$(dirname $0)"/../vendor/github.com/gardener/gardener/.github sed 's/to the Gardener project/for this extension/g' |\ sed 's/to Gardener/to this extension/g' |\ sed 's/- Gardener version:/- Gardener version (if relevant):\n- Extension version:/g' |\ - sed 's/\/kind [a-zA-Z]*/&\n\/platform onmetal/g' \ + sed 's/\/kind [a-zA-Z]*/&\n\/platform ironcore/g' \ > "$(dirname $0)/../.github/${file#*.github/}" done diff --git a/pkg/admission/cmd/options.go b/pkg/admission/cmd/options.go index 066ca5fd..0e29ef42 100644 --- a/pkg/admission/cmd/options.go +++ b/pkg/admission/cmd/options.go @@ -1,4 +1,4 @@ -// Copyright 2022 OnMetal authors +// Copyright 2022 IronCore authors // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. @@ -17,7 +17,7 @@ package cmd import ( webhookcmd "github.com/gardener/gardener/extensions/pkg/webhook/cmd" - "github.com/onmetal/gardener-extension-provider-onmetal/pkg/admission/validator" + "github.com/ironcore-dev/gardener-extension-provider-ironcore/pkg/admission/validator" ) // GardenWebhookSwitchOptions are the webhookcmd.SwitchOptions for the admission webhooks. diff --git a/pkg/admission/decode.go b/pkg/admission/decode.go index e18fb41d..4f1a723d 100644 --- a/pkg/admission/decode.go +++ b/pkg/admission/decode.go @@ -1,4 +1,4 @@ -// Copyright 2022 OnMetal authors +// Copyright 2022 IronCore authors // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. @@ -16,14 +16,13 @@ package admission import ( "github.com/gardener/gardener/extensions/pkg/util" + ironcore "github.com/ironcore-dev/gardener-extension-provider-ironcore/pkg/apis/ironcore" "k8s.io/apimachinery/pkg/runtime" - - "github.com/onmetal/gardener-extension-provider-onmetal/pkg/apis/onmetal" ) // DecodeControlPlaneConfig decodes the `ControlPlaneConfig` from the given `RawExtension`. -func DecodeControlPlaneConfig(decoder runtime.Decoder, cp *runtime.RawExtension) (*onmetal.ControlPlaneConfig, error) { - controlPlaneConfig := &onmetal.ControlPlaneConfig{} +func DecodeControlPlaneConfig(decoder runtime.Decoder, cp *runtime.RawExtension) (*ironcore.ControlPlaneConfig, error) { + controlPlaneConfig := &ironcore.ControlPlaneConfig{} if err := util.Decode(decoder, cp.Raw, controlPlaneConfig); err != nil { return nil, err } @@ -32,8 +31,8 @@ func DecodeControlPlaneConfig(decoder runtime.Decoder, cp *runtime.RawExtension) } // DecodeInfrastructureConfig decodes the `InfrastructureConfig` from the given `RawExtension`. -func DecodeInfrastructureConfig(decoder runtime.Decoder, infra *runtime.RawExtension) (*onmetal.InfrastructureConfig, error) { - infraConfig := &onmetal.InfrastructureConfig{} +func DecodeInfrastructureConfig(decoder runtime.Decoder, infra *runtime.RawExtension) (*ironcore.InfrastructureConfig, error) { + infraConfig := &ironcore.InfrastructureConfig{} if err := util.Decode(decoder, infra.Raw, infraConfig); err != nil { return nil, err } diff --git a/pkg/admission/validator/secret.go b/pkg/admission/validator/secret.go index 236df735..03845406 100644 --- a/pkg/admission/validator/secret.go +++ b/pkg/admission/validator/secret.go @@ -1,4 +1,4 @@ -// Copyright 2022 OnMetal authors +// Copyright 2022 IronCore authors // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. @@ -23,7 +23,7 @@ import ( "k8s.io/apimachinery/pkg/api/equality" "sigs.k8s.io/controller-runtime/pkg/client" - onmetalvalidation "github.com/onmetal/gardener-extension-provider-onmetal/pkg/apis/onmetal/validation" + ironcorevalidation "github.com/ironcore-dev/gardener-extension-provider-ironcore/pkg/apis/ironcore/validation" ) type secret struct{} @@ -33,7 +33,7 @@ func NewSecretValidator() extensionswebhook.Validator { return &secret{} } -// Validate checks whether the given new secret contains a valid onmetal service account. +// Validate checks whether the given new secret contains a valid ironcore service account. func (s *secret) Validate(_ context.Context, newObj, oldObj client.Object) error { secret, ok := newObj.(*corev1.Secret) if !ok { @@ -51,5 +51,5 @@ func (s *secret) Validate(_ context.Context, newObj, oldObj client.Object) error } } - return onmetalvalidation.ValidateCloudProviderSecret(secret) + return ironcorevalidation.ValidateCloudProviderSecret(secret) } diff --git a/pkg/admission/validator/secretbinding.go b/pkg/admission/validator/secretbinding.go index 33fc3625..8505a649 100644 --- a/pkg/admission/validator/secretbinding.go +++ b/pkg/admission/validator/secretbinding.go @@ -1,4 +1,4 @@ -// Copyright 2022 OnMetal authors +// Copyright 2022 IronCore authors // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. @@ -27,7 +27,7 @@ import ( "k8s.io/apimachinery/pkg/api/equality" "sigs.k8s.io/controller-runtime/pkg/client" - onmetalvalidation "github.com/onmetal/gardener-extension-provider-onmetal/pkg/apis/onmetal/validation" + ironcorevalidation "github.com/ironcore-dev/gardener-extension-provider-ironcore/pkg/apis/ironcore/validation" ) type secretBinding struct { @@ -41,7 +41,7 @@ func NewSecretBindingValidator(mgr manager.Manager) extensionswebhook.Validator } } -// Validate checks whether the given SecretBinding refers to a Secret with a valid onmetal service account. +// Validate checks whether the given SecretBinding refers to a Secret with a valid ironcore service account. func (sb *secretBinding) Validate(ctx context.Context, newObj, oldObj client.Object) error { secretBinding, ok := newObj.(*core.SecretBinding) if !ok { @@ -70,5 +70,5 @@ func (sb *secretBinding) Validate(ctx context.Context, newObj, oldObj client.Obj return err } - return onmetalvalidation.ValidateCloudProviderSecret(secret) + return ironcorevalidation.ValidateCloudProviderSecret(secret) } diff --git a/pkg/admission/validator/secretbinding_test.go b/pkg/admission/validator/secretbinding_test.go index 5935e4c2..6d39e4e0 100644 --- a/pkg/admission/validator/secretbinding_test.go +++ b/pkg/admission/validator/secretbinding_test.go @@ -1,4 +1,4 @@ -// Copyright 2022 OnMetal authors +// Copyright 2022 IronCore authors // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. @@ -22,7 +22,7 @@ import ( "github.com/gardener/gardener/pkg/apis/core" mockclient "github.com/gardener/gardener/pkg/mock/controller-runtime/client" mockmanager "github.com/gardener/gardener/pkg/mock/controller-runtime/manager" - "github.com/onmetal/gardener-extension-provider-onmetal/pkg/admission/validator" + "github.com/ironcore-dev/gardener-extension-provider-ironcore/pkg/admission/validator" . "github.com/onsi/ginkgo/v2" . "github.com/onsi/gomega" "go.uber.org/mock/gomock" diff --git a/pkg/admission/validator/shoot.go b/pkg/admission/validator/shoot.go index 3040ee37..cc26387d 100644 --- a/pkg/admission/validator/shoot.go +++ b/pkg/admission/validator/shoot.go @@ -1,4 +1,4 @@ -// Copyright 2022 OnMetal authors +// Copyright 2022 IronCore authors // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. @@ -23,9 +23,9 @@ import ( "github.com/gardener/gardener/pkg/apis/core" gardencorev1beta1 "github.com/gardener/gardener/pkg/apis/core/v1beta1" kutil "github.com/gardener/gardener/pkg/utils/kubernetes" - "github.com/onmetal/gardener-extension-provider-onmetal/pkg/admission" - apisonmetal "github.com/onmetal/gardener-extension-provider-onmetal/pkg/apis/onmetal" - onmetalvalidation "github.com/onmetal/gardener-extension-provider-onmetal/pkg/apis/onmetal/validation" + "github.com/ironcore-dev/gardener-extension-provider-ironcore/pkg/admission" + apisironcore "github.com/ironcore-dev/gardener-extension-provider-ironcore/pkg/apis/ironcore" + ironcorevalidation "github.com/ironcore-dev/gardener-extension-provider-ironcore/pkg/apis/ironcore/validation" "k8s.io/apimachinery/pkg/runtime" "k8s.io/apimachinery/pkg/runtime/serializer" "k8s.io/apimachinery/pkg/util/validation/field" @@ -77,8 +77,8 @@ var ( type validationContext struct { shoot *core.Shoot - infrastructureConfig *apisonmetal.InfrastructureConfig - controlPlaneConfig *apisonmetal.ControlPlaneConfig + infrastructureConfig *apisironcore.InfrastructureConfig + controlPlaneConfig *apisironcore.ControlPlaneConfig cloudProfile *gardencorev1beta1.CloudProfile } @@ -87,10 +87,10 @@ func (s *shoot) validateContext(valContext *validationContext) field.ErrorList { allErrors = field.ErrorList{} ) - allErrors = append(allErrors, onmetalvalidation.ValidateNetworking(valContext.shoot.Spec.Networking, networkPath)...) - allErrors = append(allErrors, onmetalvalidation.ValidateInfrastructureConfig(valContext.infrastructureConfig, valContext.shoot.Spec.Networking.Nodes, valContext.shoot.Spec.Networking.Pods, valContext.shoot.Spec.Networking.Services, infrastructureConfigPath)...) - allErrors = append(allErrors, onmetalvalidation.ValidateWorkers(valContext.shoot.Spec.Provider.Workers, workersPath)...) - allErrors = append(allErrors, onmetalvalidation.ValidateControlPlaneConfig(valContext.controlPlaneConfig, valContext.shoot.Spec.Kubernetes.Version, controlPlaneConfigPath)...) + allErrors = append(allErrors, ironcorevalidation.ValidateNetworking(valContext.shoot.Spec.Networking, networkPath)...) + allErrors = append(allErrors, ironcorevalidation.ValidateInfrastructureConfig(valContext.infrastructureConfig, valContext.shoot.Spec.Networking.Nodes, valContext.shoot.Spec.Networking.Pods, valContext.shoot.Spec.Networking.Services, infrastructureConfigPath)...) + allErrors = append(allErrors, ironcorevalidation.ValidateWorkers(valContext.shoot.Spec.Provider.Workers, workersPath)...) + allErrors = append(allErrors, ironcorevalidation.ValidateControlPlaneConfig(valContext.controlPlaneConfig, valContext.shoot.Spec.Kubernetes.Version, controlPlaneConfigPath)...) return allErrors } @@ -122,14 +122,14 @@ func (s *shoot) validateUpdate(ctx context.Context, oldShoot, currentShoot *core ) if !reflect.DeepEqual(oldInfrastructureConfig, currentInfrastructureConfig) { - allErrors = append(allErrors, onmetalvalidation.ValidateInfrastructureConfigUpdate(oldInfrastructureConfig, currentInfrastructureConfig, infrastructureConfigPath)...) + allErrors = append(allErrors, ironcorevalidation.ValidateInfrastructureConfigUpdate(oldInfrastructureConfig, currentInfrastructureConfig, infrastructureConfigPath)...) } if !reflect.DeepEqual(oldControlPlaneConfig, currentControlPlaneConfig) { - allErrors = append(allErrors, onmetalvalidation.ValidateControlPlaneConfigUpdate(oldControlPlaneConfig, currentControlPlaneConfig, controlPlaneConfigPath)...) + allErrors = append(allErrors, ironcorevalidation.ValidateControlPlaneConfigUpdate(oldControlPlaneConfig, currentControlPlaneConfig, controlPlaneConfigPath)...) } - allErrors = append(allErrors, onmetalvalidation.ValidateWorkersUpdate(oldValContext.shoot.Spec.Provider.Workers, currentValContext.shoot.Spec.Provider.Workers, workersPath)...) + allErrors = append(allErrors, ironcorevalidation.ValidateWorkersUpdate(oldValContext.shoot.Spec.Provider.Workers, currentValContext.shoot.Spec.Provider.Workers, workersPath)...) allErrors = append(allErrors, s.validateContext(currentValContext)...) return allErrors.ToAggregate() @@ -138,7 +138,7 @@ func (s *shoot) validateUpdate(ctx context.Context, oldShoot, currentShoot *core func newValidationContext(ctx context.Context, decoder runtime.Decoder, c client.Client, shoot *core.Shoot) (*validationContext, error) { if shoot.Spec.Provider.InfrastructureConfig == nil { - return nil, field.Required(infrastructureConfigPath, "infrastructureConfig must be set for onmetal shoots") + return nil, field.Required(infrastructureConfigPath, "infrastructureConfig must be set for ironcore shoots") } infrastructureConfig, err := admission.DecodeInfrastructureConfig(decoder, shoot.Spec.Provider.InfrastructureConfig) if err != nil { @@ -146,7 +146,7 @@ func newValidationContext(ctx context.Context, decoder runtime.Decoder, c client } if shoot.Spec.Provider.ControlPlaneConfig == nil { - return nil, field.Required(controlPlaneConfigPath, "controlPlaneConfig must be set for onmetal shoots") + return nil, field.Required(controlPlaneConfigPath, "controlPlaneConfig must be set for ironcore shoots") } controlPlaneConfig, err := admission.DecodeControlPlaneConfig(decoder, shoot.Spec.Provider.ControlPlaneConfig) if err != nil { diff --git a/pkg/admission/validator/validator_suite_test.go b/pkg/admission/validator/validator_suite_test.go index b312e931..e23a2f11 100644 --- a/pkg/admission/validator/validator_suite_test.go +++ b/pkg/admission/validator/validator_suite_test.go @@ -1,4 +1,4 @@ -// Copyright 2022 OnMetal authors +// Copyright 2022 IronCore authors // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. diff --git a/pkg/admission/validator/webhook.go b/pkg/admission/validator/webhook.go index a8efbe0b..5dd562ac 100644 --- a/pkg/admission/validator/webhook.go +++ b/pkg/admission/validator/webhook.go @@ -1,4 +1,4 @@ -// Copyright 2022 OnMetal authors +// Copyright 2022 IronCore authors // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. @@ -23,7 +23,7 @@ import ( "sigs.k8s.io/controller-runtime/pkg/manager" "sigs.k8s.io/controller-runtime/pkg/predicate" - "github.com/onmetal/gardener-extension-provider-onmetal/pkg/onmetal" + ironcore "github.com/ironcore-dev/gardener-extension-provider-ironcore/pkg/ironcore" ) const ( @@ -33,17 +33,17 @@ const ( SecretsValidatorName = "secrets." + Name ) -var logger = log.Log.WithName("onmetal-validator-webhook") +var logger = log.Log.WithName("ironcore-validator-webhook") // New creates a new validation webhook for `core.gardener.cloud` resources. func New(mgr manager.Manager) (*extensionswebhook.Webhook, error) { logger.Info("Setting up webhook", "name", Name) return extensionswebhook.New(mgr, extensionswebhook.Args{ - Provider: onmetal.Type, + Provider: ironcore.Type, Name: Name, Path: "/webhooks/validate", - Predicates: []predicate.Predicate{extensionspredicate.GardenCoreProviderType(onmetal.Type)}, + Predicates: []predicate.Predicate{extensionspredicate.GardenCoreProviderType(ironcore.Type)}, Validators: map[extensionswebhook.Validator][]extensionswebhook.Type{ NewShootValidator(mgr): {{Obj: &core.Shoot{}}}, NewSecretBindingValidator(mgr): {{Obj: &core.SecretBinding{}}}, @@ -56,7 +56,7 @@ func NewSecretsWebhook(mgr manager.Manager) (*extensionswebhook.Webhook, error) logger.Info("Setting up webhook", "name", SecretsValidatorName) return extensionswebhook.New(mgr, extensionswebhook.Args{ - Provider: onmetal.Type, + Provider: ironcore.Type, Name: SecretsValidatorName, Path: "/webhooks/validate/secrets", Validators: map[extensionswebhook.Validator][]extensionswebhook.Type{ diff --git a/pkg/apis/config/doc.go b/pkg/apis/config/doc.go index 00b15f3f..fb71cde3 100644 --- a/pkg/apis/config/doc.go +++ b/pkg/apis/config/doc.go @@ -1,4 +1,4 @@ -// Copyright 2022 OnMetal authors +// Copyright 2022 IronCore authors // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. @@ -13,6 +13,6 @@ // limitations under the License. // +k8s:deepcopy-gen=package -// +groupName="onmetal.provider.extensions.config.gardener.cloud" +// +groupName="ironcore.provider.extensions.config.gardener.cloud" -package config // import "github.com/onmetal/gardener-extension-provider-onmetal/pkg/apis/config" +package config // import "github.com/ironcore-dev/gardener-extension-provider-ironcore/pkg/apis/config" diff --git a/pkg/apis/config/install/install.go b/pkg/apis/config/install/install.go index 147a3193..3379fa54 100644 --- a/pkg/apis/config/install/install.go +++ b/pkg/apis/config/install/install.go @@ -1,4 +1,4 @@ -// Copyright 2022 OnMetal authors +// Copyright 2022 IronCore authors // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. @@ -18,8 +18,8 @@ import ( "k8s.io/apimachinery/pkg/runtime" utilruntime "k8s.io/apimachinery/pkg/util/runtime" - "github.com/onmetal/gardener-extension-provider-onmetal/pkg/apis/config" - "github.com/onmetal/gardener-extension-provider-onmetal/pkg/apis/config/v1alpha1" + "github.com/ironcore-dev/gardener-extension-provider-ironcore/pkg/apis/config" + "github.com/ironcore-dev/gardener-extension-provider-ironcore/pkg/apis/config/v1alpha1" ) var ( diff --git a/pkg/apis/config/loader/loader.go b/pkg/apis/config/loader/loader.go index c54db5e8..ca4b5c7c 100644 --- a/pkg/apis/config/loader/loader.go +++ b/pkg/apis/config/loader/loader.go @@ -1,4 +1,4 @@ -// Copyright 2022 OnMetal authors +// Copyright 2022 IronCore authors // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. @@ -22,8 +22,8 @@ import ( "k8s.io/apimachinery/pkg/runtime/serializer/json" "k8s.io/apimachinery/pkg/runtime/serializer/versioning" - "github.com/onmetal/gardener-extension-provider-onmetal/pkg/apis/config" - "github.com/onmetal/gardener-extension-provider-onmetal/pkg/apis/config/install" + "github.com/ironcore-dev/gardener-extension-provider-ironcore/pkg/apis/config" + "github.com/ironcore-dev/gardener-extension-provider-ironcore/pkg/apis/config/install" ) var ( diff --git a/pkg/apis/config/register.go b/pkg/apis/config/register.go index 1b4b9c75..fb603cd3 100644 --- a/pkg/apis/config/register.go +++ b/pkg/apis/config/register.go @@ -1,4 +1,4 @@ -// Copyright 2022 OnMetal authors +// Copyright 2022 IronCore authors // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. @@ -20,7 +20,7 @@ import ( ) // GroupName is the group name use in this package -const GroupName = "onmetal.provider.extensions.config.gardener.cloud" +const GroupName = "ironcore.provider.extensions.config.gardener.cloud" // SchemeGroupVersion is group version used to register these objects var SchemeGroupVersion = schema.GroupVersion{Group: GroupName, Version: runtime.APIVersionInternal} diff --git a/pkg/apis/config/types.go b/pkg/apis/config/types.go index 7333f2ef..901499da 100644 --- a/pkg/apis/config/types.go +++ b/pkg/apis/config/types.go @@ -1,4 +1,4 @@ -// Copyright 2022 OnMetal authors +// Copyright 2022 IronCore authors // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. @@ -23,7 +23,7 @@ import ( // +k8s:deepcopy-gen:interfaces=k8s.io/apimachinery/pkg/runtime.Object -// ControllerConfiguration defines the configuration for the onmetal provider. +// ControllerConfiguration defines the configuration for the ironcore provider. type ControllerConfiguration struct { metav1.TypeMeta @@ -70,14 +70,14 @@ type ETCDBackup struct { type BastionConfig struct { // Image is the URL pointing to an OCI registry containing the operating system image which should be used to boot the Bastion host Image string - // MachineClassName is the name of the onmetal MachineClass to use for the Bastion host + // MachineClassName is the name of the ironcore MachineClass to use for the Bastion host MachineClassName string - // VolumeClassName is the name of the onmetal VolumeClass to use for the Bastion host root disk volume + // VolumeClassName is the name of the ironcore VolumeClass to use for the Bastion host root disk volume VolumeClassName string } // BackupBucketConfig is config for Backup Bucket type BackupBucketConfig struct { - // BucketClassName is the name of the onmetal BucketClass to use for the BackupBucket + // BucketClassName is the name of the ironcore BucketClass to use for the BackupBucket BucketClassName string } diff --git a/pkg/apis/config/v1alpha1/defaults.go b/pkg/apis/config/v1alpha1/defaults.go index a966d984..f2570b91 100644 --- a/pkg/apis/config/v1alpha1/defaults.go +++ b/pkg/apis/config/v1alpha1/defaults.go @@ -1,4 +1,4 @@ -// Copyright 2022 OnMetal authors +// Copyright 2022 IronCore authors // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. diff --git a/pkg/apis/config/v1alpha1/doc.go b/pkg/apis/config/v1alpha1/doc.go index 7c02f6cd..292282b1 100644 --- a/pkg/apis/config/v1alpha1/doc.go +++ b/pkg/apis/config/v1alpha1/doc.go @@ -1,4 +1,4 @@ -// Copyright 2022 OnMetal authors +// Copyright 2022 IronCore authors // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. @@ -13,10 +13,10 @@ // limitations under the License. // +k8s:deepcopy-gen=package -// +k8s:conversion-gen=github.com/onmetal/gardener-extension-provider-onmetal/pkg/apis/config +// +k8s:conversion-gen=github.com/ironcore-dev/gardener-extension-provider-ironcore/pkg/apis/config // +k8s:openapi-gen=true // +k8s:defaulter-gen=TypeMeta -// Package v1alpha1 contains the onmetal provider configuration API resources. -// +groupName= onmetal.provider.extensions.config.gardener.cloud -package v1alpha1 // import "github.com/onmetal/gardener-extension-provider-onmetal/pkg/apis/config/v1alpha1" +// Package v1alpha1 contains the ironcore provider configuration API resources. +// +groupName= ironcore.provider.extensions.config.gardener.cloud +package v1alpha1 // import "github.com/ironcore-dev/gardener-extension-provider-ironcore/pkg/apis/config/v1alpha1" diff --git a/pkg/apis/config/v1alpha1/register.go b/pkg/apis/config/v1alpha1/register.go index a240714b..b83a1ab5 100644 --- a/pkg/apis/config/v1alpha1/register.go +++ b/pkg/apis/config/v1alpha1/register.go @@ -1,4 +1,4 @@ -// Copyright 2022 OnMetal authors +// Copyright 2022 IronCore authors // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. @@ -20,7 +20,7 @@ import ( ) // GroupName is the group name use in this package -const GroupName = "onmetal.provider.extensions.config.gardener.cloud" +const GroupName = "ironcore.provider.extensions.config.gardener.cloud" // SchemeGroupVersion is group version used to register these objects var SchemeGroupVersion = schema.GroupVersion{Group: GroupName, Version: "v1alpha1"} diff --git a/pkg/apis/config/v1alpha1/types.go b/pkg/apis/config/v1alpha1/types.go index 9b9099a0..59e8d979 100644 --- a/pkg/apis/config/v1alpha1/types.go +++ b/pkg/apis/config/v1alpha1/types.go @@ -1,4 +1,4 @@ -// Copyright 2022 OnMetal authors +// Copyright 2022 IronCore authors // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. @@ -24,7 +24,7 @@ import ( // +genclient // +k8s:deepcopy-gen:interfaces=k8s.io/apimachinery/pkg/runtime.Object -// ControllerConfiguration defines the configuration for the onmetal provider. +// ControllerConfiguration defines the configuration for the ironcore provider. type ControllerConfiguration struct { metav1.TypeMeta `json:",inline"` @@ -78,14 +78,14 @@ type ETCDBackup struct { type BastionConfig struct { // Image is the URL pointing to an OCI registry containing the operating system image which should be used to boot the Bastion host Image string `json:"image,omitempty"` - // MachineClassName is the name of the onmetal MachineClass to use for the Bastion host + // MachineClassName is the name of the ironcore MachineClass to use for the Bastion host MachineClassName string `json:"machineClassName,omitempty"` - // VolumeClassName is the name of the onmetal VolumeClass to use for the Bastion host root disk volume + // VolumeClassName is the name of the ironcore VolumeClass to use for the Bastion host root disk volume VolumeClassName string `json:"volumeClassName,omitempty"` } // BackupBucketConfig is config for Backup Bucket type BackupBucketConfig struct { - // BucketClassName is the name of the onmetal BucketClass to use for the BackupBucket + // BucketClassName is the name of the ironcore BucketClass to use for the BackupBucket BucketClassName string `json:"bucketClassName,omitempty"` } diff --git a/pkg/apis/config/v1alpha1/zz_generated.conversion.go b/pkg/apis/config/v1alpha1/zz_generated.conversion.go index fb61b1fa..f8b5785d 100644 --- a/pkg/apis/config/v1alpha1/zz_generated.conversion.go +++ b/pkg/apis/config/v1alpha1/zz_generated.conversion.go @@ -2,7 +2,7 @@ // +build !ignore_autogenerated /* - * Copyright (c) 2021 by the OnMetal authors. + * Copyright (c) 2021 by the IronCore authors. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -25,7 +25,7 @@ import ( apisconfig "github.com/gardener/gardener/extensions/pkg/apis/config" apisconfigv1alpha1 "github.com/gardener/gardener/extensions/pkg/apis/config/v1alpha1" - config "github.com/onmetal/gardener-extension-provider-onmetal/pkg/apis/config" + config "github.com/ironcore-dev/gardener-extension-provider-ironcore/pkg/apis/config" resource "k8s.io/apimachinery/pkg/api/resource" conversion "k8s.io/apimachinery/pkg/conversion" runtime "k8s.io/apimachinery/pkg/runtime" diff --git a/pkg/apis/config/v1alpha1/zz_generated.deepcopy.go b/pkg/apis/config/v1alpha1/zz_generated.deepcopy.go index 1b7b41e2..d0519ac6 100644 --- a/pkg/apis/config/v1alpha1/zz_generated.deepcopy.go +++ b/pkg/apis/config/v1alpha1/zz_generated.deepcopy.go @@ -2,7 +2,7 @@ // +build !ignore_autogenerated /* - * Copyright (c) 2021 by the OnMetal authors. + * Copyright (c) 2021 by the IronCore authors. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/pkg/apis/config/v1alpha1/zz_generated.defaults.go b/pkg/apis/config/v1alpha1/zz_generated.defaults.go index eed1d793..1e1afc5e 100644 --- a/pkg/apis/config/v1alpha1/zz_generated.defaults.go +++ b/pkg/apis/config/v1alpha1/zz_generated.defaults.go @@ -2,7 +2,7 @@ // +build !ignore_autogenerated /* - * Copyright (c) 2021 by the OnMetal authors. + * Copyright (c) 2021 by the IronCore authors. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/pkg/apis/config/zz_generated.deepcopy.go b/pkg/apis/config/zz_generated.deepcopy.go index a3d08e4b..6af4f77e 100644 --- a/pkg/apis/config/zz_generated.deepcopy.go +++ b/pkg/apis/config/zz_generated.deepcopy.go @@ -2,7 +2,7 @@ // +build !ignore_autogenerated /* - * Copyright (c) 2021 by the OnMetal authors. + * Copyright (c) 2021 by the IronCore authors. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/pkg/apis/onmetal/doc.go b/pkg/apis/ironcore/doc.go similarity index 75% rename from pkg/apis/onmetal/doc.go rename to pkg/apis/ironcore/doc.go index 82ded3fd..d258982f 100644 --- a/pkg/apis/onmetal/doc.go +++ b/pkg/apis/ironcore/doc.go @@ -1,4 +1,4 @@ -// Copyright 2022 OnMetal authors +// Copyright 2022 IronCore authors // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. @@ -13,8 +13,8 @@ // limitations under the License. // +k8s:deepcopy-gen=package -// +groupName="onmetal.provider.extensions.gardener.cloud" +// +groupName="ironcore.provider.extensions.gardener.cloud" //go:generate ../../../hack/update-codegen.sh -package onmetal // import "github.com/onmetal/gardener-extension-provider-onmetal/pkg/apis/onmetal" +package ironcore // import "github.com/ironcore-dev/gardener-extension-provider-ironcore/pkg/apis/ironcore" diff --git a/pkg/apis/onmetal/helper/scheme.go b/pkg/apis/ironcore/helper/scheme.go similarity index 91% rename from pkg/apis/onmetal/helper/scheme.go rename to pkg/apis/ironcore/helper/scheme.go index 9843954c..f3bc6e32 100644 --- a/pkg/apis/onmetal/helper/scheme.go +++ b/pkg/apis/ironcore/helper/scheme.go @@ -1,4 +1,4 @@ -// Copyright 2022 OnMetal authors +// Copyright 2022 IronCore authors // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. @@ -24,12 +24,12 @@ import ( "k8s.io/apimachinery/pkg/runtime/serializer" utilruntime "k8s.io/apimachinery/pkg/util/runtime" - api "github.com/onmetal/gardener-extension-provider-onmetal/pkg/apis/onmetal" - "github.com/onmetal/gardener-extension-provider-onmetal/pkg/apis/onmetal/install" + api "github.com/ironcore-dev/gardener-extension-provider-ironcore/pkg/apis/ironcore" + "github.com/ironcore-dev/gardener-extension-provider-ironcore/pkg/apis/ironcore/install" ) var ( - // Scheme is a scheme with the types relevant for onmetal actuators. + // Scheme is a scheme with the types relevant for ironcore actuators. Scheme *runtime.Scheme decoder runtime.Decoder diff --git a/pkg/apis/onmetal/install/install.go b/pkg/apis/ironcore/install/install.go similarity index 82% rename from pkg/apis/onmetal/install/install.go rename to pkg/apis/ironcore/install/install.go index 035c687e..0eaecc6f 100644 --- a/pkg/apis/onmetal/install/install.go +++ b/pkg/apis/ironcore/install/install.go @@ -1,4 +1,4 @@ -// Copyright 2022 OnMetal authors +// Copyright 2022 IronCore authors // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. @@ -18,14 +18,14 @@ import ( "k8s.io/apimachinery/pkg/runtime" utilruntime "k8s.io/apimachinery/pkg/util/runtime" - "github.com/onmetal/gardener-extension-provider-onmetal/pkg/apis/onmetal" - "github.com/onmetal/gardener-extension-provider-onmetal/pkg/apis/onmetal/v1alpha1" + "github.com/ironcore-dev/gardener-extension-provider-ironcore/pkg/apis/ironcore" + "github.com/ironcore-dev/gardener-extension-provider-ironcore/pkg/apis/ironcore/v1alpha1" ) var ( schemeBuilder = runtime.NewSchemeBuilder( v1alpha1.AddToScheme, - onmetal.AddToScheme, + ironcore.AddToScheme, setVersionPriority, ) diff --git a/pkg/apis/onmetal/register.go b/pkg/apis/ironcore/register.go similarity index 93% rename from pkg/apis/onmetal/register.go rename to pkg/apis/ironcore/register.go index 3190b4d0..80e19570 100644 --- a/pkg/apis/onmetal/register.go +++ b/pkg/apis/ironcore/register.go @@ -1,4 +1,4 @@ -// Copyright 2022 OnMetal authors +// Copyright 2022 IronCore authors // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. @@ -12,7 +12,7 @@ // See the License for the specific language governing permissions and // limitations under the License. -package onmetal +package ironcore import ( "k8s.io/apimachinery/pkg/runtime" @@ -20,7 +20,7 @@ import ( ) // GroupName is the group name use in this package -const GroupName = "onmetal.provider.extensions.gardener.cloud" +const GroupName = "ironcore.provider.extensions.gardener.cloud" // SchemeGroupVersion is group version used to register these objects var SchemeGroupVersion = schema.GroupVersion{Group: GroupName, Version: runtime.APIVersionInternal} diff --git a/pkg/apis/onmetal/types_cloudprofile.go b/pkg/apis/ironcore/types_cloudprofile.go similarity index 98% rename from pkg/apis/onmetal/types_cloudprofile.go rename to pkg/apis/ironcore/types_cloudprofile.go index f446ec42..c3c71682 100644 --- a/pkg/apis/onmetal/types_cloudprofile.go +++ b/pkg/apis/ironcore/types_cloudprofile.go @@ -1,4 +1,4 @@ -// Copyright 2022 OnMetal authors +// Copyright 2022 IronCore authors // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. @@ -12,7 +12,7 @@ // See the License for the specific language governing permissions and // limitations under the License. -package onmetal +package ironcore import ( metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" diff --git a/pkg/apis/onmetal/types_controlplane.go b/pkg/apis/ironcore/types_controlplane.go similarity index 95% rename from pkg/apis/onmetal/types_controlplane.go rename to pkg/apis/ironcore/types_controlplane.go index 8adbf678..0e9b8316 100644 --- a/pkg/apis/onmetal/types_controlplane.go +++ b/pkg/apis/ironcore/types_controlplane.go @@ -1,4 +1,4 @@ -// Copyright 2022 OnMetal authors +// Copyright 2022 IronCore authors // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. @@ -12,7 +12,7 @@ // See the License for the specific language governing permissions and // limitations under the License. -package onmetal +package ironcore import ( metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" diff --git a/pkg/apis/onmetal/types_infrastructure.go b/pkg/apis/ironcore/types_infrastructure.go similarity index 94% rename from pkg/apis/onmetal/types_infrastructure.go rename to pkg/apis/ironcore/types_infrastructure.go index ba0fe635..3c61a193 100644 --- a/pkg/apis/onmetal/types_infrastructure.go +++ b/pkg/apis/ironcore/types_infrastructure.go @@ -12,10 +12,10 @@ // See the License for the specific language governing permissions and // limitations under the License. -package onmetal +package ironcore import ( - commonv1alpha1 "github.com/onmetal/onmetal-api/api/common/v1alpha1" + commonv1alpha1 "github.com/ironcore-dev/ironcore/api/common/v1alpha1" corev1 "k8s.io/api/core/v1" metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" ) diff --git a/pkg/apis/onmetal/types_worker.go b/pkg/apis/ironcore/types_worker.go similarity index 97% rename from pkg/apis/onmetal/types_worker.go rename to pkg/apis/ironcore/types_worker.go index c52ceb5b..a38cade3 100644 --- a/pkg/apis/onmetal/types_worker.go +++ b/pkg/apis/ironcore/types_worker.go @@ -12,7 +12,7 @@ // See the License for the specific language governing permissions and // limitations under the License. -package onmetal +package ironcore import ( metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" @@ -33,7 +33,7 @@ type WorkerStatus struct { MachineImages []MachineImage } -// MachineImage is a mapping from logical names and versions to onmetal-specific identifiers. +// MachineImage is a mapping from logical names and versions to ironcore-specific identifiers. type MachineImage struct { // Name is the logical name of the machine image. Name string diff --git a/pkg/apis/onmetal/v1alpha1/defaults.go b/pkg/apis/ironcore/v1alpha1/defaults.go similarity index 95% rename from pkg/apis/onmetal/v1alpha1/defaults.go rename to pkg/apis/ironcore/v1alpha1/defaults.go index a966d984..f2570b91 100644 --- a/pkg/apis/onmetal/v1alpha1/defaults.go +++ b/pkg/apis/ironcore/v1alpha1/defaults.go @@ -1,4 +1,4 @@ -// Copyright 2022 OnMetal authors +// Copyright 2022 IronCore authors // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. diff --git a/pkg/apis/onmetal/v1alpha1/doc.go b/pkg/apis/ironcore/v1alpha1/doc.go similarity index 63% rename from pkg/apis/onmetal/v1alpha1/doc.go rename to pkg/apis/ironcore/v1alpha1/doc.go index 4566bd83..94f18791 100644 --- a/pkg/apis/onmetal/v1alpha1/doc.go +++ b/pkg/apis/ironcore/v1alpha1/doc.go @@ -1,4 +1,4 @@ -// Copyright 2022 OnMetal authors +// Copyright 2022 IronCore authors // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. @@ -13,10 +13,10 @@ // limitations under the License. // +k8s:deepcopy-gen=package -// +k8s:conversion-gen=github.com/onmetal/gardener-extension-provider-onmetal/pkg/apis/onmetal +// +k8s:conversion-gen=github.com/ironcore-dev/gardener-extension-provider-ironcore/pkg/apis/ironcore // +k8s:openapi-gen=true // +k8s:defaulter-gen=TypeMeta -// Package v1alpha1 contains the onmetal provider API resources. -// +groupName=onmetal.provider.extensions.gardener.cloud -package v1alpha1 // import "github.com/onmetal/gardener-extension-provider-onmetal/pkg/apis/onmetal/v1alpha1" +// Package v1alpha1 contains the ironcore provider API resources. +// +groupName=ironcore.provider.extensions.gardener.cloud +package v1alpha1 // import "github.com/ironcore-dev/gardener-extension-provider-ironcore/pkg/apis/ironcore/v1alpha1" diff --git a/pkg/apis/onmetal/v1alpha1/register.go b/pkg/apis/ironcore/v1alpha1/register.go similarity index 94% rename from pkg/apis/onmetal/v1alpha1/register.go rename to pkg/apis/ironcore/v1alpha1/register.go index 5ff5f108..d24e20e3 100644 --- a/pkg/apis/onmetal/v1alpha1/register.go +++ b/pkg/apis/ironcore/v1alpha1/register.go @@ -1,4 +1,4 @@ -// Copyright 2022 OnMetal authors +// Copyright 2022 IronCore authors // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. @@ -20,7 +20,7 @@ import ( ) // GroupName is the group name use in this package -const GroupName = "onmetal.provider.extensions.gardener.cloud" +const GroupName = "ironcore.provider.extensions.gardener.cloud" // SchemeGroupVersion is group version used to register these objects var SchemeGroupVersion = schema.GroupVersion{Group: GroupName, Version: "v1alpha1"} diff --git a/pkg/apis/onmetal/v1alpha1/types_cloudprofile.go b/pkg/apis/ironcore/v1alpha1/types_cloudprofile.go similarity index 98% rename from pkg/apis/onmetal/v1alpha1/types_cloudprofile.go rename to pkg/apis/ironcore/v1alpha1/types_cloudprofile.go index 8dae2dd5..72da0b39 100644 --- a/pkg/apis/onmetal/v1alpha1/types_cloudprofile.go +++ b/pkg/apis/ironcore/v1alpha1/types_cloudprofile.go @@ -1,4 +1,4 @@ -// Copyright 2022 OnMetal authors +// Copyright 2022 IronCore authors // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. diff --git a/pkg/apis/onmetal/v1alpha1/types_controlplane.go b/pkg/apis/ironcore/v1alpha1/types_controlplane.go similarity index 97% rename from pkg/apis/onmetal/v1alpha1/types_controlplane.go rename to pkg/apis/ironcore/v1alpha1/types_controlplane.go index beb7b127..05bcd28e 100644 --- a/pkg/apis/onmetal/v1alpha1/types_controlplane.go +++ b/pkg/apis/ironcore/v1alpha1/types_controlplane.go @@ -1,4 +1,4 @@ -// Copyright 2022 OnMetal authors +// Copyright 2022 IronCore authors // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. diff --git a/pkg/apis/onmetal/v1alpha1/types_infrastructure.go b/pkg/apis/ironcore/v1alpha1/types_infrastructure.go similarity index 93% rename from pkg/apis/onmetal/v1alpha1/types_infrastructure.go rename to pkg/apis/ironcore/v1alpha1/types_infrastructure.go index dd93a120..4dd48239 100644 --- a/pkg/apis/onmetal/v1alpha1/types_infrastructure.go +++ b/pkg/apis/ironcore/v1alpha1/types_infrastructure.go @@ -1,4 +1,4 @@ -// Copyright 2022 OnMetal authors +// Copyright 2022 IronCore authors // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. @@ -15,7 +15,7 @@ package v1alpha1 import ( - commonv1alpha1 "github.com/onmetal/onmetal-api/api/common/v1alpha1" + commonv1alpha1 "github.com/ironcore-dev/ironcore/api/common/v1alpha1" corev1 "k8s.io/api/core/v1" metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" ) diff --git a/pkg/apis/onmetal/v1alpha1/types_worker.go b/pkg/apis/ironcore/v1alpha1/types_worker.go similarity index 96% rename from pkg/apis/onmetal/v1alpha1/types_worker.go rename to pkg/apis/ironcore/v1alpha1/types_worker.go index fe6c579d..cedd497e 100644 --- a/pkg/apis/onmetal/v1alpha1/types_worker.go +++ b/pkg/apis/ironcore/v1alpha1/types_worker.go @@ -1,4 +1,4 @@ -// Copyright 2022 OnMetal authors +// Copyright 2022 IronCore authors // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. @@ -33,7 +33,7 @@ type WorkerStatus struct { MachineImages []MachineImage `json:"machineImages,omitempty"` } -// MachineImage is a mapping from logical names and versions to onmetal-specific identifiers. +// MachineImage is a mapping from logical names and versions to ironcore-specific identifiers. type MachineImage struct { // Name is the logical name of the machine image. Name string `json:"name"` diff --git a/pkg/apis/onmetal/v1alpha1/v1alpha1_suite_test.go b/pkg/apis/ironcore/v1alpha1/v1alpha1_suite_test.go similarity index 95% rename from pkg/apis/onmetal/v1alpha1/v1alpha1_suite_test.go rename to pkg/apis/ironcore/v1alpha1/v1alpha1_suite_test.go index 4d8ef7f7..b840a7cb 100644 --- a/pkg/apis/onmetal/v1alpha1/v1alpha1_suite_test.go +++ b/pkg/apis/ironcore/v1alpha1/v1alpha1_suite_test.go @@ -1,4 +1,4 @@ -// Copyright 2022 OnMetal authors +// Copyright 2022 IronCore authors // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. diff --git a/pkg/apis/ironcore/v1alpha1/zz_generated.conversion.go b/pkg/apis/ironcore/v1alpha1/zz_generated.conversion.go new file mode 100644 index 00000000..a5d0fd25 --- /dev/null +++ b/pkg/apis/ironcore/v1alpha1/zz_generated.conversion.go @@ -0,0 +1,432 @@ +//go:build !ignore_autogenerated +// +build !ignore_autogenerated + +/* + * Copyright (c) 2021 by the IronCore authors. + * + * 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. + */ +// Code generated by conversion-gen. DO NOT EDIT. + +package v1alpha1 + +import ( + unsafe "unsafe" + + ironcore "github.com/ironcore-dev/gardener-extension-provider-ironcore/pkg/apis/ironcore" + v1 "k8s.io/api/core/v1" + conversion "k8s.io/apimachinery/pkg/conversion" + runtime "k8s.io/apimachinery/pkg/runtime" +) + +func init() { + localSchemeBuilder.Register(RegisterConversions) +} + +// RegisterConversions adds conversion functions to the given scheme. +// Public to allow building arbitrary schemes. +func RegisterConversions(s *runtime.Scheme) error { + if err := s.AddGeneratedConversionFunc((*CloudControllerManagerConfig)(nil), (*ironcore.CloudControllerManagerConfig)(nil), func(a, b interface{}, scope conversion.Scope) error { + return Convert_v1alpha1_CloudControllerManagerConfig_To_ironcore_CloudControllerManagerConfig(a.(*CloudControllerManagerConfig), b.(*ironcore.CloudControllerManagerConfig), scope) + }); err != nil { + return err + } + if err := s.AddGeneratedConversionFunc((*ironcore.CloudControllerManagerConfig)(nil), (*CloudControllerManagerConfig)(nil), func(a, b interface{}, scope conversion.Scope) error { + return Convert_ironcore_CloudControllerManagerConfig_To_v1alpha1_CloudControllerManagerConfig(a.(*ironcore.CloudControllerManagerConfig), b.(*CloudControllerManagerConfig), scope) + }); err != nil { + return err + } + if err := s.AddGeneratedConversionFunc((*CloudProfileConfig)(nil), (*ironcore.CloudProfileConfig)(nil), func(a, b interface{}, scope conversion.Scope) error { + return Convert_v1alpha1_CloudProfileConfig_To_ironcore_CloudProfileConfig(a.(*CloudProfileConfig), b.(*ironcore.CloudProfileConfig), scope) + }); err != nil { + return err + } + if err := s.AddGeneratedConversionFunc((*ironcore.CloudProfileConfig)(nil), (*CloudProfileConfig)(nil), func(a, b interface{}, scope conversion.Scope) error { + return Convert_ironcore_CloudProfileConfig_To_v1alpha1_CloudProfileConfig(a.(*ironcore.CloudProfileConfig), b.(*CloudProfileConfig), scope) + }); err != nil { + return err + } + if err := s.AddGeneratedConversionFunc((*ControlPlaneConfig)(nil), (*ironcore.ControlPlaneConfig)(nil), func(a, b interface{}, scope conversion.Scope) error { + return Convert_v1alpha1_ControlPlaneConfig_To_ironcore_ControlPlaneConfig(a.(*ControlPlaneConfig), b.(*ironcore.ControlPlaneConfig), scope) + }); err != nil { + return err + } + if err := s.AddGeneratedConversionFunc((*ironcore.ControlPlaneConfig)(nil), (*ControlPlaneConfig)(nil), func(a, b interface{}, scope conversion.Scope) error { + return Convert_ironcore_ControlPlaneConfig_To_v1alpha1_ControlPlaneConfig(a.(*ironcore.ControlPlaneConfig), b.(*ControlPlaneConfig), scope) + }); err != nil { + return err + } + if err := s.AddGeneratedConversionFunc((*InfrastructureConfig)(nil), (*ironcore.InfrastructureConfig)(nil), func(a, b interface{}, scope conversion.Scope) error { + return Convert_v1alpha1_InfrastructureConfig_To_ironcore_InfrastructureConfig(a.(*InfrastructureConfig), b.(*ironcore.InfrastructureConfig), scope) + }); err != nil { + return err + } + if err := s.AddGeneratedConversionFunc((*ironcore.InfrastructureConfig)(nil), (*InfrastructureConfig)(nil), func(a, b interface{}, scope conversion.Scope) error { + return Convert_ironcore_InfrastructureConfig_To_v1alpha1_InfrastructureConfig(a.(*ironcore.InfrastructureConfig), b.(*InfrastructureConfig), scope) + }); err != nil { + return err + } + if err := s.AddGeneratedConversionFunc((*InfrastructureStatus)(nil), (*ironcore.InfrastructureStatus)(nil), func(a, b interface{}, scope conversion.Scope) error { + return Convert_v1alpha1_InfrastructureStatus_To_ironcore_InfrastructureStatus(a.(*InfrastructureStatus), b.(*ironcore.InfrastructureStatus), scope) + }); err != nil { + return err + } + if err := s.AddGeneratedConversionFunc((*ironcore.InfrastructureStatus)(nil), (*InfrastructureStatus)(nil), func(a, b interface{}, scope conversion.Scope) error { + return Convert_ironcore_InfrastructureStatus_To_v1alpha1_InfrastructureStatus(a.(*ironcore.InfrastructureStatus), b.(*InfrastructureStatus), scope) + }); err != nil { + return err + } + if err := s.AddGeneratedConversionFunc((*MachineImage)(nil), (*ironcore.MachineImage)(nil), func(a, b interface{}, scope conversion.Scope) error { + return Convert_v1alpha1_MachineImage_To_ironcore_MachineImage(a.(*MachineImage), b.(*ironcore.MachineImage), scope) + }); err != nil { + return err + } + if err := s.AddGeneratedConversionFunc((*ironcore.MachineImage)(nil), (*MachineImage)(nil), func(a, b interface{}, scope conversion.Scope) error { + return Convert_ironcore_MachineImage_To_v1alpha1_MachineImage(a.(*ironcore.MachineImage), b.(*MachineImage), scope) + }); err != nil { + return err + } + if err := s.AddGeneratedConversionFunc((*MachineImageVersion)(nil), (*ironcore.MachineImageVersion)(nil), func(a, b interface{}, scope conversion.Scope) error { + return Convert_v1alpha1_MachineImageVersion_To_ironcore_MachineImageVersion(a.(*MachineImageVersion), b.(*ironcore.MachineImageVersion), scope) + }); err != nil { + return err + } + if err := s.AddGeneratedConversionFunc((*ironcore.MachineImageVersion)(nil), (*MachineImageVersion)(nil), func(a, b interface{}, scope conversion.Scope) error { + return Convert_ironcore_MachineImageVersion_To_v1alpha1_MachineImageVersion(a.(*ironcore.MachineImageVersion), b.(*MachineImageVersion), scope) + }); err != nil { + return err + } + if err := s.AddGeneratedConversionFunc((*MachineImages)(nil), (*ironcore.MachineImages)(nil), func(a, b interface{}, scope conversion.Scope) error { + return Convert_v1alpha1_MachineImages_To_ironcore_MachineImages(a.(*MachineImages), b.(*ironcore.MachineImages), scope) + }); err != nil { + return err + } + if err := s.AddGeneratedConversionFunc((*ironcore.MachineImages)(nil), (*MachineImages)(nil), func(a, b interface{}, scope conversion.Scope) error { + return Convert_ironcore_MachineImages_To_v1alpha1_MachineImages(a.(*ironcore.MachineImages), b.(*MachineImages), scope) + }); err != nil { + return err + } + if err := s.AddGeneratedConversionFunc((*RegionConfig)(nil), (*ironcore.RegionConfig)(nil), func(a, b interface{}, scope conversion.Scope) error { + return Convert_v1alpha1_RegionConfig_To_ironcore_RegionConfig(a.(*RegionConfig), b.(*ironcore.RegionConfig), scope) + }); err != nil { + return err + } + if err := s.AddGeneratedConversionFunc((*ironcore.RegionConfig)(nil), (*RegionConfig)(nil), func(a, b interface{}, scope conversion.Scope) error { + return Convert_ironcore_RegionConfig_To_v1alpha1_RegionConfig(a.(*ironcore.RegionConfig), b.(*RegionConfig), scope) + }); err != nil { + return err + } + if err := s.AddGeneratedConversionFunc((*StorageClass)(nil), (*ironcore.StorageClass)(nil), func(a, b interface{}, scope conversion.Scope) error { + return Convert_v1alpha1_StorageClass_To_ironcore_StorageClass(a.(*StorageClass), b.(*ironcore.StorageClass), scope) + }); err != nil { + return err + } + if err := s.AddGeneratedConversionFunc((*ironcore.StorageClass)(nil), (*StorageClass)(nil), func(a, b interface{}, scope conversion.Scope) error { + return Convert_ironcore_StorageClass_To_v1alpha1_StorageClass(a.(*ironcore.StorageClass), b.(*StorageClass), scope) + }); err != nil { + return err + } + if err := s.AddGeneratedConversionFunc((*StorageClasses)(nil), (*ironcore.StorageClasses)(nil), func(a, b interface{}, scope conversion.Scope) error { + return Convert_v1alpha1_StorageClasses_To_ironcore_StorageClasses(a.(*StorageClasses), b.(*ironcore.StorageClasses), scope) + }); err != nil { + return err + } + if err := s.AddGeneratedConversionFunc((*ironcore.StorageClasses)(nil), (*StorageClasses)(nil), func(a, b interface{}, scope conversion.Scope) error { + return Convert_ironcore_StorageClasses_To_v1alpha1_StorageClasses(a.(*ironcore.StorageClasses), b.(*StorageClasses), scope) + }); err != nil { + return err + } + if err := s.AddGeneratedConversionFunc((*WorkerStatus)(nil), (*ironcore.WorkerStatus)(nil), func(a, b interface{}, scope conversion.Scope) error { + return Convert_v1alpha1_WorkerStatus_To_ironcore_WorkerStatus(a.(*WorkerStatus), b.(*ironcore.WorkerStatus), scope) + }); err != nil { + return err + } + if err := s.AddGeneratedConversionFunc((*ironcore.WorkerStatus)(nil), (*WorkerStatus)(nil), func(a, b interface{}, scope conversion.Scope) error { + return Convert_ironcore_WorkerStatus_To_v1alpha1_WorkerStatus(a.(*ironcore.WorkerStatus), b.(*WorkerStatus), scope) + }); err != nil { + return err + } + return nil +} + +func autoConvert_v1alpha1_CloudControllerManagerConfig_To_ironcore_CloudControllerManagerConfig(in *CloudControllerManagerConfig, out *ironcore.CloudControllerManagerConfig, s conversion.Scope) error { + out.FeatureGates = *(*map[string]bool)(unsafe.Pointer(&in.FeatureGates)) + return nil +} + +// Convert_v1alpha1_CloudControllerManagerConfig_To_ironcore_CloudControllerManagerConfig is an autogenerated conversion function. +func Convert_v1alpha1_CloudControllerManagerConfig_To_ironcore_CloudControllerManagerConfig(in *CloudControllerManagerConfig, out *ironcore.CloudControllerManagerConfig, s conversion.Scope) error { + return autoConvert_v1alpha1_CloudControllerManagerConfig_To_ironcore_CloudControllerManagerConfig(in, out, s) +} + +func autoConvert_ironcore_CloudControllerManagerConfig_To_v1alpha1_CloudControllerManagerConfig(in *ironcore.CloudControllerManagerConfig, out *CloudControllerManagerConfig, s conversion.Scope) error { + out.FeatureGates = *(*map[string]bool)(unsafe.Pointer(&in.FeatureGates)) + return nil +} + +// Convert_ironcore_CloudControllerManagerConfig_To_v1alpha1_CloudControllerManagerConfig is an autogenerated conversion function. +func Convert_ironcore_CloudControllerManagerConfig_To_v1alpha1_CloudControllerManagerConfig(in *ironcore.CloudControllerManagerConfig, out *CloudControllerManagerConfig, s conversion.Scope) error { + return autoConvert_ironcore_CloudControllerManagerConfig_To_v1alpha1_CloudControllerManagerConfig(in, out, s) +} + +func autoConvert_v1alpha1_CloudProfileConfig_To_ironcore_CloudProfileConfig(in *CloudProfileConfig, out *ironcore.CloudProfileConfig, s conversion.Scope) error { + out.MachineImages = *(*[]ironcore.MachineImages)(unsafe.Pointer(&in.MachineImages)) + out.RegionConfigs = *(*[]ironcore.RegionConfig)(unsafe.Pointer(&in.RegionConfigs)) + if err := Convert_v1alpha1_StorageClasses_To_ironcore_StorageClasses(&in.StorageClasses, &out.StorageClasses, s); err != nil { + return err + } + return nil +} + +// Convert_v1alpha1_CloudProfileConfig_To_ironcore_CloudProfileConfig is an autogenerated conversion function. +func Convert_v1alpha1_CloudProfileConfig_To_ironcore_CloudProfileConfig(in *CloudProfileConfig, out *ironcore.CloudProfileConfig, s conversion.Scope) error { + return autoConvert_v1alpha1_CloudProfileConfig_To_ironcore_CloudProfileConfig(in, out, s) +} + +func autoConvert_ironcore_CloudProfileConfig_To_v1alpha1_CloudProfileConfig(in *ironcore.CloudProfileConfig, out *CloudProfileConfig, s conversion.Scope) error { + out.MachineImages = *(*[]MachineImages)(unsafe.Pointer(&in.MachineImages)) + out.RegionConfigs = *(*[]RegionConfig)(unsafe.Pointer(&in.RegionConfigs)) + if err := Convert_ironcore_StorageClasses_To_v1alpha1_StorageClasses(&in.StorageClasses, &out.StorageClasses, s); err != nil { + return err + } + return nil +} + +// Convert_ironcore_CloudProfileConfig_To_v1alpha1_CloudProfileConfig is an autogenerated conversion function. +func Convert_ironcore_CloudProfileConfig_To_v1alpha1_CloudProfileConfig(in *ironcore.CloudProfileConfig, out *CloudProfileConfig, s conversion.Scope) error { + return autoConvert_ironcore_CloudProfileConfig_To_v1alpha1_CloudProfileConfig(in, out, s) +} + +func autoConvert_v1alpha1_ControlPlaneConfig_To_ironcore_ControlPlaneConfig(in *ControlPlaneConfig, out *ironcore.ControlPlaneConfig, s conversion.Scope) error { + out.CloudControllerManager = (*ironcore.CloudControllerManagerConfig)(unsafe.Pointer(in.CloudControllerManager)) + return nil +} + +// Convert_v1alpha1_ControlPlaneConfig_To_ironcore_ControlPlaneConfig is an autogenerated conversion function. +func Convert_v1alpha1_ControlPlaneConfig_To_ironcore_ControlPlaneConfig(in *ControlPlaneConfig, out *ironcore.ControlPlaneConfig, s conversion.Scope) error { + return autoConvert_v1alpha1_ControlPlaneConfig_To_ironcore_ControlPlaneConfig(in, out, s) +} + +func autoConvert_ironcore_ControlPlaneConfig_To_v1alpha1_ControlPlaneConfig(in *ironcore.ControlPlaneConfig, out *ControlPlaneConfig, s conversion.Scope) error { + out.CloudControllerManager = (*CloudControllerManagerConfig)(unsafe.Pointer(in.CloudControllerManager)) + return nil +} + +// Convert_ironcore_ControlPlaneConfig_To_v1alpha1_ControlPlaneConfig is an autogenerated conversion function. +func Convert_ironcore_ControlPlaneConfig_To_v1alpha1_ControlPlaneConfig(in *ironcore.ControlPlaneConfig, out *ControlPlaneConfig, s conversion.Scope) error { + return autoConvert_ironcore_ControlPlaneConfig_To_v1alpha1_ControlPlaneConfig(in, out, s) +} + +func autoConvert_v1alpha1_InfrastructureConfig_To_ironcore_InfrastructureConfig(in *InfrastructureConfig, out *ironcore.InfrastructureConfig, s conversion.Scope) error { + out.NetworkRef = (*v1.LocalObjectReference)(unsafe.Pointer(in.NetworkRef)) + return nil +} + +// Convert_v1alpha1_InfrastructureConfig_To_ironcore_InfrastructureConfig is an autogenerated conversion function. +func Convert_v1alpha1_InfrastructureConfig_To_ironcore_InfrastructureConfig(in *InfrastructureConfig, out *ironcore.InfrastructureConfig, s conversion.Scope) error { + return autoConvert_v1alpha1_InfrastructureConfig_To_ironcore_InfrastructureConfig(in, out, s) +} + +func autoConvert_ironcore_InfrastructureConfig_To_v1alpha1_InfrastructureConfig(in *ironcore.InfrastructureConfig, out *InfrastructureConfig, s conversion.Scope) error { + out.NetworkRef = (*v1.LocalObjectReference)(unsafe.Pointer(in.NetworkRef)) + return nil +} + +// Convert_ironcore_InfrastructureConfig_To_v1alpha1_InfrastructureConfig is an autogenerated conversion function. +func Convert_ironcore_InfrastructureConfig_To_v1alpha1_InfrastructureConfig(in *ironcore.InfrastructureConfig, out *InfrastructureConfig, s conversion.Scope) error { + return autoConvert_ironcore_InfrastructureConfig_To_v1alpha1_InfrastructureConfig(in, out, s) +} + +func autoConvert_v1alpha1_InfrastructureStatus_To_ironcore_InfrastructureStatus(in *InfrastructureStatus, out *ironcore.InfrastructureStatus, s conversion.Scope) error { + out.NetworkRef = in.NetworkRef + out.NATGatewayRef = in.NATGatewayRef + out.PrefixRef = in.PrefixRef + return nil +} + +// Convert_v1alpha1_InfrastructureStatus_To_ironcore_InfrastructureStatus is an autogenerated conversion function. +func Convert_v1alpha1_InfrastructureStatus_To_ironcore_InfrastructureStatus(in *InfrastructureStatus, out *ironcore.InfrastructureStatus, s conversion.Scope) error { + return autoConvert_v1alpha1_InfrastructureStatus_To_ironcore_InfrastructureStatus(in, out, s) +} + +func autoConvert_ironcore_InfrastructureStatus_To_v1alpha1_InfrastructureStatus(in *ironcore.InfrastructureStatus, out *InfrastructureStatus, s conversion.Scope) error { + out.NetworkRef = in.NetworkRef + out.NATGatewayRef = in.NATGatewayRef + out.PrefixRef = in.PrefixRef + return nil +} + +// Convert_ironcore_InfrastructureStatus_To_v1alpha1_InfrastructureStatus is an autogenerated conversion function. +func Convert_ironcore_InfrastructureStatus_To_v1alpha1_InfrastructureStatus(in *ironcore.InfrastructureStatus, out *InfrastructureStatus, s conversion.Scope) error { + return autoConvert_ironcore_InfrastructureStatus_To_v1alpha1_InfrastructureStatus(in, out, s) +} + +func autoConvert_v1alpha1_MachineImage_To_ironcore_MachineImage(in *MachineImage, out *ironcore.MachineImage, s conversion.Scope) error { + out.Name = in.Name + out.Version = in.Version + out.Image = in.Image + out.Architecture = (*string)(unsafe.Pointer(in.Architecture)) + return nil +} + +// Convert_v1alpha1_MachineImage_To_ironcore_MachineImage is an autogenerated conversion function. +func Convert_v1alpha1_MachineImage_To_ironcore_MachineImage(in *MachineImage, out *ironcore.MachineImage, s conversion.Scope) error { + return autoConvert_v1alpha1_MachineImage_To_ironcore_MachineImage(in, out, s) +} + +func autoConvert_ironcore_MachineImage_To_v1alpha1_MachineImage(in *ironcore.MachineImage, out *MachineImage, s conversion.Scope) error { + out.Name = in.Name + out.Version = in.Version + out.Image = in.Image + out.Architecture = (*string)(unsafe.Pointer(in.Architecture)) + return nil +} + +// Convert_ironcore_MachineImage_To_v1alpha1_MachineImage is an autogenerated conversion function. +func Convert_ironcore_MachineImage_To_v1alpha1_MachineImage(in *ironcore.MachineImage, out *MachineImage, s conversion.Scope) error { + return autoConvert_ironcore_MachineImage_To_v1alpha1_MachineImage(in, out, s) +} + +func autoConvert_v1alpha1_MachineImageVersion_To_ironcore_MachineImageVersion(in *MachineImageVersion, out *ironcore.MachineImageVersion, s conversion.Scope) error { + out.Version = in.Version + out.Image = in.Image + out.Architecture = (*string)(unsafe.Pointer(in.Architecture)) + return nil +} + +// Convert_v1alpha1_MachineImageVersion_To_ironcore_MachineImageVersion is an autogenerated conversion function. +func Convert_v1alpha1_MachineImageVersion_To_ironcore_MachineImageVersion(in *MachineImageVersion, out *ironcore.MachineImageVersion, s conversion.Scope) error { + return autoConvert_v1alpha1_MachineImageVersion_To_ironcore_MachineImageVersion(in, out, s) +} + +func autoConvert_ironcore_MachineImageVersion_To_v1alpha1_MachineImageVersion(in *ironcore.MachineImageVersion, out *MachineImageVersion, s conversion.Scope) error { + out.Version = in.Version + out.Image = in.Image + out.Architecture = (*string)(unsafe.Pointer(in.Architecture)) + return nil +} + +// Convert_ironcore_MachineImageVersion_To_v1alpha1_MachineImageVersion is an autogenerated conversion function. +func Convert_ironcore_MachineImageVersion_To_v1alpha1_MachineImageVersion(in *ironcore.MachineImageVersion, out *MachineImageVersion, s conversion.Scope) error { + return autoConvert_ironcore_MachineImageVersion_To_v1alpha1_MachineImageVersion(in, out, s) +} + +func autoConvert_v1alpha1_MachineImages_To_ironcore_MachineImages(in *MachineImages, out *ironcore.MachineImages, s conversion.Scope) error { + out.Name = in.Name + out.Versions = *(*[]ironcore.MachineImageVersion)(unsafe.Pointer(&in.Versions)) + return nil +} + +// Convert_v1alpha1_MachineImages_To_ironcore_MachineImages is an autogenerated conversion function. +func Convert_v1alpha1_MachineImages_To_ironcore_MachineImages(in *MachineImages, out *ironcore.MachineImages, s conversion.Scope) error { + return autoConvert_v1alpha1_MachineImages_To_ironcore_MachineImages(in, out, s) +} + +func autoConvert_ironcore_MachineImages_To_v1alpha1_MachineImages(in *ironcore.MachineImages, out *MachineImages, s conversion.Scope) error { + out.Name = in.Name + out.Versions = *(*[]MachineImageVersion)(unsafe.Pointer(&in.Versions)) + return nil +} + +// Convert_ironcore_MachineImages_To_v1alpha1_MachineImages is an autogenerated conversion function. +func Convert_ironcore_MachineImages_To_v1alpha1_MachineImages(in *ironcore.MachineImages, out *MachineImages, s conversion.Scope) error { + return autoConvert_ironcore_MachineImages_To_v1alpha1_MachineImages(in, out, s) +} + +func autoConvert_v1alpha1_RegionConfig_To_ironcore_RegionConfig(in *RegionConfig, out *ironcore.RegionConfig, s conversion.Scope) error { + out.Name = in.Name + out.Server = in.Server + out.CertificateAuthorityData = *(*[]byte)(unsafe.Pointer(&in.CertificateAuthorityData)) + return nil +} + +// Convert_v1alpha1_RegionConfig_To_ironcore_RegionConfig is an autogenerated conversion function. +func Convert_v1alpha1_RegionConfig_To_ironcore_RegionConfig(in *RegionConfig, out *ironcore.RegionConfig, s conversion.Scope) error { + return autoConvert_v1alpha1_RegionConfig_To_ironcore_RegionConfig(in, out, s) +} + +func autoConvert_ironcore_RegionConfig_To_v1alpha1_RegionConfig(in *ironcore.RegionConfig, out *RegionConfig, s conversion.Scope) error { + out.Name = in.Name + out.Server = in.Server + out.CertificateAuthorityData = *(*[]byte)(unsafe.Pointer(&in.CertificateAuthorityData)) + return nil +} + +// Convert_ironcore_RegionConfig_To_v1alpha1_RegionConfig is an autogenerated conversion function. +func Convert_ironcore_RegionConfig_To_v1alpha1_RegionConfig(in *ironcore.RegionConfig, out *RegionConfig, s conversion.Scope) error { + return autoConvert_ironcore_RegionConfig_To_v1alpha1_RegionConfig(in, out, s) +} + +func autoConvert_v1alpha1_StorageClass_To_ironcore_StorageClass(in *StorageClass, out *ironcore.StorageClass, s conversion.Scope) error { + out.Name = in.Name + out.Type = in.Type + return nil +} + +// Convert_v1alpha1_StorageClass_To_ironcore_StorageClass is an autogenerated conversion function. +func Convert_v1alpha1_StorageClass_To_ironcore_StorageClass(in *StorageClass, out *ironcore.StorageClass, s conversion.Scope) error { + return autoConvert_v1alpha1_StorageClass_To_ironcore_StorageClass(in, out, s) +} + +func autoConvert_ironcore_StorageClass_To_v1alpha1_StorageClass(in *ironcore.StorageClass, out *StorageClass, s conversion.Scope) error { + out.Name = in.Name + out.Type = in.Type + return nil +} + +// Convert_ironcore_StorageClass_To_v1alpha1_StorageClass is an autogenerated conversion function. +func Convert_ironcore_StorageClass_To_v1alpha1_StorageClass(in *ironcore.StorageClass, out *StorageClass, s conversion.Scope) error { + return autoConvert_ironcore_StorageClass_To_v1alpha1_StorageClass(in, out, s) +} + +func autoConvert_v1alpha1_StorageClasses_To_ironcore_StorageClasses(in *StorageClasses, out *ironcore.StorageClasses, s conversion.Scope) error { + out.Default = (*ironcore.StorageClass)(unsafe.Pointer(in.Default)) + out.Additional = *(*[]ironcore.StorageClass)(unsafe.Pointer(&in.Additional)) + return nil +} + +// Convert_v1alpha1_StorageClasses_To_ironcore_StorageClasses is an autogenerated conversion function. +func Convert_v1alpha1_StorageClasses_To_ironcore_StorageClasses(in *StorageClasses, out *ironcore.StorageClasses, s conversion.Scope) error { + return autoConvert_v1alpha1_StorageClasses_To_ironcore_StorageClasses(in, out, s) +} + +func autoConvert_ironcore_StorageClasses_To_v1alpha1_StorageClasses(in *ironcore.StorageClasses, out *StorageClasses, s conversion.Scope) error { + out.Default = (*StorageClass)(unsafe.Pointer(in.Default)) + out.Additional = *(*[]StorageClass)(unsafe.Pointer(&in.Additional)) + return nil +} + +// Convert_ironcore_StorageClasses_To_v1alpha1_StorageClasses is an autogenerated conversion function. +func Convert_ironcore_StorageClasses_To_v1alpha1_StorageClasses(in *ironcore.StorageClasses, out *StorageClasses, s conversion.Scope) error { + return autoConvert_ironcore_StorageClasses_To_v1alpha1_StorageClasses(in, out, s) +} + +func autoConvert_v1alpha1_WorkerStatus_To_ironcore_WorkerStatus(in *WorkerStatus, out *ironcore.WorkerStatus, s conversion.Scope) error { + out.MachineImages = *(*[]ironcore.MachineImage)(unsafe.Pointer(&in.MachineImages)) + return nil +} + +// Convert_v1alpha1_WorkerStatus_To_ironcore_WorkerStatus is an autogenerated conversion function. +func Convert_v1alpha1_WorkerStatus_To_ironcore_WorkerStatus(in *WorkerStatus, out *ironcore.WorkerStatus, s conversion.Scope) error { + return autoConvert_v1alpha1_WorkerStatus_To_ironcore_WorkerStatus(in, out, s) +} + +func autoConvert_ironcore_WorkerStatus_To_v1alpha1_WorkerStatus(in *ironcore.WorkerStatus, out *WorkerStatus, s conversion.Scope) error { + out.MachineImages = *(*[]MachineImage)(unsafe.Pointer(&in.MachineImages)) + return nil +} + +// Convert_ironcore_WorkerStatus_To_v1alpha1_WorkerStatus is an autogenerated conversion function. +func Convert_ironcore_WorkerStatus_To_v1alpha1_WorkerStatus(in *ironcore.WorkerStatus, out *WorkerStatus, s conversion.Scope) error { + return autoConvert_ironcore_WorkerStatus_To_v1alpha1_WorkerStatus(in, out, s) +} diff --git a/pkg/apis/onmetal/v1alpha1/zz_generated.deepcopy.go b/pkg/apis/ironcore/v1alpha1/zz_generated.deepcopy.go similarity index 99% rename from pkg/apis/onmetal/v1alpha1/zz_generated.deepcopy.go rename to pkg/apis/ironcore/v1alpha1/zz_generated.deepcopy.go index cef72116..914702e6 100644 --- a/pkg/apis/onmetal/v1alpha1/zz_generated.deepcopy.go +++ b/pkg/apis/ironcore/v1alpha1/zz_generated.deepcopy.go @@ -2,7 +2,7 @@ // +build !ignore_autogenerated /* - * Copyright (c) 2021 by the OnMetal authors. + * Copyright (c) 2021 by the IronCore authors. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/pkg/apis/onmetal/v1alpha1/zz_generated.defaults.go b/pkg/apis/ironcore/v1alpha1/zz_generated.defaults.go similarity index 95% rename from pkg/apis/onmetal/v1alpha1/zz_generated.defaults.go rename to pkg/apis/ironcore/v1alpha1/zz_generated.defaults.go index eed1d793..1e1afc5e 100644 --- a/pkg/apis/onmetal/v1alpha1/zz_generated.defaults.go +++ b/pkg/apis/ironcore/v1alpha1/zz_generated.defaults.go @@ -2,7 +2,7 @@ // +build !ignore_autogenerated /* - * Copyright (c) 2021 by the OnMetal authors. + * Copyright (c) 2021 by the IronCore authors. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/pkg/apis/onmetal/validation/cloudprofile.go b/pkg/apis/ironcore/validation/cloudprofile.go similarity index 87% rename from pkg/apis/onmetal/validation/cloudprofile.go rename to pkg/apis/ironcore/validation/cloudprofile.go index e0c8ba56..959503cf 100644 --- a/pkg/apis/onmetal/validation/cloudprofile.go +++ b/pkg/apis/ironcore/validation/cloudprofile.go @@ -1,4 +1,4 @@ -// Copyright 2022 OnMetal authors +// Copyright 2022 IronCore authors // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. @@ -24,11 +24,11 @@ import ( "k8s.io/apimachinery/pkg/util/validation/field" "k8s.io/utils/strings/slices" - apisonmetal "github.com/onmetal/gardener-extension-provider-onmetal/pkg/apis/onmetal" + apisironcore "github.com/ironcore-dev/gardener-extension-provider-ironcore/pkg/apis/ironcore" ) // ValidateCloudProfileConfig validates a CloudProfileConfig object. -func ValidateCloudProfileConfig(cpConfig *apisonmetal.CloudProfileConfig, machineImages []gardenercore.MachineImage, fldPath *field.Path) field.ErrorList { +func ValidateCloudProfileConfig(cpConfig *apisironcore.CloudProfileConfig, machineImages []gardenercore.MachineImage, fldPath *field.Path) field.ErrorList { allErrs := field.ErrorList{} machineImagesPath := fldPath.Child("machineImages") @@ -61,7 +61,7 @@ func ValidateCloudProfileConfig(cpConfig *apisonmetal.CloudProfileConfig, machin return allErrs } -func validateVersions(versionsConfig []apisonmetal.MachineImageVersion, versions []gardenercore.ExpirableVersion, fldPath *field.Path) field.ErrorList { +func validateVersions(versionsConfig []apisironcore.MachineImageVersion, versions []gardenercore.ExpirableVersion, fldPath *field.Path) field.ErrorList { allErrs := field.ErrorList{} for _, version := range versions { diff --git a/pkg/apis/onmetal/validation/cloudprofile_test.go b/pkg/apis/ironcore/validation/cloudprofile_test.go similarity index 85% rename from pkg/apis/onmetal/validation/cloudprofile_test.go rename to pkg/apis/ironcore/validation/cloudprofile_test.go index 01390cac..38a362a8 100644 --- a/pkg/apis/onmetal/validation/cloudprofile_test.go +++ b/pkg/apis/ironcore/validation/cloudprofile_test.go @@ -1,4 +1,4 @@ -// Copyright 2022 OnMetal authors +// Copyright 2022 IronCore authors // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. @@ -23,7 +23,7 @@ import ( "k8s.io/apimachinery/pkg/util/validation/field" "k8s.io/utils/pointer" - apisonmetal "github.com/onmetal/gardener-extension-provider-onmetal/pkg/apis/onmetal" + apisironcore "github.com/ironcore-dev/gardener-extension-provider-ironcore/pkg/apis/ironcore" ) func InvalidField(fld string) types.GomegaMatcher { @@ -40,7 +40,7 @@ func SimpleMatchField(errorType field.ErrorType, fld string) types.GomegaMatcher var _ = Describe("CloudProfileConfig validation", func() { Describe("#ValidateCloudProfileConfig", func() { var ( - cloudProfileConfig *apisonmetal.CloudProfileConfig + cloudProfileConfig *apisironcore.CloudProfileConfig machineImages []core.MachineImage nilPath *field.Path machineImageName string @@ -50,11 +50,11 @@ var _ = Describe("CloudProfileConfig validation", func() { BeforeEach(func() { machineImageName = "ubuntu" machineImageVersion = "1.2.3" - cloudProfileConfig = &apisonmetal.CloudProfileConfig{ - MachineImages: []apisonmetal.MachineImages{ + cloudProfileConfig = &apisironcore.CloudProfileConfig{ + MachineImages: []apisironcore.MachineImages{ { Name: machineImageName, - Versions: []apisonmetal.MachineImageVersion{ + Versions: []apisironcore.MachineImageVersion{ { Version: machineImageVersion, Image: "registry/image:sha1234", @@ -63,12 +63,12 @@ var _ = Describe("CloudProfileConfig validation", func() { }, }, }, - StorageClasses: apisonmetal.StorageClasses{ - Default: &apisonmetal.StorageClass{ + StorageClasses: apisironcore.StorageClasses{ + Default: &apisironcore.StorageClass{ Name: "default", Type: "defaultType", }, - Additional: []apisonmetal.StorageClass{ + Additional: []apisironcore.StorageClass{ { Name: "foo", Type: "fooType", @@ -151,14 +151,14 @@ var _ = Describe("CloudProfileConfig validation", func() { }) DescribeTable("ValidateCloudProfileConfig StorageClass name", - func(cpConfig *apisonmetal.CloudProfileConfig, machineImages []core.MachineImage, fldPath *field.Path, match types.GomegaMatcher) { + func(cpConfig *apisironcore.CloudProfileConfig, machineImages []core.MachineImage, fldPath *field.Path, match types.GomegaMatcher) { errList := ValidateCloudProfileConfig(cpConfig, machineImages, fldPath) Expect(errList).To(match) }, Entry("invalid storageClass name in default StorageClass", - &apisonmetal.CloudProfileConfig{ - StorageClasses: apisonmetal.StorageClasses{ - Default: &apisonmetal.StorageClass{ + &apisironcore.CloudProfileConfig{ + StorageClasses: apisironcore.StorageClasses{ + Default: &apisironcore.StorageClass{ Name: "foo*", Type: "defaultType", }, @@ -169,9 +169,9 @@ var _ = Describe("CloudProfileConfig validation", func() { ContainElement(InvalidField("storageClasses.defaultStorageClasses.name")), ), Entry("invalid storageClass name in additional storageClasses", - &apisonmetal.CloudProfileConfig{ - StorageClasses: apisonmetal.StorageClasses{ - Additional: []apisonmetal.StorageClass{ + &apisironcore.CloudProfileConfig{ + StorageClasses: apisironcore.StorageClasses{ + Additional: []apisironcore.StorageClass{ { Name: "foo*", Type: "defaultType", diff --git a/pkg/apis/onmetal/validation/controlplane.go b/pkg/apis/ironcore/validation/controlplane.go similarity index 82% rename from pkg/apis/onmetal/validation/controlplane.go rename to pkg/apis/ironcore/validation/controlplane.go index 2b4483e9..ea2f1680 100644 --- a/pkg/apis/onmetal/validation/controlplane.go +++ b/pkg/apis/ironcore/validation/controlplane.go @@ -18,11 +18,11 @@ import ( featurevalidation "github.com/gardener/gardener/pkg/utils/validation/features" "k8s.io/apimachinery/pkg/util/validation/field" - apisonmetal "github.com/onmetal/gardener-extension-provider-onmetal/pkg/apis/onmetal" + apisironcore "github.com/ironcore-dev/gardener-extension-provider-ironcore/pkg/apis/ironcore" ) // ValidateControlPlaneConfig validates a ControlPlaneConfig object. -func ValidateControlPlaneConfig(controlPlaneConfig *apisonmetal.ControlPlaneConfig, version string, fldPath *field.Path) field.ErrorList { +func ValidateControlPlaneConfig(controlPlaneConfig *apisironcore.ControlPlaneConfig, version string, fldPath *field.Path) field.ErrorList { allErrs := field.ErrorList{} if controlPlaneConfig.CloudControllerManager != nil { @@ -33,7 +33,7 @@ func ValidateControlPlaneConfig(controlPlaneConfig *apisonmetal.ControlPlaneConf } // ValidateControlPlaneConfigUpdate validates a ControlPlaneConfig object. -func ValidateControlPlaneConfigUpdate(oldConfig, newConfig *apisonmetal.ControlPlaneConfig, fldPath *field.Path) field.ErrorList { +func ValidateControlPlaneConfigUpdate(oldConfig, newConfig *apisironcore.ControlPlaneConfig, fldPath *field.Path) field.ErrorList { allErrs := field.ErrorList{} return allErrs diff --git a/pkg/apis/onmetal/validation/controlplane_test.go b/pkg/apis/ironcore/validation/controlplane_test.go similarity index 86% rename from pkg/apis/onmetal/validation/controlplane_test.go rename to pkg/apis/ironcore/validation/controlplane_test.go index d237eb8a..770feff0 100644 --- a/pkg/apis/onmetal/validation/controlplane_test.go +++ b/pkg/apis/ironcore/validation/controlplane_test.go @@ -1,4 +1,4 @@ -// Copyright 2022 OnMetal authors +// Copyright 2022 IronCore authors // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. @@ -20,17 +20,17 @@ import ( . "github.com/onsi/gomega/gstruct" "k8s.io/apimachinery/pkg/util/validation/field" - apisonmetal "github.com/onmetal/gardener-extension-provider-onmetal/pkg/apis/onmetal" + apisironcore "github.com/ironcore-dev/gardener-extension-provider-ironcore/pkg/apis/ironcore" ) var _ = Describe("ControlPlaneConfig validation", func() { var ( - controlPlane *apisonmetal.ControlPlaneConfig + controlPlane *apisironcore.ControlPlaneConfig fldPath *field.Path ) BeforeEach(func() { - controlPlane = &apisonmetal.ControlPlaneConfig{} + controlPlane = &apisironcore.ControlPlaneConfig{} }) Describe("#ValidateControlPlaneConfig", func() { @@ -39,7 +39,7 @@ var _ = Describe("ControlPlaneConfig validation", func() { }) It("should fail with invalid CCM feature gates", func() { - controlPlane.CloudControllerManager = &apisonmetal.CloudControllerManagerConfig{ + controlPlane.CloudControllerManager = &apisironcore.CloudControllerManagerConfig{ FeatureGates: map[string]bool{ "AnyVolumeDataSource": true, "CustomResourceValidation": true, diff --git a/pkg/apis/onmetal/validation/infrastructure.go b/pkg/apis/ironcore/validation/infrastructure.go similarity index 79% rename from pkg/apis/onmetal/validation/infrastructure.go rename to pkg/apis/ironcore/validation/infrastructure.go index 92eaa7da..46b0b9ef 100644 --- a/pkg/apis/onmetal/validation/infrastructure.go +++ b/pkg/apis/ironcore/validation/infrastructure.go @@ -1,4 +1,4 @@ -// Copyright 2022 OnMetal authors +// Copyright 2022 IronCore authors // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. @@ -18,11 +18,11 @@ import ( apivalidation "k8s.io/apimachinery/pkg/api/validation" "k8s.io/apimachinery/pkg/util/validation/field" - apisonmetal "github.com/onmetal/gardener-extension-provider-onmetal/pkg/apis/onmetal" + apisironcore "github.com/ironcore-dev/gardener-extension-provider-ironcore/pkg/apis/ironcore" ) // ValidateInfrastructureConfig validates a InfrastructureConfig object. -func ValidateInfrastructureConfig(infra *apisonmetal.InfrastructureConfig, nodesCIDR, podsCIDR, servicesCIDR *string, fldPath *field.Path) field.ErrorList { +func ValidateInfrastructureConfig(infra *apisironcore.InfrastructureConfig, nodesCIDR, podsCIDR, servicesCIDR *string, fldPath *field.Path) field.ErrorList { allErrs := field.ErrorList{} if infra.NetworkRef != nil { @@ -35,7 +35,7 @@ func ValidateInfrastructureConfig(infra *apisonmetal.InfrastructureConfig, nodes } // ValidateInfrastructureConfigUpdate validates a InfrastructureConfig object. -func ValidateInfrastructureConfigUpdate(oldConfig, newConfig *apisonmetal.InfrastructureConfig, fldPath *field.Path) field.ErrorList { +func ValidateInfrastructureConfigUpdate(oldConfig, newConfig *apisironcore.InfrastructureConfig, fldPath *field.Path) field.ErrorList { var ( allErrs = field.ErrorList{} ) diff --git a/pkg/apis/onmetal/validation/infrastructure_test.go b/pkg/apis/ironcore/validation/infrastructure_test.go similarity index 88% rename from pkg/apis/onmetal/validation/infrastructure_test.go rename to pkg/apis/ironcore/validation/infrastructure_test.go index d20e007f..c8448ac5 100644 --- a/pkg/apis/onmetal/validation/infrastructure_test.go +++ b/pkg/apis/ironcore/validation/infrastructure_test.go @@ -1,4 +1,4 @@ -// Copyright 2022 OnMetal authors +// Copyright 2022 IronCore authors // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. @@ -21,18 +21,18 @@ import ( corev1 "k8s.io/api/core/v1" "k8s.io/apimachinery/pkg/util/validation/field" - apisonmetal "github.com/onmetal/gardener-extension-provider-onmetal/pkg/apis/onmetal" + apisironcore "github.com/ironcore-dev/gardener-extension-provider-ironcore/pkg/apis/ironcore" ) var _ = Describe("InfrastructureConfig validation", func() { var ( - infra *apisonmetal.InfrastructureConfig + infra *apisironcore.InfrastructureConfig fldPath *field.Path networkName = "test-network" ) BeforeEach(func() { - infra = &apisonmetal.InfrastructureConfig{ + infra = &apisironcore.InfrastructureConfig{ NetworkRef: &corev1.LocalObjectReference{ Name: networkName, }, diff --git a/pkg/apis/onmetal/validation/secret.go b/pkg/apis/ironcore/validation/secret.go similarity index 76% rename from pkg/apis/onmetal/validation/secret.go rename to pkg/apis/ironcore/validation/secret.go index aa32d0ed..6249a112 100644 --- a/pkg/apis/onmetal/validation/secret.go +++ b/pkg/apis/ironcore/validation/secret.go @@ -20,24 +20,24 @@ import ( corev1 "k8s.io/api/core/v1" apivalidation "k8s.io/apimachinery/pkg/api/validation" - "github.com/onmetal/gardener-extension-provider-onmetal/pkg/onmetal" + "github.com/ironcore-dev/gardener-extension-provider-ironcore/pkg/ironcore" ) -// ValidateCloudProviderSecret checks whether the given secret contains a valid onmetal service account. +// ValidateCloudProviderSecret checks whether the given secret contains a valid ironcore service account. func ValidateCloudProviderSecret(secret *corev1.Secret) error { - if _, ok := secret.Data[onmetal.TokenFieldName]; !ok { - return fmt.Errorf("missing field: %s in cloud provider secret", onmetal.TokenFieldName) + if _, ok := secret.Data[ironcore.TokenFieldName]; !ok { + return fmt.Errorf("missing field: %s in cloud provider secret", ironcore.TokenFieldName) } - namespace, ok := secret.Data[onmetal.NamespaceFieldName] + namespace, ok := secret.Data[ironcore.NamespaceFieldName] if !ok { - return fmt.Errorf("missing field: %s in cloud provider secret", onmetal.NamespaceFieldName) + return fmt.Errorf("missing field: %s in cloud provider secret", ironcore.NamespaceFieldName) } - if _, ok := secret.Data[onmetal.UsernameFieldName]; !ok { - return fmt.Errorf("missing field: %s in cloud provider secret", onmetal.UsernameFieldName) + if _, ok := secret.Data[ironcore.UsernameFieldName]; !ok { + return fmt.Errorf("missing field: %s in cloud provider secret", ironcore.UsernameFieldName) } errs := apivalidation.ValidateNamespaceName(string(namespace), false) if len(errs) > 0 { - return fmt.Errorf("invalid field: %s in cloud provider secret", onmetal.NamespaceFieldName) + return fmt.Errorf("invalid field: %s in cloud provider secret", ironcore.NamespaceFieldName) } return nil diff --git a/pkg/apis/onmetal/validation/secret_test.go b/pkg/apis/ironcore/validation/secret_test.go similarity index 98% rename from pkg/apis/onmetal/validation/secret_test.go rename to pkg/apis/ironcore/validation/secret_test.go index 3215a31e..8fbcbf3d 100644 --- a/pkg/apis/onmetal/validation/secret_test.go +++ b/pkg/apis/ironcore/validation/secret_test.go @@ -1,4 +1,4 @@ -// Copyright 2022 OnMetal authors +// Copyright 2022 IronCore authors // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. diff --git a/pkg/apis/onmetal/validation/shoot.go b/pkg/apis/ironcore/validation/shoot.go similarity index 96% rename from pkg/apis/onmetal/validation/shoot.go rename to pkg/apis/ironcore/validation/shoot.go index f0069361..cda83e4e 100644 --- a/pkg/apis/onmetal/validation/shoot.go +++ b/pkg/apis/ironcore/validation/shoot.go @@ -1,4 +1,4 @@ -// Copyright 2022 OnMetal authors +// Copyright 2022 IronCore authors // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. @@ -27,7 +27,7 @@ func ValidateNetworking(networking *core.Networking, fldPath *field.Path) field. allErrs := field.ErrorList{} if networking == nil || networking.Nodes == nil { - allErrs = append(allErrs, field.Required(fldPath.Child("nodes"), "a nodes CIDR must be provided for onmetal shoots")) + allErrs = append(allErrs, field.Required(fldPath.Child("nodes"), "a nodes CIDR must be provided for ironcore shoots")) } return allErrs diff --git a/pkg/apis/onmetal/validation/validation_suite_test.go b/pkg/apis/ironcore/validation/validation_suite_test.go similarity index 100% rename from pkg/apis/onmetal/validation/validation_suite_test.go rename to pkg/apis/ironcore/validation/validation_suite_test.go diff --git a/pkg/apis/onmetal/zz_generated.deepcopy.go b/pkg/apis/ironcore/zz_generated.deepcopy.go similarity index 99% rename from pkg/apis/onmetal/zz_generated.deepcopy.go rename to pkg/apis/ironcore/zz_generated.deepcopy.go index 8f42805b..afaae337 100644 --- a/pkg/apis/onmetal/zz_generated.deepcopy.go +++ b/pkg/apis/ironcore/zz_generated.deepcopy.go @@ -2,7 +2,7 @@ // +build !ignore_autogenerated /* - * Copyright (c) 2021 by the OnMetal authors. + * Copyright (c) 2021 by the IronCore authors. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -18,7 +18,7 @@ */ // Code generated by deepcopy-gen. DO NOT EDIT. -package onmetal +package ironcore import ( v1 "k8s.io/api/core/v1" diff --git a/pkg/apis/onmetal/v1alpha1/zz_generated.conversion.go b/pkg/apis/onmetal/v1alpha1/zz_generated.conversion.go deleted file mode 100644 index c174fbec..00000000 --- a/pkg/apis/onmetal/v1alpha1/zz_generated.conversion.go +++ /dev/null @@ -1,432 +0,0 @@ -//go:build !ignore_autogenerated -// +build !ignore_autogenerated - -/* - * Copyright (c) 2021 by the OnMetal authors. - * - * 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. - */ -// Code generated by conversion-gen. DO NOT EDIT. - -package v1alpha1 - -import ( - unsafe "unsafe" - - onmetal "github.com/onmetal/gardener-extension-provider-onmetal/pkg/apis/onmetal" - v1 "k8s.io/api/core/v1" - conversion "k8s.io/apimachinery/pkg/conversion" - runtime "k8s.io/apimachinery/pkg/runtime" -) - -func init() { - localSchemeBuilder.Register(RegisterConversions) -} - -// RegisterConversions adds conversion functions to the given scheme. -// Public to allow building arbitrary schemes. -func RegisterConversions(s *runtime.Scheme) error { - if err := s.AddGeneratedConversionFunc((*CloudControllerManagerConfig)(nil), (*onmetal.CloudControllerManagerConfig)(nil), func(a, b interface{}, scope conversion.Scope) error { - return Convert_v1alpha1_CloudControllerManagerConfig_To_onmetal_CloudControllerManagerConfig(a.(*CloudControllerManagerConfig), b.(*onmetal.CloudControllerManagerConfig), scope) - }); err != nil { - return err - } - if err := s.AddGeneratedConversionFunc((*onmetal.CloudControllerManagerConfig)(nil), (*CloudControllerManagerConfig)(nil), func(a, b interface{}, scope conversion.Scope) error { - return Convert_onmetal_CloudControllerManagerConfig_To_v1alpha1_CloudControllerManagerConfig(a.(*onmetal.CloudControllerManagerConfig), b.(*CloudControllerManagerConfig), scope) - }); err != nil { - return err - } - if err := s.AddGeneratedConversionFunc((*CloudProfileConfig)(nil), (*onmetal.CloudProfileConfig)(nil), func(a, b interface{}, scope conversion.Scope) error { - return Convert_v1alpha1_CloudProfileConfig_To_onmetal_CloudProfileConfig(a.(*CloudProfileConfig), b.(*onmetal.CloudProfileConfig), scope) - }); err != nil { - return err - } - if err := s.AddGeneratedConversionFunc((*onmetal.CloudProfileConfig)(nil), (*CloudProfileConfig)(nil), func(a, b interface{}, scope conversion.Scope) error { - return Convert_onmetal_CloudProfileConfig_To_v1alpha1_CloudProfileConfig(a.(*onmetal.CloudProfileConfig), b.(*CloudProfileConfig), scope) - }); err != nil { - return err - } - if err := s.AddGeneratedConversionFunc((*ControlPlaneConfig)(nil), (*onmetal.ControlPlaneConfig)(nil), func(a, b interface{}, scope conversion.Scope) error { - return Convert_v1alpha1_ControlPlaneConfig_To_onmetal_ControlPlaneConfig(a.(*ControlPlaneConfig), b.(*onmetal.ControlPlaneConfig), scope) - }); err != nil { - return err - } - if err := s.AddGeneratedConversionFunc((*onmetal.ControlPlaneConfig)(nil), (*ControlPlaneConfig)(nil), func(a, b interface{}, scope conversion.Scope) error { - return Convert_onmetal_ControlPlaneConfig_To_v1alpha1_ControlPlaneConfig(a.(*onmetal.ControlPlaneConfig), b.(*ControlPlaneConfig), scope) - }); err != nil { - return err - } - if err := s.AddGeneratedConversionFunc((*InfrastructureConfig)(nil), (*onmetal.InfrastructureConfig)(nil), func(a, b interface{}, scope conversion.Scope) error { - return Convert_v1alpha1_InfrastructureConfig_To_onmetal_InfrastructureConfig(a.(*InfrastructureConfig), b.(*onmetal.InfrastructureConfig), scope) - }); err != nil { - return err - } - if err := s.AddGeneratedConversionFunc((*onmetal.InfrastructureConfig)(nil), (*InfrastructureConfig)(nil), func(a, b interface{}, scope conversion.Scope) error { - return Convert_onmetal_InfrastructureConfig_To_v1alpha1_InfrastructureConfig(a.(*onmetal.InfrastructureConfig), b.(*InfrastructureConfig), scope) - }); err != nil { - return err - } - if err := s.AddGeneratedConversionFunc((*InfrastructureStatus)(nil), (*onmetal.InfrastructureStatus)(nil), func(a, b interface{}, scope conversion.Scope) error { - return Convert_v1alpha1_InfrastructureStatus_To_onmetal_InfrastructureStatus(a.(*InfrastructureStatus), b.(*onmetal.InfrastructureStatus), scope) - }); err != nil { - return err - } - if err := s.AddGeneratedConversionFunc((*onmetal.InfrastructureStatus)(nil), (*InfrastructureStatus)(nil), func(a, b interface{}, scope conversion.Scope) error { - return Convert_onmetal_InfrastructureStatus_To_v1alpha1_InfrastructureStatus(a.(*onmetal.InfrastructureStatus), b.(*InfrastructureStatus), scope) - }); err != nil { - return err - } - if err := s.AddGeneratedConversionFunc((*MachineImage)(nil), (*onmetal.MachineImage)(nil), func(a, b interface{}, scope conversion.Scope) error { - return Convert_v1alpha1_MachineImage_To_onmetal_MachineImage(a.(*MachineImage), b.(*onmetal.MachineImage), scope) - }); err != nil { - return err - } - if err := s.AddGeneratedConversionFunc((*onmetal.MachineImage)(nil), (*MachineImage)(nil), func(a, b interface{}, scope conversion.Scope) error { - return Convert_onmetal_MachineImage_To_v1alpha1_MachineImage(a.(*onmetal.MachineImage), b.(*MachineImage), scope) - }); err != nil { - return err - } - if err := s.AddGeneratedConversionFunc((*MachineImageVersion)(nil), (*onmetal.MachineImageVersion)(nil), func(a, b interface{}, scope conversion.Scope) error { - return Convert_v1alpha1_MachineImageVersion_To_onmetal_MachineImageVersion(a.(*MachineImageVersion), b.(*onmetal.MachineImageVersion), scope) - }); err != nil { - return err - } - if err := s.AddGeneratedConversionFunc((*onmetal.MachineImageVersion)(nil), (*MachineImageVersion)(nil), func(a, b interface{}, scope conversion.Scope) error { - return Convert_onmetal_MachineImageVersion_To_v1alpha1_MachineImageVersion(a.(*onmetal.MachineImageVersion), b.(*MachineImageVersion), scope) - }); err != nil { - return err - } - if err := s.AddGeneratedConversionFunc((*MachineImages)(nil), (*onmetal.MachineImages)(nil), func(a, b interface{}, scope conversion.Scope) error { - return Convert_v1alpha1_MachineImages_To_onmetal_MachineImages(a.(*MachineImages), b.(*onmetal.MachineImages), scope) - }); err != nil { - return err - } - if err := s.AddGeneratedConversionFunc((*onmetal.MachineImages)(nil), (*MachineImages)(nil), func(a, b interface{}, scope conversion.Scope) error { - return Convert_onmetal_MachineImages_To_v1alpha1_MachineImages(a.(*onmetal.MachineImages), b.(*MachineImages), scope) - }); err != nil { - return err - } - if err := s.AddGeneratedConversionFunc((*RegionConfig)(nil), (*onmetal.RegionConfig)(nil), func(a, b interface{}, scope conversion.Scope) error { - return Convert_v1alpha1_RegionConfig_To_onmetal_RegionConfig(a.(*RegionConfig), b.(*onmetal.RegionConfig), scope) - }); err != nil { - return err - } - if err := s.AddGeneratedConversionFunc((*onmetal.RegionConfig)(nil), (*RegionConfig)(nil), func(a, b interface{}, scope conversion.Scope) error { - return Convert_onmetal_RegionConfig_To_v1alpha1_RegionConfig(a.(*onmetal.RegionConfig), b.(*RegionConfig), scope) - }); err != nil { - return err - } - if err := s.AddGeneratedConversionFunc((*StorageClass)(nil), (*onmetal.StorageClass)(nil), func(a, b interface{}, scope conversion.Scope) error { - return Convert_v1alpha1_StorageClass_To_onmetal_StorageClass(a.(*StorageClass), b.(*onmetal.StorageClass), scope) - }); err != nil { - return err - } - if err := s.AddGeneratedConversionFunc((*onmetal.StorageClass)(nil), (*StorageClass)(nil), func(a, b interface{}, scope conversion.Scope) error { - return Convert_onmetal_StorageClass_To_v1alpha1_StorageClass(a.(*onmetal.StorageClass), b.(*StorageClass), scope) - }); err != nil { - return err - } - if err := s.AddGeneratedConversionFunc((*StorageClasses)(nil), (*onmetal.StorageClasses)(nil), func(a, b interface{}, scope conversion.Scope) error { - return Convert_v1alpha1_StorageClasses_To_onmetal_StorageClasses(a.(*StorageClasses), b.(*onmetal.StorageClasses), scope) - }); err != nil { - return err - } - if err := s.AddGeneratedConversionFunc((*onmetal.StorageClasses)(nil), (*StorageClasses)(nil), func(a, b interface{}, scope conversion.Scope) error { - return Convert_onmetal_StorageClasses_To_v1alpha1_StorageClasses(a.(*onmetal.StorageClasses), b.(*StorageClasses), scope) - }); err != nil { - return err - } - if err := s.AddGeneratedConversionFunc((*WorkerStatus)(nil), (*onmetal.WorkerStatus)(nil), func(a, b interface{}, scope conversion.Scope) error { - return Convert_v1alpha1_WorkerStatus_To_onmetal_WorkerStatus(a.(*WorkerStatus), b.(*onmetal.WorkerStatus), scope) - }); err != nil { - return err - } - if err := s.AddGeneratedConversionFunc((*onmetal.WorkerStatus)(nil), (*WorkerStatus)(nil), func(a, b interface{}, scope conversion.Scope) error { - return Convert_onmetal_WorkerStatus_To_v1alpha1_WorkerStatus(a.(*onmetal.WorkerStatus), b.(*WorkerStatus), scope) - }); err != nil { - return err - } - return nil -} - -func autoConvert_v1alpha1_CloudControllerManagerConfig_To_onmetal_CloudControllerManagerConfig(in *CloudControllerManagerConfig, out *onmetal.CloudControllerManagerConfig, s conversion.Scope) error { - out.FeatureGates = *(*map[string]bool)(unsafe.Pointer(&in.FeatureGates)) - return nil -} - -// Convert_v1alpha1_CloudControllerManagerConfig_To_onmetal_CloudControllerManagerConfig is an autogenerated conversion function. -func Convert_v1alpha1_CloudControllerManagerConfig_To_onmetal_CloudControllerManagerConfig(in *CloudControllerManagerConfig, out *onmetal.CloudControllerManagerConfig, s conversion.Scope) error { - return autoConvert_v1alpha1_CloudControllerManagerConfig_To_onmetal_CloudControllerManagerConfig(in, out, s) -} - -func autoConvert_onmetal_CloudControllerManagerConfig_To_v1alpha1_CloudControllerManagerConfig(in *onmetal.CloudControllerManagerConfig, out *CloudControllerManagerConfig, s conversion.Scope) error { - out.FeatureGates = *(*map[string]bool)(unsafe.Pointer(&in.FeatureGates)) - return nil -} - -// Convert_onmetal_CloudControllerManagerConfig_To_v1alpha1_CloudControllerManagerConfig is an autogenerated conversion function. -func Convert_onmetal_CloudControllerManagerConfig_To_v1alpha1_CloudControllerManagerConfig(in *onmetal.CloudControllerManagerConfig, out *CloudControllerManagerConfig, s conversion.Scope) error { - return autoConvert_onmetal_CloudControllerManagerConfig_To_v1alpha1_CloudControllerManagerConfig(in, out, s) -} - -func autoConvert_v1alpha1_CloudProfileConfig_To_onmetal_CloudProfileConfig(in *CloudProfileConfig, out *onmetal.CloudProfileConfig, s conversion.Scope) error { - out.MachineImages = *(*[]onmetal.MachineImages)(unsafe.Pointer(&in.MachineImages)) - out.RegionConfigs = *(*[]onmetal.RegionConfig)(unsafe.Pointer(&in.RegionConfigs)) - if err := Convert_v1alpha1_StorageClasses_To_onmetal_StorageClasses(&in.StorageClasses, &out.StorageClasses, s); err != nil { - return err - } - return nil -} - -// Convert_v1alpha1_CloudProfileConfig_To_onmetal_CloudProfileConfig is an autogenerated conversion function. -func Convert_v1alpha1_CloudProfileConfig_To_onmetal_CloudProfileConfig(in *CloudProfileConfig, out *onmetal.CloudProfileConfig, s conversion.Scope) error { - return autoConvert_v1alpha1_CloudProfileConfig_To_onmetal_CloudProfileConfig(in, out, s) -} - -func autoConvert_onmetal_CloudProfileConfig_To_v1alpha1_CloudProfileConfig(in *onmetal.CloudProfileConfig, out *CloudProfileConfig, s conversion.Scope) error { - out.MachineImages = *(*[]MachineImages)(unsafe.Pointer(&in.MachineImages)) - out.RegionConfigs = *(*[]RegionConfig)(unsafe.Pointer(&in.RegionConfigs)) - if err := Convert_onmetal_StorageClasses_To_v1alpha1_StorageClasses(&in.StorageClasses, &out.StorageClasses, s); err != nil { - return err - } - return nil -} - -// Convert_onmetal_CloudProfileConfig_To_v1alpha1_CloudProfileConfig is an autogenerated conversion function. -func Convert_onmetal_CloudProfileConfig_To_v1alpha1_CloudProfileConfig(in *onmetal.CloudProfileConfig, out *CloudProfileConfig, s conversion.Scope) error { - return autoConvert_onmetal_CloudProfileConfig_To_v1alpha1_CloudProfileConfig(in, out, s) -} - -func autoConvert_v1alpha1_ControlPlaneConfig_To_onmetal_ControlPlaneConfig(in *ControlPlaneConfig, out *onmetal.ControlPlaneConfig, s conversion.Scope) error { - out.CloudControllerManager = (*onmetal.CloudControllerManagerConfig)(unsafe.Pointer(in.CloudControllerManager)) - return nil -} - -// Convert_v1alpha1_ControlPlaneConfig_To_onmetal_ControlPlaneConfig is an autogenerated conversion function. -func Convert_v1alpha1_ControlPlaneConfig_To_onmetal_ControlPlaneConfig(in *ControlPlaneConfig, out *onmetal.ControlPlaneConfig, s conversion.Scope) error { - return autoConvert_v1alpha1_ControlPlaneConfig_To_onmetal_ControlPlaneConfig(in, out, s) -} - -func autoConvert_onmetal_ControlPlaneConfig_To_v1alpha1_ControlPlaneConfig(in *onmetal.ControlPlaneConfig, out *ControlPlaneConfig, s conversion.Scope) error { - out.CloudControllerManager = (*CloudControllerManagerConfig)(unsafe.Pointer(in.CloudControllerManager)) - return nil -} - -// Convert_onmetal_ControlPlaneConfig_To_v1alpha1_ControlPlaneConfig is an autogenerated conversion function. -func Convert_onmetal_ControlPlaneConfig_To_v1alpha1_ControlPlaneConfig(in *onmetal.ControlPlaneConfig, out *ControlPlaneConfig, s conversion.Scope) error { - return autoConvert_onmetal_ControlPlaneConfig_To_v1alpha1_ControlPlaneConfig(in, out, s) -} - -func autoConvert_v1alpha1_InfrastructureConfig_To_onmetal_InfrastructureConfig(in *InfrastructureConfig, out *onmetal.InfrastructureConfig, s conversion.Scope) error { - out.NetworkRef = (*v1.LocalObjectReference)(unsafe.Pointer(in.NetworkRef)) - return nil -} - -// Convert_v1alpha1_InfrastructureConfig_To_onmetal_InfrastructureConfig is an autogenerated conversion function. -func Convert_v1alpha1_InfrastructureConfig_To_onmetal_InfrastructureConfig(in *InfrastructureConfig, out *onmetal.InfrastructureConfig, s conversion.Scope) error { - return autoConvert_v1alpha1_InfrastructureConfig_To_onmetal_InfrastructureConfig(in, out, s) -} - -func autoConvert_onmetal_InfrastructureConfig_To_v1alpha1_InfrastructureConfig(in *onmetal.InfrastructureConfig, out *InfrastructureConfig, s conversion.Scope) error { - out.NetworkRef = (*v1.LocalObjectReference)(unsafe.Pointer(in.NetworkRef)) - return nil -} - -// Convert_onmetal_InfrastructureConfig_To_v1alpha1_InfrastructureConfig is an autogenerated conversion function. -func Convert_onmetal_InfrastructureConfig_To_v1alpha1_InfrastructureConfig(in *onmetal.InfrastructureConfig, out *InfrastructureConfig, s conversion.Scope) error { - return autoConvert_onmetal_InfrastructureConfig_To_v1alpha1_InfrastructureConfig(in, out, s) -} - -func autoConvert_v1alpha1_InfrastructureStatus_To_onmetal_InfrastructureStatus(in *InfrastructureStatus, out *onmetal.InfrastructureStatus, s conversion.Scope) error { - out.NetworkRef = in.NetworkRef - out.NATGatewayRef = in.NATGatewayRef - out.PrefixRef = in.PrefixRef - return nil -} - -// Convert_v1alpha1_InfrastructureStatus_To_onmetal_InfrastructureStatus is an autogenerated conversion function. -func Convert_v1alpha1_InfrastructureStatus_To_onmetal_InfrastructureStatus(in *InfrastructureStatus, out *onmetal.InfrastructureStatus, s conversion.Scope) error { - return autoConvert_v1alpha1_InfrastructureStatus_To_onmetal_InfrastructureStatus(in, out, s) -} - -func autoConvert_onmetal_InfrastructureStatus_To_v1alpha1_InfrastructureStatus(in *onmetal.InfrastructureStatus, out *InfrastructureStatus, s conversion.Scope) error { - out.NetworkRef = in.NetworkRef - out.NATGatewayRef = in.NATGatewayRef - out.PrefixRef = in.PrefixRef - return nil -} - -// Convert_onmetal_InfrastructureStatus_To_v1alpha1_InfrastructureStatus is an autogenerated conversion function. -func Convert_onmetal_InfrastructureStatus_To_v1alpha1_InfrastructureStatus(in *onmetal.InfrastructureStatus, out *InfrastructureStatus, s conversion.Scope) error { - return autoConvert_onmetal_InfrastructureStatus_To_v1alpha1_InfrastructureStatus(in, out, s) -} - -func autoConvert_v1alpha1_MachineImage_To_onmetal_MachineImage(in *MachineImage, out *onmetal.MachineImage, s conversion.Scope) error { - out.Name = in.Name - out.Version = in.Version - out.Image = in.Image - out.Architecture = (*string)(unsafe.Pointer(in.Architecture)) - return nil -} - -// Convert_v1alpha1_MachineImage_To_onmetal_MachineImage is an autogenerated conversion function. -func Convert_v1alpha1_MachineImage_To_onmetal_MachineImage(in *MachineImage, out *onmetal.MachineImage, s conversion.Scope) error { - return autoConvert_v1alpha1_MachineImage_To_onmetal_MachineImage(in, out, s) -} - -func autoConvert_onmetal_MachineImage_To_v1alpha1_MachineImage(in *onmetal.MachineImage, out *MachineImage, s conversion.Scope) error { - out.Name = in.Name - out.Version = in.Version - out.Image = in.Image - out.Architecture = (*string)(unsafe.Pointer(in.Architecture)) - return nil -} - -// Convert_onmetal_MachineImage_To_v1alpha1_MachineImage is an autogenerated conversion function. -func Convert_onmetal_MachineImage_To_v1alpha1_MachineImage(in *onmetal.MachineImage, out *MachineImage, s conversion.Scope) error { - return autoConvert_onmetal_MachineImage_To_v1alpha1_MachineImage(in, out, s) -} - -func autoConvert_v1alpha1_MachineImageVersion_To_onmetal_MachineImageVersion(in *MachineImageVersion, out *onmetal.MachineImageVersion, s conversion.Scope) error { - out.Version = in.Version - out.Image = in.Image - out.Architecture = (*string)(unsafe.Pointer(in.Architecture)) - return nil -} - -// Convert_v1alpha1_MachineImageVersion_To_onmetal_MachineImageVersion is an autogenerated conversion function. -func Convert_v1alpha1_MachineImageVersion_To_onmetal_MachineImageVersion(in *MachineImageVersion, out *onmetal.MachineImageVersion, s conversion.Scope) error { - return autoConvert_v1alpha1_MachineImageVersion_To_onmetal_MachineImageVersion(in, out, s) -} - -func autoConvert_onmetal_MachineImageVersion_To_v1alpha1_MachineImageVersion(in *onmetal.MachineImageVersion, out *MachineImageVersion, s conversion.Scope) error { - out.Version = in.Version - out.Image = in.Image - out.Architecture = (*string)(unsafe.Pointer(in.Architecture)) - return nil -} - -// Convert_onmetal_MachineImageVersion_To_v1alpha1_MachineImageVersion is an autogenerated conversion function. -func Convert_onmetal_MachineImageVersion_To_v1alpha1_MachineImageVersion(in *onmetal.MachineImageVersion, out *MachineImageVersion, s conversion.Scope) error { - return autoConvert_onmetal_MachineImageVersion_To_v1alpha1_MachineImageVersion(in, out, s) -} - -func autoConvert_v1alpha1_MachineImages_To_onmetal_MachineImages(in *MachineImages, out *onmetal.MachineImages, s conversion.Scope) error { - out.Name = in.Name - out.Versions = *(*[]onmetal.MachineImageVersion)(unsafe.Pointer(&in.Versions)) - return nil -} - -// Convert_v1alpha1_MachineImages_To_onmetal_MachineImages is an autogenerated conversion function. -func Convert_v1alpha1_MachineImages_To_onmetal_MachineImages(in *MachineImages, out *onmetal.MachineImages, s conversion.Scope) error { - return autoConvert_v1alpha1_MachineImages_To_onmetal_MachineImages(in, out, s) -} - -func autoConvert_onmetal_MachineImages_To_v1alpha1_MachineImages(in *onmetal.MachineImages, out *MachineImages, s conversion.Scope) error { - out.Name = in.Name - out.Versions = *(*[]MachineImageVersion)(unsafe.Pointer(&in.Versions)) - return nil -} - -// Convert_onmetal_MachineImages_To_v1alpha1_MachineImages is an autogenerated conversion function. -func Convert_onmetal_MachineImages_To_v1alpha1_MachineImages(in *onmetal.MachineImages, out *MachineImages, s conversion.Scope) error { - return autoConvert_onmetal_MachineImages_To_v1alpha1_MachineImages(in, out, s) -} - -func autoConvert_v1alpha1_RegionConfig_To_onmetal_RegionConfig(in *RegionConfig, out *onmetal.RegionConfig, s conversion.Scope) error { - out.Name = in.Name - out.Server = in.Server - out.CertificateAuthorityData = *(*[]byte)(unsafe.Pointer(&in.CertificateAuthorityData)) - return nil -} - -// Convert_v1alpha1_RegionConfig_To_onmetal_RegionConfig is an autogenerated conversion function. -func Convert_v1alpha1_RegionConfig_To_onmetal_RegionConfig(in *RegionConfig, out *onmetal.RegionConfig, s conversion.Scope) error { - return autoConvert_v1alpha1_RegionConfig_To_onmetal_RegionConfig(in, out, s) -} - -func autoConvert_onmetal_RegionConfig_To_v1alpha1_RegionConfig(in *onmetal.RegionConfig, out *RegionConfig, s conversion.Scope) error { - out.Name = in.Name - out.Server = in.Server - out.CertificateAuthorityData = *(*[]byte)(unsafe.Pointer(&in.CertificateAuthorityData)) - return nil -} - -// Convert_onmetal_RegionConfig_To_v1alpha1_RegionConfig is an autogenerated conversion function. -func Convert_onmetal_RegionConfig_To_v1alpha1_RegionConfig(in *onmetal.RegionConfig, out *RegionConfig, s conversion.Scope) error { - return autoConvert_onmetal_RegionConfig_To_v1alpha1_RegionConfig(in, out, s) -} - -func autoConvert_v1alpha1_StorageClass_To_onmetal_StorageClass(in *StorageClass, out *onmetal.StorageClass, s conversion.Scope) error { - out.Name = in.Name - out.Type = in.Type - return nil -} - -// Convert_v1alpha1_StorageClass_To_onmetal_StorageClass is an autogenerated conversion function. -func Convert_v1alpha1_StorageClass_To_onmetal_StorageClass(in *StorageClass, out *onmetal.StorageClass, s conversion.Scope) error { - return autoConvert_v1alpha1_StorageClass_To_onmetal_StorageClass(in, out, s) -} - -func autoConvert_onmetal_StorageClass_To_v1alpha1_StorageClass(in *onmetal.StorageClass, out *StorageClass, s conversion.Scope) error { - out.Name = in.Name - out.Type = in.Type - return nil -} - -// Convert_onmetal_StorageClass_To_v1alpha1_StorageClass is an autogenerated conversion function. -func Convert_onmetal_StorageClass_To_v1alpha1_StorageClass(in *onmetal.StorageClass, out *StorageClass, s conversion.Scope) error { - return autoConvert_onmetal_StorageClass_To_v1alpha1_StorageClass(in, out, s) -} - -func autoConvert_v1alpha1_StorageClasses_To_onmetal_StorageClasses(in *StorageClasses, out *onmetal.StorageClasses, s conversion.Scope) error { - out.Default = (*onmetal.StorageClass)(unsafe.Pointer(in.Default)) - out.Additional = *(*[]onmetal.StorageClass)(unsafe.Pointer(&in.Additional)) - return nil -} - -// Convert_v1alpha1_StorageClasses_To_onmetal_StorageClasses is an autogenerated conversion function. -func Convert_v1alpha1_StorageClasses_To_onmetal_StorageClasses(in *StorageClasses, out *onmetal.StorageClasses, s conversion.Scope) error { - return autoConvert_v1alpha1_StorageClasses_To_onmetal_StorageClasses(in, out, s) -} - -func autoConvert_onmetal_StorageClasses_To_v1alpha1_StorageClasses(in *onmetal.StorageClasses, out *StorageClasses, s conversion.Scope) error { - out.Default = (*StorageClass)(unsafe.Pointer(in.Default)) - out.Additional = *(*[]StorageClass)(unsafe.Pointer(&in.Additional)) - return nil -} - -// Convert_onmetal_StorageClasses_To_v1alpha1_StorageClasses is an autogenerated conversion function. -func Convert_onmetal_StorageClasses_To_v1alpha1_StorageClasses(in *onmetal.StorageClasses, out *StorageClasses, s conversion.Scope) error { - return autoConvert_onmetal_StorageClasses_To_v1alpha1_StorageClasses(in, out, s) -} - -func autoConvert_v1alpha1_WorkerStatus_To_onmetal_WorkerStatus(in *WorkerStatus, out *onmetal.WorkerStatus, s conversion.Scope) error { - out.MachineImages = *(*[]onmetal.MachineImage)(unsafe.Pointer(&in.MachineImages)) - return nil -} - -// Convert_v1alpha1_WorkerStatus_To_onmetal_WorkerStatus is an autogenerated conversion function. -func Convert_v1alpha1_WorkerStatus_To_onmetal_WorkerStatus(in *WorkerStatus, out *onmetal.WorkerStatus, s conversion.Scope) error { - return autoConvert_v1alpha1_WorkerStatus_To_onmetal_WorkerStatus(in, out, s) -} - -func autoConvert_onmetal_WorkerStatus_To_v1alpha1_WorkerStatus(in *onmetal.WorkerStatus, out *WorkerStatus, s conversion.Scope) error { - out.MachineImages = *(*[]MachineImage)(unsafe.Pointer(&in.MachineImages)) - return nil -} - -// Convert_onmetal_WorkerStatus_To_v1alpha1_WorkerStatus is an autogenerated conversion function. -func Convert_onmetal_WorkerStatus_To_v1alpha1_WorkerStatus(in *onmetal.WorkerStatus, out *WorkerStatus, s conversion.Scope) error { - return autoConvert_onmetal_WorkerStatus_To_v1alpha1_WorkerStatus(in, out, s) -} diff --git a/pkg/cmd/config.go b/pkg/cmd/config.go index e41fe0a6..10210f2e 100644 --- a/pkg/cmd/config.go +++ b/pkg/cmd/config.go @@ -1,4 +1,4 @@ -// Copyright 2022 OnMetal authors +// Copyright 2022 IronCore authors // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. @@ -20,8 +20,8 @@ import ( healthcheckconfig "github.com/gardener/gardener/extensions/pkg/apis/config" "github.com/spf13/pflag" - "github.com/onmetal/gardener-extension-provider-onmetal/pkg/apis/config" - configloader "github.com/onmetal/gardener-extension-provider-onmetal/pkg/apis/config/loader" + "github.com/ironcore-dev/gardener-extension-provider-ironcore/pkg/apis/config" + configloader "github.com/ironcore-dev/gardener-extension-provider-ironcore/pkg/apis/config/loader" ) // ConfigOptions are command line options that can be set for config.ControllerConfiguration. diff --git a/pkg/cmd/options.go b/pkg/cmd/options.go index 82c9c391..5292f5b4 100644 --- a/pkg/cmd/options.go +++ b/pkg/cmd/options.go @@ -1,4 +1,4 @@ -// Copyright 2022 OnMetal authors +// Copyright 2022 IronCore authors // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. @@ -27,15 +27,15 @@ import ( extensionscloudproviderwebhook "github.com/gardener/gardener/extensions/pkg/webhook/cloudprovider" webhookcmd "github.com/gardener/gardener/extensions/pkg/webhook/cmd" extensioncontrolplanewebhook "github.com/gardener/gardener/extensions/pkg/webhook/controlplane" - backupbucketcontroller "github.com/onmetal/gardener-extension-provider-onmetal/pkg/controller/backupbucket" - backupentrycontroller "github.com/onmetal/gardener-extension-provider-onmetal/pkg/controller/backupentry" - bastioncontroller "github.com/onmetal/gardener-extension-provider-onmetal/pkg/controller/bastion" - controlplanecontroller "github.com/onmetal/gardener-extension-provider-onmetal/pkg/controller/controlplane" - healthcheckcontroller "github.com/onmetal/gardener-extension-provider-onmetal/pkg/controller/healthcheck" - infrastructurecontroller "github.com/onmetal/gardener-extension-provider-onmetal/pkg/controller/infrastructure" - workercontroller "github.com/onmetal/gardener-extension-provider-onmetal/pkg/controller/worker" - cloudproviderwebhook "github.com/onmetal/gardener-extension-provider-onmetal/pkg/webhook/cloudprovider" - controlplanewebhook "github.com/onmetal/gardener-extension-provider-onmetal/pkg/webhook/controlplane" + backupbucketcontroller "github.com/ironcore-dev/gardener-extension-provider-ironcore/pkg/controller/backupbucket" + backupentrycontroller "github.com/ironcore-dev/gardener-extension-provider-ironcore/pkg/controller/backupentry" + bastioncontroller "github.com/ironcore-dev/gardener-extension-provider-ironcore/pkg/controller/bastion" + controlplanecontroller "github.com/ironcore-dev/gardener-extension-provider-ironcore/pkg/controller/controlplane" + healthcheckcontroller "github.com/ironcore-dev/gardener-extension-provider-ironcore/pkg/controller/healthcheck" + infrastructurecontroller "github.com/ironcore-dev/gardener-extension-provider-ironcore/pkg/controller/infrastructure" + workercontroller "github.com/ironcore-dev/gardener-extension-provider-ironcore/pkg/controller/worker" + cloudproviderwebhook "github.com/ironcore-dev/gardener-extension-provider-ironcore/pkg/webhook/cloudprovider" + controlplanewebhook "github.com/ironcore-dev/gardener-extension-provider-ironcore/pkg/webhook/controlplane" ) // ControllerSwitchOptions are the controllercmd.SwitchOptions for the provider controllers. diff --git a/pkg/controller/backupbucket/actuator.go b/pkg/controller/backupbucket/actuator.go index 512049d2..6120c604 100644 --- a/pkg/controller/backupbucket/actuator.go +++ b/pkg/controller/backupbucket/actuator.go @@ -1,4 +1,4 @@ -// Copyright 2023 OnMetal authors +// Copyright 2023 IronCore authors // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. @@ -21,9 +21,9 @@ import ( "github.com/gardener/gardener/extensions/pkg/controller/backupbucket" extensionsv1alpha1 "github.com/gardener/gardener/pkg/apis/extensions/v1alpha1" "github.com/go-logr/logr" - controllerconfig "github.com/onmetal/gardener-extension-provider-onmetal/pkg/apis/config" - "github.com/onmetal/gardener-extension-provider-onmetal/pkg/onmetal" - storagev1alpha1 "github.com/onmetal/onmetal-api/api/storage/v1alpha1" + controllerconfig "github.com/ironcore-dev/gardener-extension-provider-ironcore/pkg/apis/config" + "github.com/ironcore-dev/gardener-extension-provider-ironcore/pkg/ironcore" + storagev1alpha1 "github.com/ironcore-dev/ironcore/api/storage/v1alpha1" metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" "sigs.k8s.io/controller-runtime/pkg/client" "sigs.k8s.io/controller-runtime/pkg/manager" @@ -45,9 +45,9 @@ func newActuator(mgr manager.Manager, backupBucketConfig *controllerconfig.Backu func (a *actuator) Reconcile(ctx context.Context, log logr.Logger, backupBucket *extensionsv1alpha1.BackupBucket) error { log.V(2).Info("Reconciling BackupBucket") - onmetalClient, namespace, err := onmetal.GetOnmetalClientAndNamespaceFromSecretRef(ctx, a.client, &backupBucket.Spec.SecretRef) + ironcoreClient, namespace, err := ironcore.GetIroncoreClientAndNamespaceFromSecretRef(ctx, a.client, &backupBucket.Spec.SecretRef) if err != nil { - return fmt.Errorf("failed to get onmetal client and namespace from cloudprovider secret: %w", err) + return fmt.Errorf("failed to get ironcore client and namespace from cloudprovider secret: %w", err) } // If the generated secret in the backupbucket status not exists that means @@ -57,7 +57,7 @@ func (a *actuator) Reconcile(ctx context.Context, log logr.Logger, backupBucket return fmt.Errorf("failed to validate configuration: %w", err) } - if err := a.ensureBackupBucket(ctx, namespace, onmetalClient, backupBucket); err != nil { + if err := a.ensureBackupBucket(ctx, namespace, ironcoreClient, backupBucket); err != nil { return fmt.Errorf("failed to ensure backupbucket: %w", err) } } @@ -67,9 +67,9 @@ func (a *actuator) Reconcile(ctx context.Context, log logr.Logger, backupBucket func (a *actuator) Delete(ctx context.Context, log logr.Logger, backupBucket *extensionsv1alpha1.BackupBucket) error { log.V(2).Info("Deleting BackupBucket") - onmetalClient, namespace, err := onmetal.GetOnmetalClientAndNamespaceFromSecretRef(ctx, a.client, &backupBucket.Spec.SecretRef) + ironcoreClient, namespace, err := ironcore.GetIroncoreClientAndNamespaceFromSecretRef(ctx, a.client, &backupBucket.Spec.SecretRef) if err != nil { - return fmt.Errorf("failed to get onmetal client and namespace from cloudprovider secret: %w", err) + return fmt.Errorf("failed to get ironcore client and namespace from cloudprovider secret: %w", err) } bucket := &storagev1alpha1.Bucket{ @@ -78,7 +78,7 @@ func (a *actuator) Delete(ctx context.Context, log logr.Logger, backupBucket *ex Namespace: namespace, }, } - if err = onmetalClient.Delete(ctx, bucket); err != nil { + if err = ironcoreClient.Delete(ctx, bucket); err != nil { return fmt.Errorf("failed to delete backup bucket: %v", err) } diff --git a/pkg/controller/backupbucket/actuator_test.go b/pkg/controller/backupbucket/actuator_test.go index ff6d9da8..b2032224 100644 --- a/pkg/controller/backupbucket/actuator_test.go +++ b/pkg/controller/backupbucket/actuator_test.go @@ -1,4 +1,4 @@ -// Copyright 2023 OnMetal authors +// Copyright 2023 IronCore authors // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. @@ -26,9 +26,9 @@ import ( apierrors "k8s.io/apimachinery/pkg/api/errors" - controllerconfig "github.com/onmetal/gardener-extension-provider-onmetal/pkg/apis/config" - "github.com/onmetal/gardener-extension-provider-onmetal/pkg/onmetal" - storagev1alpha1 "github.com/onmetal/onmetal-api/api/storage/v1alpha1" + controllerconfig "github.com/ironcore-dev/gardener-extension-provider-ironcore/pkg/apis/config" + "github.com/ironcore-dev/gardener-extension-provider-ironcore/pkg/ironcore" + storagev1alpha1 "github.com/ironcore-dev/ironcore/api/storage/v1alpha1" metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" ) @@ -49,7 +49,7 @@ var _ = Describe("Backupbucket Reconcile", Ordered, func() { }, Spec: extensionsv1alpha1.BackupBucketSpec{ DefaultSpec: extensionsv1alpha1.DefaultSpec{ - Type: onmetal.Type, + Type: ironcore.Type, ProviderConfig: nil, }, Region: "europe-central", diff --git a/pkg/controller/backupbucket/add.go b/pkg/controller/backupbucket/add.go index 105264eb..a883ee80 100644 --- a/pkg/controller/backupbucket/add.go +++ b/pkg/controller/backupbucket/add.go @@ -1,4 +1,4 @@ -// Copyright 2023 OnMetal authors +// Copyright 2023 IronCore authors // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. @@ -18,8 +18,8 @@ import ( "context" "github.com/gardener/gardener/extensions/pkg/controller/backupbucket" - controllerconfig "github.com/onmetal/gardener-extension-provider-onmetal/pkg/apis/config" - "github.com/onmetal/gardener-extension-provider-onmetal/pkg/onmetal" + controllerconfig "github.com/ironcore-dev/gardener-extension-provider-ironcore/pkg/apis/config" + "github.com/ironcore-dev/gardener-extension-provider-ironcore/pkg/ironcore" "sigs.k8s.io/controller-runtime/pkg/controller" "sigs.k8s.io/controller-runtime/pkg/manager" ) @@ -29,7 +29,7 @@ var ( DefaultAddOptions = AddOptions{} ) -// AddOptions are options to apply when adding the onmetal backupbucket controller to the manager. +// AddOptions are options to apply when adding the ironcore backupbucket controller to the manager. type AddOptions struct { // Controller are the controller.Options. Controller controller.Options @@ -46,7 +46,7 @@ func AddToManagerWithOptions(ctx context.Context, mgr manager.Manager, opts AddO Actuator: newActuator(mgr, &opts.BackupBucketConfig), ControllerOptions: opts.Controller, Predicates: backupbucket.DefaultPredicates(opts.IgnoreOperationAnnotation), - Type: onmetal.Type, + Type: ironcore.Type, }) } diff --git a/pkg/controller/backupbucket/backupbucket.go b/pkg/controller/backupbucket/backupbucket.go index ab7886a4..0f0811cd 100644 --- a/pkg/controller/backupbucket/backupbucket.go +++ b/pkg/controller/backupbucket/backupbucket.go @@ -1,4 +1,4 @@ -// Copyright 2023 OnMetal authors +// Copyright 2023 IronCore authors // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. @@ -27,9 +27,9 @@ import ( "sigs.k8s.io/controller-runtime/pkg/client" "sigs.k8s.io/controller-runtime/pkg/controller/controllerutil" - controllerconfig "github.com/onmetal/gardener-extension-provider-onmetal/pkg/apis/config" - "github.com/onmetal/gardener-extension-provider-onmetal/pkg/onmetal" - storagev1alpha1 "github.com/onmetal/onmetal-api/api/storage/v1alpha1" + controllerconfig "github.com/ironcore-dev/gardener-extension-provider-ironcore/pkg/apis/config" + "github.com/ironcore-dev/gardener-extension-provider-ironcore/pkg/ironcore" + storagev1alpha1 "github.com/ironcore-dev/ironcore/api/storage/v1alpha1" ) const ( @@ -38,8 +38,8 @@ const ( waitBucketActiveSteps = 19 ) -// ensureBackupBucket creates onmetal backupBucket object and returns access to bucket -func (a *actuator) ensureBackupBucket(ctx context.Context, namespace string, onmetalClient client.Client, backupBucket *extensionsv1alpha1.BackupBucket) error { +// ensureBackupBucket creates ironcore backupBucket object and returns access to bucket +func (a *actuator) ensureBackupBucket(ctx context.Context, namespace string, ironcoreClient client.Client, backupBucket *extensionsv1alpha1.BackupBucket) error { bucket := &storagev1alpha1.Bucket{ ObjectMeta: metav1.ObjectMeta{ Name: backupBucket.Name, @@ -51,17 +51,17 @@ func (a *actuator) ensureBackupBucket(ctx context.Context, namespace string, onm }, }, } - //create onmetal bucket - if _, err := controllerutil.CreateOrPatch(ctx, onmetalClient, bucket, nil); err != nil { + //create ironcore bucket + if _, err := controllerutil.CreateOrPatch(ctx, ironcoreClient, bucket, nil); err != nil { return fmt.Errorf("failed to create or patch backup bucket %s: %w", client.ObjectKeyFromObject(bucket), err) } //wait for bucket creation - if err := waitBackupBucketToAvailable(ctx, onmetalClient, bucket); err != nil { + if err := waitBackupBucketToAvailable(ctx, ironcoreClient, bucket); err != nil { return fmt.Errorf("could not determine status of backup bucket %w", err) } accessSecret := &corev1.Secret{} - if err := onmetalClient.Get(ctx, client.ObjectKey{Namespace: namespace, Name: bucket.Status.Access.SecretRef.Name}, accessSecret); err != nil { + if err := ironcoreClient.Get(ctx, client.ObjectKey{Namespace: namespace, Name: bucket.Status.Access.SecretRef.Name}, accessSecret); err != nil { return fmt.Errorf("failed to get bucket access secret %s: %w", client.ObjectKeyFromObject(accessSecret), err) } //update backupBucket secret @@ -71,7 +71,7 @@ func (a *actuator) ensureBackupBucket(ctx context.Context, namespace string, onm return nil } -func waitBackupBucketToAvailable(ctx context.Context, onmetalClient client.Client, bucket *storagev1alpha1.Bucket) error { +func waitBackupBucketToAvailable(ctx context.Context, ironcoreClient client.Client, bucket *storagev1alpha1.Bucket) error { backoff := wait.Backoff{ Duration: waitBucketInitDelay, Factor: waitBucketFactor, @@ -79,7 +79,7 @@ func waitBackupBucketToAvailable(ctx context.Context, onmetalClient client.Clien } err := wait.ExponentialBackoffWithContext(ctx, backoff, func(ctx context.Context) (bool, error) { - err := onmetalClient.Get(ctx, client.ObjectKey{Namespace: bucket.Namespace, Name: bucket.Name}, bucket) + err := ironcoreClient.Get(ctx, client.ObjectKey{Namespace: bucket.Namespace, Name: bucket.Name}, bucket) if err == nil && bucket.Status.State == storagev1alpha1.BucketStateAvailable && isBucketAccessDetailsAvailable(bucket) { return true, nil } @@ -87,7 +87,7 @@ func waitBackupBucketToAvailable(ctx context.Context, onmetalClient client.Clien }) if wait.Interrupted(err) { - return fmt.Errorf("timeout waiting for the onmetal Bucket %s status: %w", client.ObjectKeyFromObject(bucket), err) + return fmt.Errorf("timeout waiting for the ironcore Bucket %s status: %w", client.ObjectKeyFromObject(bucket), err) } return err @@ -103,20 +103,20 @@ func (a *actuator) patchBackupBucketStatus(ctx context.Context, backupBucket *ex return fmt.Errorf("secret does not contain any data") } - accessKeyID, ok := secretData[onmetal.BucketAccessKeyID] + accessKeyID, ok := secretData[ironcore.BucketAccessKeyID] if !ok { - return fmt.Errorf("missing %q field in secret", onmetal.BucketAccessKeyID) + return fmt.Errorf("missing %q field in secret", ironcore.BucketAccessKeyID) } - secretAccessKey, ok := secretData[onmetal.BucketSecretAccessKey] + secretAccessKey, ok := secretData[ironcore.BucketSecretAccessKey] if !ok { - return fmt.Errorf("missing %q field in secret", onmetal.BucketSecretAccessKey) + return fmt.Errorf("missing %q field in secret", ironcore.BucketSecretAccessKey) } accessSecretData := map[string][]byte{} - accessSecretData[onmetal.AccessKeyID] = []byte(accessKeyID) - accessSecretData[onmetal.SecretAccessKey] = []byte(secretAccessKey) - accessSecretData[onmetal.Endpoint] = []byte(endpoint) + accessSecretData[ironcore.AccessKeyID] = []byte(accessKeyID) + accessSecretData[ironcore.SecretAccessKey] = []byte(secretAccessKey) + accessSecretData[ironcore.Endpoint] = []byte(endpoint) patch := client.MergeFrom(backupBucket.DeepCopy()) diff --git a/pkg/controller/backupbucket/suite_test.go b/pkg/controller/backupbucket/suite_test.go index aea8a0a4..887ec288 100644 --- a/pkg/controller/backupbucket/suite_test.go +++ b/pkg/controller/backupbucket/suite_test.go @@ -1,4 +1,4 @@ -// Copyright 2022 OnMetal authors +// Copyright 2022 IronCore authors // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. @@ -30,12 +30,12 @@ import ( "k8s.io/apimachinery/pkg/api/resource" metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" - "github.com/onmetal/controller-utils/buildutils" - "github.com/onmetal/controller-utils/modutils" - corev1alpha1 "github.com/onmetal/onmetal-api/api/core/v1alpha1" - storagev1alpha1 "github.com/onmetal/onmetal-api/api/storage/v1alpha1" - utilsenvtest "github.com/onmetal/onmetal-api/utils/envtest" - "github.com/onmetal/onmetal-api/utils/envtest/apiserver" + "github.com/ironcore-dev/controller-utils/buildutils" + "github.com/ironcore-dev/controller-utils/modutils" + corev1alpha1 "github.com/ironcore-dev/ironcore/api/core/v1alpha1" + storagev1alpha1 "github.com/ironcore-dev/ironcore/api/storage/v1alpha1" + utilsenvtest "github.com/ironcore-dev/ironcore/utils/envtest" + "github.com/ironcore-dev/ironcore/utils/envtest/apiserver" "k8s.io/client-go/kubernetes/scheme" "k8s.io/client-go/rest" @@ -46,8 +46,8 @@ import ( "sigs.k8s.io/controller-runtime/pkg/log/zap" "sigs.k8s.io/controller-runtime/pkg/manager" - controllerconfig "github.com/onmetal/gardener-extension-provider-onmetal/pkg/apis/config" - apiv1alpha1 "github.com/onmetal/gardener-extension-provider-onmetal/pkg/apis/onmetal/v1alpha1" + controllerconfig "github.com/ironcore-dev/gardener-extension-provider-ironcore/pkg/apis/config" + apiv1alpha1 "github.com/ironcore-dev/gardener-extension-provider-ironcore/pkg/apis/ironcore/v1alpha1" ) const ( @@ -89,7 +89,7 @@ var _ = BeforeSuite(func() { } testEnvExt = &utilsenvtest.EnvironmentExtensions{ APIServiceDirectoryPaths: []string{ - modutils.Dir("github.com/onmetal/onmetal-api", "config", "apiserver", "apiservice", "bases"), + modutils.Dir("github.com/ironcore-dev/ironcore", "config", "apiserver", "apiservice", "bases"), }, ErrorIfAPIServicePathIsMissing: true, } @@ -113,7 +113,7 @@ var _ = BeforeSuite(func() { komega.SetClient(k8sClient) apiSrv, err := apiserver.New(cfg, apiserver.Options{ - MainPath: "github.com/onmetal/onmetal-api/cmd/onmetal-apiserver", + MainPath: "github.com/ironcore-dev/ironcore/cmd/ironcore-apiserver", BuildOptions: []buildutils.BuildOption{buildutils.ModModeMod}, ETCDServers: []string{testEnv.ControlPlane.Etcd.URL.String()}, Host: testEnvExt.APIServiceInstallOptions.LocalServingHost, diff --git a/pkg/controller/backupentry/actuator.go b/pkg/controller/backupentry/actuator.go index dcba065c..06f6ba9d 100644 --- a/pkg/controller/backupentry/actuator.go +++ b/pkg/controller/backupentry/actuator.go @@ -1,4 +1,4 @@ -// Copyright 2023 OnMetal authors +// Copyright 2023 IronCore authors // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. diff --git a/pkg/controller/backupentry/actuator_test.go b/pkg/controller/backupentry/actuator_test.go index cbd4e87e..44e025f1 100644 --- a/pkg/controller/backupentry/actuator_test.go +++ b/pkg/controller/backupentry/actuator_test.go @@ -1,4 +1,4 @@ -// Copyright 2023 OnMetal authors +// Copyright 2023 IronCore authors // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. @@ -22,7 +22,7 @@ import ( "github.com/gardener/gardener/extensions/pkg/controller/backupentry/genericactuator" extensionsv1alpha1 "github.com/gardener/gardener/pkg/apis/extensions/v1alpha1" "github.com/go-logr/logr" - storagev1alpha1 "github.com/onmetal/onmetal-api/api/storage/v1alpha1" + storagev1alpha1 "github.com/ironcore-dev/ironcore/api/storage/v1alpha1" . "github.com/onsi/ginkgo/v2" . "github.com/onsi/gomega" "go.uber.org/mock/gomock" @@ -53,7 +53,7 @@ var _ = Describe("BackupEntry Delete", func() { It("should delete Backupentry", func(ctx SpecContext) { - By("creating an Onmetal bucket resource") + By("creating an Ironcore bucket resource") bucketName := "test-bucket" bucket := &storagev1alpha1.Bucket{ ObjectMeta: metav1.ObjectMeta{ @@ -74,7 +74,7 @@ var _ = Describe("BackupEntry Delete", func() { } Expect(k8sClient.Create(ctx, bucket)).Should(Succeed()) - By("creating a secret with credentials data to access onmetal bucket") + By("creating a secret with credentials data to access ironcore bucket") secret := &corev1.Secret{ ObjectMeta: metav1.ObjectMeta{ Namespace: ns.Name, @@ -89,7 +89,7 @@ var _ = Describe("BackupEntry Delete", func() { Expect(k8sClient.Create(ctx, secret)).To(Succeed()) DeferCleanup(k8sClient.Delete, secret) - By("patching onmetal bucket with available state and credentials secret") + By("patching ironcore bucket with available state and credentials secret") bucketBase := bucket.DeepCopy() bucket.Status.State = storagev1alpha1.BucketStateAvailable bucket.Status.Access = &storagev1alpha1.BucketAccess{ diff --git a/pkg/controller/backupentry/add.go b/pkg/controller/backupentry/add.go index 7ed29609..79b340a9 100644 --- a/pkg/controller/backupentry/add.go +++ b/pkg/controller/backupentry/add.go @@ -1,4 +1,4 @@ -// Copyright 2023 OnMetal authors +// Copyright 2023 IronCore authors // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. @@ -19,7 +19,7 @@ import ( "github.com/gardener/gardener/extensions/pkg/controller/backupentry" "github.com/gardener/gardener/extensions/pkg/controller/backupentry/genericactuator" - "github.com/onmetal/gardener-extension-provider-onmetal/pkg/onmetal" + "github.com/ironcore-dev/gardener-extension-provider-ironcore/pkg/ironcore" "sigs.k8s.io/controller-runtime/pkg/controller" "sigs.k8s.io/controller-runtime/pkg/manager" ) @@ -29,7 +29,7 @@ var ( DefaultAddOptions = AddOptions{} ) -// AddOptions are options to apply when adding the onmetal backupentry controller to the manager. +// AddOptions are options to apply when adding the ironcore backupentry controller to the manager. type AddOptions struct { // Controller are the controller.Options. Controller controller.Options @@ -44,7 +44,7 @@ func AddToManagerWithOptions(ctx context.Context, mgr manager.Manager, opts AddO Actuator: genericactuator.NewActuator(mgr, newActuator(mgr)), ControllerOptions: opts.Controller, Predicates: backupentry.DefaultPredicates(opts.IgnoreOperationAnnotation), - Type: onmetal.Type, + Type: ironcore.Type, }) } diff --git a/pkg/controller/backupentry/backupentry.go b/pkg/controller/backupentry/backupentry.go index 9a914c37..f6a76a41 100644 --- a/pkg/controller/backupentry/backupentry.go +++ b/pkg/controller/backupentry/backupentry.go @@ -1,4 +1,4 @@ -// Copyright 2023 OnMetal authors +// Copyright 2023 IronCore authors // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. @@ -25,7 +25,7 @@ import ( "github.com/aws/aws-sdk-go/service/s3" corev1 "k8s.io/api/core/v1" - "github.com/onmetal/gardener-extension-provider-onmetal/pkg/onmetal" + "github.com/ironcore-dev/gardener-extension-provider-ironcore/pkg/ironcore" ) //go:generate $MOCKGEN -package backupentry -destination=mock_backupentry.go -source backupentry.go S3ClientGetter,S3ObjectLister @@ -96,19 +96,19 @@ func GetS3ClientFromS3ClientSecret(secret *corev1.Secret) (*s3.S3, error) { return nil, fmt.Errorf("secret does not contain any data") } - accessKeyID, ok := secret.Data[onmetal.AccessKeyID] + accessKeyID, ok := secret.Data[ironcore.AccessKeyID] if !ok { - return nil, fmt.Errorf("missing %q field in secret", onmetal.AccessKeyID) + return nil, fmt.Errorf("missing %q field in secret", ironcore.AccessKeyID) } - secretAccessKey, ok := secret.Data[onmetal.SecretAccessKey] + secretAccessKey, ok := secret.Data[ironcore.SecretAccessKey] if !ok { - return nil, fmt.Errorf("missing %q field in secret", onmetal.SecretAccessKey) + return nil, fmt.Errorf("missing %q field in secret", ironcore.SecretAccessKey) } - endpoint, ok := secret.Data[onmetal.Endpoint] + endpoint, ok := secret.Data[ironcore.Endpoint] if !ok { - return nil, fmt.Errorf("missing %q field in secret", onmetal.Endpoint) + return nil, fmt.Errorf("missing %q field in secret", ironcore.Endpoint) } endpointStr := string(endpoint) diff --git a/pkg/controller/backupentry/suite_test.go b/pkg/controller/backupentry/suite_test.go index ad44cb28..35b731c2 100644 --- a/pkg/controller/backupentry/suite_test.go +++ b/pkg/controller/backupentry/suite_test.go @@ -1,4 +1,4 @@ -// Copyright 2022 OnMetal authors +// Copyright 2022 IronCore authors // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. @@ -37,12 +37,12 @@ import ( "sigs.k8s.io/controller-runtime/pkg/log/zap" "sigs.k8s.io/controller-runtime/pkg/manager" - "github.com/onmetal/controller-utils/buildutils" - "github.com/onmetal/controller-utils/modutils" - apiv1alpha1 "github.com/onmetal/gardener-extension-provider-onmetal/pkg/apis/onmetal/v1alpha1" - storagev1alpha1 "github.com/onmetal/onmetal-api/api/storage/v1alpha1" - utilsenvtest "github.com/onmetal/onmetal-api/utils/envtest" - "github.com/onmetal/onmetal-api/utils/envtest/apiserver" + "github.com/ironcore-dev/controller-utils/buildutils" + "github.com/ironcore-dev/controller-utils/modutils" + apiv1alpha1 "github.com/ironcore-dev/gardener-extension-provider-ironcore/pkg/apis/ironcore/v1alpha1" + storagev1alpha1 "github.com/ironcore-dev/ironcore/api/storage/v1alpha1" + utilsenvtest "github.com/ironcore-dev/ironcore/utils/envtest" + "github.com/ironcore-dev/ironcore/utils/envtest/apiserver" ) const ( @@ -84,7 +84,7 @@ var _ = BeforeSuite(func() { } testEnvExt = &utilsenvtest.EnvironmentExtensions{ APIServiceDirectoryPaths: []string{ - modutils.Dir("github.com/onmetal/onmetal-api", "config", "apiserver", "apiservice", "bases"), + modutils.Dir("github.com/ironcore-dev/ironcore", "config", "apiserver", "apiservice", "bases"), }, ErrorIfAPIServicePathIsMissing: true, } @@ -108,7 +108,7 @@ var _ = BeforeSuite(func() { komega.SetClient(k8sClient) apiSrv, err := apiserver.New(cfg, apiserver.Options{ - MainPath: "github.com/onmetal/onmetal-api/cmd/onmetal-apiserver", + MainPath: "github.com/ironcore-dev/ironcore/cmd/ironcore-apiserver", BuildOptions: []buildutils.BuildOption{buildutils.ModModeMod}, ETCDServers: []string{testEnv.ControlPlane.Etcd.URL.String()}, Host: testEnvExt.APIServiceInstallOptions.LocalServingHost, diff --git a/pkg/controller/bastion/actuator.go b/pkg/controller/bastion/actuator.go index d08c9945..efdb2441 100644 --- a/pkg/controller/bastion/actuator.go +++ b/pkg/controller/bastion/actuator.go @@ -1,4 +1,4 @@ -// Copyright 2023 OnMetal authors +// Copyright 2023 IronCore authors // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. @@ -16,7 +16,7 @@ package bastion import ( "github.com/gardener/gardener/extensions/pkg/controller/bastion" - controllerconfig "github.com/onmetal/gardener-extension-provider-onmetal/pkg/apis/config" + controllerconfig "github.com/ironcore-dev/gardener-extension-provider-ironcore/pkg/apis/config" "sigs.k8s.io/controller-runtime/pkg/client" "sigs.k8s.io/controller-runtime/pkg/manager" ) diff --git a/pkg/controller/bastion/actuator_delete.go b/pkg/controller/bastion/actuator_delete.go index b3149a84..397b38f6 100644 --- a/pkg/controller/bastion/actuator_delete.go +++ b/pkg/controller/bastion/actuator_delete.go @@ -1,4 +1,4 @@ -// Copyright 2023 OnMetal authors +// Copyright 2023 IronCore authors // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. @@ -21,19 +21,18 @@ import ( "github.com/gardener/gardener/extensions/pkg/controller" extensionsv1alpha1 "github.com/gardener/gardener/pkg/apis/extensions/v1alpha1" "github.com/go-logr/logr" - computev1alpha1 "github.com/onmetal/onmetal-api/api/compute/v1alpha1" + "github.com/ironcore-dev/gardener-extension-provider-ironcore/pkg/ironcore" + computev1alpha1 "github.com/ironcore-dev/ironcore/api/compute/v1alpha1" metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" - - "github.com/onmetal/gardener-extension-provider-onmetal/pkg/onmetal" ) // Delete implements bastion.Actuator. func (a *actuator) Delete(ctx context.Context, log logr.Logger, bastion *extensionsv1alpha1.Bastion, cluster *controller.Cluster) error { log.V(2).Info("Deleting bastion host") - onmetalClient, namespace, err := onmetal.GetOnmetalClientAndNamespaceFromCloudProviderSecret(ctx, a.client, cluster.ObjectMeta.Name) + ironcoreClient, namespace, err := ironcore.GetIroncoreClientAndNamespaceFromCloudProviderSecret(ctx, a.client, cluster.ObjectMeta.Name) if err != nil { - return fmt.Errorf("failed to get onmetal client and namespace from cloudprovider secret: %w", err) + return fmt.Errorf("failed to get ironcore client and namespace from cloudprovider secret: %w", err) } bastionHostName, err := generateBastionHostResourceName(cluster.ObjectMeta.Name, bastion) @@ -46,7 +45,7 @@ func (a *actuator) Delete(ctx context.Context, log logr.Logger, bastion *extensi Name: bastionHostName, }, } - if err := onmetalClient.Delete(ctx, bastionHost); err != nil { + if err := ironcoreClient.Delete(ctx, bastionHost); err != nil { return fmt.Errorf("failed to delete bastion host: %v", err) } diff --git a/pkg/controller/bastion/actuator_delete_test.go b/pkg/controller/bastion/actuator_delete_test.go index 7feba4ca..c4743335 100644 --- a/pkg/controller/bastion/actuator_delete_test.go +++ b/pkg/controller/bastion/actuator_delete_test.go @@ -1,4 +1,4 @@ -// Copyright 2023 OnMetal authors +// Copyright 2023 IronCore authors // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. @@ -20,9 +20,10 @@ import ( extensionscontroller "github.com/gardener/gardener/extensions/pkg/controller" gardencorev1beta1 "github.com/gardener/gardener/pkg/apis/core/v1beta1" extensionsv1alpha1 "github.com/gardener/gardener/pkg/apis/extensions/v1alpha1" - commonv1alpha1 "github.com/onmetal/onmetal-api/api/common/v1alpha1" - computev1alpha1 "github.com/onmetal/onmetal-api/api/compute/v1alpha1" - networkingv1alpha1 "github.com/onmetal/onmetal-api/api/networking/v1alpha1" + "github.com/ironcore-dev/gardener-extension-provider-ironcore/pkg/ironcore" + commonv1alpha1 "github.com/ironcore-dev/ironcore/api/common/v1alpha1" + computev1alpha1 "github.com/ironcore-dev/ironcore/api/compute/v1alpha1" + networkingv1alpha1 "github.com/ironcore-dev/ironcore/api/networking/v1alpha1" . "github.com/onsi/ginkgo/v2" . "github.com/onsi/gomega" corev1 "k8s.io/api/core/v1" @@ -31,8 +32,6 @@ import ( metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" "sigs.k8s.io/controller-runtime/pkg/client" . "sigs.k8s.io/controller-runtime/pkg/envtest/komega" - - "github.com/onmetal/gardener-extension-provider-onmetal/pkg/onmetal" ) var _ = Describe("Bastion Host Delete", func() { @@ -51,7 +50,7 @@ var _ = Describe("Bastion Host Delete", func() { }, Spec: extensionsv1alpha1.BastionSpec{ DefaultSpec: extensionsv1alpha1.DefaultSpec{ - Type: onmetal.Type, + Type: ironcore.Type, ProviderConfig: nil, }, UserData: []byte("my-user"), diff --git a/pkg/controller/bastion/actuator_reconcile.go b/pkg/controller/bastion/actuator_reconcile.go index 5441736b..3a502f11 100644 --- a/pkg/controller/bastion/actuator_reconcile.go +++ b/pkg/controller/bastion/actuator_reconcile.go @@ -1,4 +1,4 @@ -// Copyright 2023 OnMetal authors +// Copyright 2023 IronCore authors // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. @@ -25,12 +25,12 @@ import ( extensionsv1alpha1 "github.com/gardener/gardener/pkg/apis/extensions/v1alpha1" reconcilerutils "github.com/gardener/gardener/pkg/controllerutils/reconciler" "github.com/go-logr/logr" - commonv1alpha1 "github.com/onmetal/onmetal-api/api/common/v1alpha1" - computev1alpha1 "github.com/onmetal/onmetal-api/api/compute/v1alpha1" - corev1alpha1 "github.com/onmetal/onmetal-api/api/core/v1alpha1" - ipamv1alpha1 "github.com/onmetal/onmetal-api/api/ipam/v1alpha1" - networkingv1alpha1 "github.com/onmetal/onmetal-api/api/networking/v1alpha1" - storagev1alpha1 "github.com/onmetal/onmetal-api/api/storage/v1alpha1" + commonv1alpha1 "github.com/ironcore-dev/ironcore/api/common/v1alpha1" + computev1alpha1 "github.com/ironcore-dev/ironcore/api/compute/v1alpha1" + corev1alpha1 "github.com/ironcore-dev/ironcore/api/core/v1alpha1" + ipamv1alpha1 "github.com/ironcore-dev/ironcore/api/ipam/v1alpha1" + networkingv1alpha1 "github.com/ironcore-dev/ironcore/api/networking/v1alpha1" + storagev1alpha1 "github.com/ironcore-dev/ironcore/api/storage/v1alpha1" corev1 "k8s.io/api/core/v1" "k8s.io/apimachinery/pkg/api/resource" @@ -38,10 +38,10 @@ import ( "sigs.k8s.io/controller-runtime/pkg/client" "sigs.k8s.io/controller-runtime/pkg/controller/controllerutil" - controllerconfig "github.com/onmetal/gardener-extension-provider-onmetal/pkg/apis/config" - api "github.com/onmetal/gardener-extension-provider-onmetal/pkg/apis/onmetal" - "github.com/onmetal/gardener-extension-provider-onmetal/pkg/controller/bastion/ignition" - "github.com/onmetal/gardener-extension-provider-onmetal/pkg/onmetal" + controllerconfig "github.com/ironcore-dev/gardener-extension-provider-ironcore/pkg/apis/config" + api "github.com/ironcore-dev/gardener-extension-provider-ironcore/pkg/apis/ironcore" + "github.com/ironcore-dev/gardener-extension-provider-ironcore/pkg/controller/bastion/ignition" + "github.com/ironcore-dev/gardener-extension-provider-ironcore/pkg/ironcore" ) const ( @@ -82,17 +82,17 @@ func (a *actuator) reconcile(ctx context.Context, log logr.Logger, bastion *exte return fmt.Errorf("failed to get infrastructure status: %w", err) } - onmetalClient, namespace, err := onmetal.GetOnmetalClientAndNamespaceFromCloudProviderSecret(ctx, a.client, cluster.ObjectMeta.Name) + ironcoreClient, namespace, err := ironcore.GetIroncoreClientAndNamespaceFromCloudProviderSecret(ctx, a.client, cluster.ObjectMeta.Name) if err != nil { - return fmt.Errorf("failed to get onmetal client and namespace from cloudprovider secret: %w", err) + return fmt.Errorf("failed to get ironcore client and namespace from cloudprovider secret: %w", err) } - machine, err := a.applyMachineAndIgnitionSecret(ctx, namespace, onmetalClient, infraStatus, opt) + machine, err := a.applyMachineAndIgnitionSecret(ctx, namespace, ironcoreClient, infraStatus, opt) if err != nil { return fmt.Errorf("failed to create machine: %w", err) } - if err = ensureNetworkPolicy(ctx, namespace, bastion, onmetalClient, infraStatus, machine); err != nil { + if err = ensureNetworkPolicy(ctx, namespace, bastion, ironcoreClient, infraStatus, machine); err != nil { return fmt.Errorf("failed to create network policy: %w", err) } @@ -159,7 +159,7 @@ func getMachineEndpoints(machine *computev1alpha1.Machine) (*bastionEndpoints, e // bastion host machine. It first sets the owner reference for the ignition // secret to the bastion host machine, to ensure that the secret is garbage // collected when the bastion host is deleted. -func (a *actuator) applyMachineAndIgnitionSecret(ctx context.Context, namespace string, onmetalClient client.Client, infraStatus *api.InfrastructureStatus, opt *Options) (*computev1alpha1.Machine, error) { +func (a *actuator) applyMachineAndIgnitionSecret(ctx context.Context, namespace string, ironcoreClient client.Client, infraStatus *api.InfrastructureStatus, opt *Options) (*computev1alpha1.Machine, error) { ignitionSecret, err := generateIgnitionSecret(namespace, opt) if err != nil { return nil, fmt.Errorf("failed to create ignition secret: %w", err) @@ -167,15 +167,15 @@ func (a *actuator) applyMachineAndIgnitionSecret(ctx context.Context, namespace bastionHost := generateMachine(namespace, a.bastionConfig, infraStatus, opt.BastionInstanceName, ignitionSecret.Name) - if _, err = controllerutil.CreateOrPatch(ctx, onmetalClient, bastionHost, nil); err != nil { + if _, err = controllerutil.CreateOrPatch(ctx, ironcoreClient, bastionHost, nil); err != nil { return nil, fmt.Errorf("failed to create or patch bastion host machine %s: %w", client.ObjectKeyFromObject(bastionHost), err) } - if err := controllerutil.SetOwnerReference(bastionHost, ignitionSecret, onmetalClient.Scheme()); err != nil { + if err := controllerutil.SetOwnerReference(bastionHost, ignitionSecret, ironcoreClient.Scheme()); err != nil { return nil, fmt.Errorf("failed to set owner reference for ignition secret %s: %w", client.ObjectKeyFromObject(ignitionSecret), err) } - if _, err = controllerutil.CreateOrPatch(ctx, onmetalClient, ignitionSecret, nil); err != nil { + if _, err = controllerutil.CreateOrPatch(ctx, ironcoreClient, ignitionSecret, nil); err != nil { return nil, fmt.Errorf("failed to create or patch ignition secret %s for bastion host %s: %w", client.ObjectKeyFromObject(ignitionSecret), client.ObjectKeyFromObject(bastionHost), err) } @@ -327,7 +327,7 @@ func IngressReady(ingress *corev1.LoadBalancerIngress) bool { return ingress != nil && (ingress.Hostname != "" || ingress.IP != "") } -func ensureNetworkPolicy(ctx context.Context, namespace string, bastion *extensionsv1alpha1.Bastion, onmetalClient client.Client, infraStatus *api.InfrastructureStatus, bastionHost *computev1alpha1.Machine) error { +func ensureNetworkPolicy(ctx context.Context, namespace string, bastion *extensionsv1alpha1.Bastion, ironcoreClient client.Client, infraStatus *api.InfrastructureStatus, bastionHost *computev1alpha1.Machine) error { cidrs, err := getBastionIngressCIDR(bastion) if err != nil { return fmt.Errorf("failed to get CIDR from bastion ingress: %w", err) @@ -372,11 +372,11 @@ func ensureNetworkPolicy(ctx context.Context, namespace string, bastion *extensi networkPolicy.Spec.Ingress = append(networkPolicy.Spec.Ingress, ingressRule) } - if err := controllerutil.SetOwnerReference(bastionHost, networkPolicy, onmetalClient.Scheme()); err != nil { + if err := controllerutil.SetOwnerReference(bastionHost, networkPolicy, ironcoreClient.Scheme()); err != nil { return fmt.Errorf("failed to set owner reference for network policy %s: %w", client.ObjectKeyFromObject(networkPolicy), err) } - if _, err = controllerutil.CreateOrPatch(ctx, onmetalClient, networkPolicy, nil); err != nil { + if _, err = controllerutil.CreateOrPatch(ctx, ironcoreClient, networkPolicy, nil); err != nil { return fmt.Errorf("failed to create or patch network policy %s: %w", client.ObjectKeyFromObject(networkPolicy), err) } diff --git a/pkg/controller/bastion/actuator_reconcile_test.go b/pkg/controller/bastion/actuator_reconcile_test.go index c0014b48..a2dde6ff 100644 --- a/pkg/controller/bastion/actuator_reconcile_test.go +++ b/pkg/controller/bastion/actuator_reconcile_test.go @@ -1,4 +1,4 @@ -// Copyright 2023 OnMetal authors +// Copyright 2023 IronCore authors // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. @@ -21,10 +21,10 @@ import ( gardencorev1beta1 "github.com/gardener/gardener/pkg/apis/core/v1beta1" extensionsv1alpha1 "github.com/gardener/gardener/pkg/apis/extensions/v1alpha1" - commonv1alpha1 "github.com/onmetal/onmetal-api/api/common/v1alpha1" - computev1alpha1 "github.com/onmetal/onmetal-api/api/compute/v1alpha1" - corev1alpha1 "github.com/onmetal/onmetal-api/api/core/v1alpha1" - networkingv1alpha1 "github.com/onmetal/onmetal-api/api/networking/v1alpha1" + commonv1alpha1 "github.com/ironcore-dev/ironcore/api/common/v1alpha1" + computev1alpha1 "github.com/ironcore-dev/ironcore/api/compute/v1alpha1" + corev1alpha1 "github.com/ironcore-dev/ironcore/api/core/v1alpha1" + networkingv1alpha1 "github.com/ironcore-dev/ironcore/api/networking/v1alpha1" . "github.com/onsi/ginkgo/v2" . "github.com/onsi/gomega" corev1 "k8s.io/api/core/v1" @@ -34,8 +34,8 @@ import ( "sigs.k8s.io/controller-runtime/pkg/client" . "sigs.k8s.io/controller-runtime/pkg/envtest/komega" - controllerconfig "github.com/onmetal/gardener-extension-provider-onmetal/pkg/apis/config" - "github.com/onmetal/gardener-extension-provider-onmetal/pkg/onmetal" + controllerconfig "github.com/ironcore-dev/gardener-extension-provider-ironcore/pkg/apis/config" + "github.com/ironcore-dev/gardener-extension-provider-ironcore/pkg/ironcore" ) var _ = Describe("Bastion Host Reconcile", func() { @@ -54,7 +54,7 @@ var _ = Describe("Bastion Host Reconcile", func() { }, Spec: extensionsv1alpha1.BastionSpec{ DefaultSpec: extensionsv1alpha1.DefaultSpec{ - Type: onmetal.Type, + Type: ironcore.Type, ProviderConfig: nil, }, UserData: []byte("abcd"), diff --git a/pkg/controller/bastion/add.go b/pkg/controller/bastion/add.go index e39eafb3..09aef2ce 100644 --- a/pkg/controller/bastion/add.go +++ b/pkg/controller/bastion/add.go @@ -1,4 +1,4 @@ -// Copyright 2023 OnMetal authors +// Copyright 2023 IronCore authors // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. @@ -18,10 +18,11 @@ import ( "context" "github.com/gardener/gardener/extensions/pkg/controller/bastion" - controllerconfig "github.com/onmetal/gardener-extension-provider-onmetal/pkg/apis/config" - "github.com/onmetal/gardener-extension-provider-onmetal/pkg/onmetal" + controllerconfig "github.com/ironcore-dev/gardener-extension-provider-ironcore/pkg/apis/config" + "github.com/ironcore-dev/gardener-extension-provider-ironcore/pkg/ironcore" "sigs.k8s.io/controller-runtime/pkg/controller" "sigs.k8s.io/controller-runtime/pkg/log" + "sigs.k8s.io/controller-runtime/pkg/manager" ) @@ -30,7 +31,7 @@ var ( DefaultAddOptions = AddOptions{} ) -// AddOptions are options to apply when adding the onmetal bastion controller to the manager. +// AddOptions are options to apply when adding the ironcore bastion controller to the manager. type AddOptions struct { // Controller are the controller.Options. Controller controller.Options @@ -48,7 +49,7 @@ func AddToManagerWithOptions(mgr manager.Manager, opts AddOptions) error { ConfigValidator: NewConfigValidator(mgr.GetClient(), log.Log), ControllerOptions: opts.Controller, Predicates: bastion.DefaultPredicates(opts.IgnoreOperationAnnotation), - Type: onmetal.Type, + Type: ironcore.Type, }) } diff --git a/pkg/controller/bastion/configvalidator.go b/pkg/controller/bastion/configvalidator.go index 85df233b..9cc3c372 100644 --- a/pkg/controller/bastion/configvalidator.go +++ b/pkg/controller/bastion/configvalidator.go @@ -1,4 +1,4 @@ -// Copyright 2023 OnMetal authors +// Copyright 2023 IronCore authors // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. @@ -23,16 +23,16 @@ import ( extensionsv1alpha1 "github.com/gardener/gardener/pkg/apis/extensions/v1alpha1" "github.com/gardener/gardener/pkg/extensions" "github.com/go-logr/logr" - commonv1alpha1 "github.com/onmetal/onmetal-api/api/common/v1alpha1" + commonv1alpha1 "github.com/ironcore-dev/ironcore/api/common/v1alpha1" "k8s.io/apimachinery/pkg/util/validation/field" "sigs.k8s.io/controller-runtime/pkg/client" - controllerconfig "github.com/onmetal/gardener-extension-provider-onmetal/pkg/apis/config" - api "github.com/onmetal/gardener-extension-provider-onmetal/pkg/apis/onmetal" - "github.com/onmetal/gardener-extension-provider-onmetal/pkg/apis/onmetal/helper" + controllerconfig "github.com/ironcore-dev/gardener-extension-provider-ironcore/pkg/apis/config" + api "github.com/ironcore-dev/gardener-extension-provider-ironcore/pkg/apis/ironcore" + "github.com/ironcore-dev/gardener-extension-provider-ironcore/pkg/apis/ironcore/helper" ) -// configValidator implements ConfigValidator for onmetal bastion resources. +// configValidator implements ConfigValidator for ironcore bastion resources. type configValidator struct { client client.Client logger logr.Logger @@ -42,7 +42,7 @@ type configValidator struct { func NewConfigValidator(client client.Client, logger logr.Logger) bastion.ConfigValidator { return &configValidator{ client: client, - logger: logger.WithName("onmetal-bastion-config-validator"), + logger: logger.WithName("ironcore-bastion-config-validator"), } } diff --git a/pkg/controller/bastion/configvalidator_test.go b/pkg/controller/bastion/configvalidator_test.go index acd0bc26..3abc0d01 100644 --- a/pkg/controller/bastion/configvalidator_test.go +++ b/pkg/controller/bastion/configvalidator_test.go @@ -1,4 +1,4 @@ -// Copyright 2023 OnMetal authors +// Copyright 2023 IronCore authors // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. @@ -20,14 +20,13 @@ import ( gardenerextensionv1alpha1 "github.com/gardener/gardener/pkg/apis/extensions/v1alpha1" "github.com/gardener/gardener/pkg/extensions" . "github.com/gardener/gardener/pkg/utils/test/matchers" + "github.com/ironcore-dev/gardener-extension-provider-ironcore/pkg/ironcore" . "github.com/onsi/ginkgo/v2" . "github.com/onsi/gomega" gstruct "github.com/onsi/gomega/gstruct" networkingv1 "k8s.io/api/networking/v1" metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" "sigs.k8s.io/controller-runtime/pkg/log" - - "github.com/onmetal/gardener-extension-provider-onmetal/pkg/onmetal" ) var _ = Describe("ConfigValidator", func() { @@ -96,7 +95,7 @@ var _ = Describe("ConfigValidator", func() { Spec: gardenerextensionv1alpha1.BastionSpec{ DefaultSpec: gardenerextensionv1alpha1.DefaultSpec{ - Type: onmetal.Type, + Type: ironcore.Type, }, UserData: []byte("abcd"), Ingress: []gardenerextensionv1alpha1.BastionIngressPolicy{{ @@ -121,7 +120,7 @@ var _ = Describe("ConfigValidator", func() { Spec: gardenerextensionv1alpha1.BastionSpec{ DefaultSpec: gardenerextensionv1alpha1.DefaultSpec{ - Type: onmetal.Type, + Type: ironcore.Type, }, UserData: []byte("abcd"), Ingress: []gardenerextensionv1alpha1.BastionIngressPolicy{{ @@ -146,7 +145,7 @@ var _ = Describe("ConfigValidator", func() { Spec: gardenerextensionv1alpha1.BastionSpec{ DefaultSpec: gardenerextensionv1alpha1.DefaultSpec{ - Type: onmetal.Type, + Type: ironcore.Type, }, UserData: []byte("abcd"), Ingress: []gardenerextensionv1alpha1.BastionIngressPolicy{{ diff --git a/pkg/controller/bastion/ignition/config.go b/pkg/controller/bastion/ignition/config.go index 4440609d..0dac4d3c 100644 --- a/pkg/controller/bastion/ignition/config.go +++ b/pkg/controller/bastion/ignition/config.go @@ -1,4 +1,4 @@ -// Copyright 2022 OnMetal authors +// Copyright 2022 IronCore authors // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. diff --git a/pkg/controller/bastion/ignition/template.yaml b/pkg/controller/bastion/ignition/template.yaml index 4f129a3b..0b66b042 100644 --- a/pkg/controller/bastion/ignition/template.yaml +++ b/pkg/controller/bastion/ignition/template.yaml @@ -8,7 +8,7 @@ storage: contents: inline: | {{ .Hostname }} - - path: /var/lib/onmetal-cloud-config/init.sh + - path: /var/lib/ironcore-cloud-config/init.sh overwrite: yes mode: 0755 contents: @@ -22,12 +22,12 @@ systemd: [Unit] Wants=network-online.target After=network-online.target - ConditionPathExists=!/var/lib/onmetal-cloud-config/init.done + ConditionPathExists=!/var/lib/ironcore-cloud-config/init.done [Service] Type=oneshot - ExecStart=/var/lib/onmetal-cloud-config/init.sh - ExecStopPost=touch /var/lib/onmetal-cloud-config/init.done + ExecStart=/var/lib/ironcore-cloud-config/init.sh + ExecStopPost=touch /var/lib/ironcore-cloud-config/init.done Restart=on-failure RestartSec=5 diff --git a/pkg/controller/bastion/options.go b/pkg/controller/bastion/options.go index 04cc810b..f62a2d8f 100644 --- a/pkg/controller/bastion/options.go +++ b/pkg/controller/bastion/options.go @@ -1,4 +1,4 @@ -// Copyright 2023 OnMetal authors +// Copyright 2023 IronCore authors // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. @@ -28,7 +28,7 @@ type Options struct { UserData []byte } -// DetermineOptions determines the required information that are required to reconcile a Bastion on onmetal. This +// DetermineOptions determines the required information that are required to reconcile a Bastion on ironcore. This // function does not create any IaaS resources. func DetermineOptions(bastion *extensionsv1alpha1.Bastion, cluster *controller.Cluster) (*Options, error) { clusterName := cluster.ObjectMeta.Name diff --git a/pkg/controller/bastion/suite_test.go b/pkg/controller/bastion/suite_test.go index 5d28713e..571ba982 100644 --- a/pkg/controller/bastion/suite_test.go +++ b/pkg/controller/bastion/suite_test.go @@ -1,4 +1,4 @@ -// Copyright 2023 OnMetal authors +// Copyright 2023 IronCore authors // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. @@ -25,16 +25,16 @@ import ( "github.com/gardener/gardener/pkg/apis/core/v1beta1" extensionsv1alpha1 "github.com/gardener/gardener/pkg/apis/extensions/v1alpha1" - "github.com/onmetal/controller-utils/buildutils" - "github.com/onmetal/controller-utils/modutils" - commonv1alpha1 "github.com/onmetal/onmetal-api/api/common/v1alpha1" - computev1alpha1 "github.com/onmetal/onmetal-api/api/compute/v1alpha1" - corev1alpha1 "github.com/onmetal/onmetal-api/api/core/v1alpha1" - ipamv1alpha1 "github.com/onmetal/onmetal-api/api/ipam/v1alpha1" - networkingv1alpha1 "github.com/onmetal/onmetal-api/api/networking/v1alpha1" - storagev1alpha1 "github.com/onmetal/onmetal-api/api/storage/v1alpha1" - utilsenvtest "github.com/onmetal/onmetal-api/utils/envtest" - "github.com/onmetal/onmetal-api/utils/envtest/apiserver" + "github.com/ironcore-dev/controller-utils/buildutils" + "github.com/ironcore-dev/controller-utils/modutils" + commonv1alpha1 "github.com/ironcore-dev/ironcore/api/common/v1alpha1" + computev1alpha1 "github.com/ironcore-dev/ironcore/api/compute/v1alpha1" + corev1alpha1 "github.com/ironcore-dev/ironcore/api/core/v1alpha1" + ipamv1alpha1 "github.com/ironcore-dev/ironcore/api/ipam/v1alpha1" + networkingv1alpha1 "github.com/ironcore-dev/ironcore/api/networking/v1alpha1" + storagev1alpha1 "github.com/ironcore-dev/ironcore/api/storage/v1alpha1" + utilsenvtest "github.com/ironcore-dev/ironcore/utils/envtest" + "github.com/ironcore-dev/ironcore/utils/envtest/apiserver" . "github.com/onsi/ginkgo/v2" . "github.com/onsi/gomega" corev1 "k8s.io/api/core/v1" @@ -52,8 +52,8 @@ import ( "sigs.k8s.io/controller-runtime/pkg/log/zap" "sigs.k8s.io/controller-runtime/pkg/manager" - controllerconfig "github.com/onmetal/gardener-extension-provider-onmetal/pkg/apis/config" - apiv1alpha1 "github.com/onmetal/gardener-extension-provider-onmetal/pkg/apis/onmetal/v1alpha1" + controllerconfig "github.com/ironcore-dev/gardener-extension-provider-ironcore/pkg/apis/config" + apiv1alpha1 "github.com/ironcore-dev/gardener-extension-provider-ironcore/pkg/apis/ironcore/v1alpha1" ) const ( @@ -96,7 +96,7 @@ var _ = BeforeSuite(func() { } testEnvExt = &utilsenvtest.EnvironmentExtensions{ APIServiceDirectoryPaths: []string{ - modutils.Dir("github.com/onmetal/onmetal-api", "config", "apiserver", "apiservice", "bases"), + modutils.Dir("github.com/ironcore-dev/ironcore", "config", "apiserver", "apiservice", "bases"), }, ErrorIfAPIServicePathIsMissing: true, } @@ -122,7 +122,7 @@ var _ = BeforeSuite(func() { komega.SetClient(k8sClient) apiSrv, err := apiserver.New(cfg, apiserver.Options{ - MainPath: "github.com/onmetal/onmetal-api/cmd/onmetal-apiserver", + MainPath: "github.com/ironcore-dev/ironcore/cmd/ironcore-apiserver", BuildOptions: []buildutils.BuildOption{buildutils.ModModeMod}, ETCDServers: []string{testEnv.ControlPlane.Etcd.URL.String()}, Host: testEnvExt.APIServiceInstallOptions.LocalServingHost, diff --git a/pkg/controller/bastion/utils.go b/pkg/controller/bastion/utils.go index e63bdb53..da09beac 100644 --- a/pkg/controller/bastion/utils.go +++ b/pkg/controller/bastion/utils.go @@ -1,4 +1,4 @@ -// Copyright 2023 OnMetal authors +// Copyright 2023 IronCore authors // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. @@ -20,7 +20,7 @@ import ( "strings" extensionsv1alpha1 "github.com/gardener/gardener/pkg/apis/extensions/v1alpha1" - computev1alpha1 "github.com/onmetal/onmetal-api/api/compute/v1alpha1" + computev1alpha1 "github.com/ironcore-dev/ironcore/api/compute/v1alpha1" ) // generateBastionHostResourceName returns a unique name for the Bastion host in diff --git a/pkg/controller/controlplane/add.go b/pkg/controller/controlplane/add.go index 9d8e6aac..33672b3a 100644 --- a/pkg/controller/controlplane/add.go +++ b/pkg/controller/controlplane/add.go @@ -1,4 +1,4 @@ -// Copyright 2022 OnMetal authors +// Copyright 2022 IronCore authors // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. @@ -24,8 +24,8 @@ import ( "github.com/gardener/gardener/extensions/pkg/controller/controlplane" "github.com/gardener/gardener/extensions/pkg/controller/controlplane/genericactuator" "github.com/gardener/gardener/extensions/pkg/util" - "github.com/onmetal/gardener-extension-provider-onmetal/pkg/internal/imagevector" - "github.com/onmetal/gardener-extension-provider-onmetal/pkg/onmetal" + "github.com/ironcore-dev/gardener-extension-provider-ironcore/pkg/internal/imagevector" + "github.com/ironcore-dev/gardener-extension-provider-ironcore/pkg/ironcore" "sigs.k8s.io/controller-runtime/pkg/controller" "sigs.k8s.io/controller-runtime/pkg/manager" ) @@ -35,7 +35,7 @@ var ( DefaultAddOptions = AddOptions{} ) -// AddOptions are options to apply when adding the onmetal controlplane controller to the manager. +// AddOptions are options to apply when adding the ironcore controlplane controller to the manager. type AddOptions struct { // Controller are the controller.Options. Controller controller.Options @@ -56,11 +56,11 @@ func AddToManagerWithOptions(ctx context.Context, mgr manager.Manager, opts AddO return fmt.Errorf("expected *webhook.DefaultServer, got %T", webhookServer) } - genericActuator, err := genericactuator.NewActuator(mgr, onmetal.ProviderName, + genericActuator, err := genericactuator.NewActuator(mgr, ironcore.ProviderName, secretConfigsFunc, shootAccessSecretsFunc, nil, nil, configChart, controlPlaneChart, controlPlaneShootChart, nil, storageClassChart, nil, NewValuesProvider(mgr), extensionscontroller.ChartRendererFactoryFunc(util.NewChartRendererForShoot), - imagevector.ImageVector(), onmetal.CloudProviderConfigName, nil, opts.WebhookServerNamespace, defaultServer.Options.Port) + imagevector.ImageVector(), ironcore.CloudProviderConfigName, nil, opts.WebhookServerNamespace, defaultServer.Options.Port) if err != nil { return err @@ -70,7 +70,7 @@ func AddToManagerWithOptions(ctx context.Context, mgr manager.Manager, opts AddO Actuator: genericActuator, ControllerOptions: opts.Controller, Predicates: controlplane.DefaultPredicates(ctx, mgr, opts.IgnoreOperationAnnotation), - Type: onmetal.Type, + Type: ironcore.Type, }) } diff --git a/pkg/controller/controlplane/constants.go b/pkg/controller/controlplane/constants.go index 5364be98..df50c283 100644 --- a/pkg/controller/controlplane/constants.go +++ b/pkg/controller/controlplane/constants.go @@ -1,4 +1,4 @@ -// Copyright 2023 OnMetal authors +// Copyright 2023 IronCore authors // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. diff --git a/pkg/controller/controlplane/suite_test.go b/pkg/controller/controlplane/suite_test.go index b7661f82..e01b1332 100644 --- a/pkg/controller/controlplane/suite_test.go +++ b/pkg/controller/controlplane/suite_test.go @@ -1,4 +1,4 @@ -// Copyright 2022 OnMetal authors +// Copyright 2022 IronCore authors // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. @@ -42,13 +42,13 @@ import ( "sigs.k8s.io/controller-runtime/pkg/log/zap" "sigs.k8s.io/controller-runtime/pkg/manager" - "github.com/onmetal/controller-utils/buildutils" - "github.com/onmetal/controller-utils/modutils" - storagev1alpha1 "github.com/onmetal/onmetal-api/api/storage/v1alpha1" - utilsenvtest "github.com/onmetal/onmetal-api/utils/envtest" - "github.com/onmetal/onmetal-api/utils/envtest/apiserver" + "github.com/ironcore-dev/controller-utils/buildutils" + "github.com/ironcore-dev/controller-utils/modutils" + storagev1alpha1 "github.com/ironcore-dev/ironcore/api/storage/v1alpha1" + utilsenvtest "github.com/ironcore-dev/ironcore/utils/envtest" + "github.com/ironcore-dev/ironcore/utils/envtest/apiserver" - onmetalextensionv1alpha1 "github.com/onmetal/gardener-extension-provider-onmetal/pkg/apis/onmetal/v1alpha1" + ironcoreextensionv1alpha1 "github.com/ironcore-dev/gardener-extension-provider-ironcore/pkg/apis/ironcore/v1alpha1" ) const ( @@ -93,7 +93,7 @@ var _ = BeforeSuite(func() { testEnvExt = &utilsenvtest.EnvironmentExtensions{ APIServiceDirectoryPaths: []string{ - modutils.Dir("github.com/onmetal/onmetal-api", "config", "apiserver", "apiservice", "bases"), + modutils.Dir("github.com/ironcore-dev/ironcore", "config", "apiserver", "apiservice", "bases"), }, ErrorIfAPIServicePathIsMissing: true, } @@ -104,7 +104,7 @@ var _ = BeforeSuite(func() { DeferCleanup(utilsenvtest.StopWithExtensions, testEnv, testEnvExt) Expect(extensionsv1alpha1.AddToScheme(scheme.Scheme)).To(Succeed()) - Expect(onmetalextensionv1alpha1.AddToScheme(scheme.Scheme)).To(Succeed()) + Expect(ironcoreextensionv1alpha1.AddToScheme(scheme.Scheme)).To(Succeed()) Expect(corev1.AddToScheme(scheme.Scheme)).To(Succeed()) Expect(storagev1alpha1.AddToScheme(scheme.Scheme)).To(Succeed()) @@ -116,7 +116,7 @@ var _ = BeforeSuite(func() { komega.SetClient(k8sClient) apiSrv, err := apiserver.New(cfg, apiserver.Options{ - MainPath: "github.com/onmetal/onmetal-api/cmd/onmetal-apiserver", + MainPath: "github.com/ironcore-dev/ironcore/cmd/ironcore-apiserver", BuildOptions: []buildutils.BuildOption{buildutils.ModModeMod}, ETCDServers: []string{testEnv.ControlPlane.Etcd.URL.String()}, Host: testEnvExt.APIServiceInstallOptions.LocalServingHost, diff --git a/pkg/controller/controlplane/valuesprovider.go b/pkg/controller/controlplane/valuesprovider.go index 0329b3f4..cbd181ad 100644 --- a/pkg/controller/controlplane/valuesprovider.go +++ b/pkg/controller/controlplane/valuesprovider.go @@ -1,4 +1,4 @@ -// Copyright 2022 OnMetal authors +// Copyright 2022 IronCore authors // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. @@ -33,10 +33,10 @@ import ( kutil "github.com/gardener/gardener/pkg/utils/kubernetes" secretutils "github.com/gardener/gardener/pkg/utils/secrets" secretsmanager "github.com/gardener/gardener/pkg/utils/secrets/manager" - apisonmetal "github.com/onmetal/gardener-extension-provider-onmetal/pkg/apis/onmetal" - "github.com/onmetal/gardener-extension-provider-onmetal/pkg/internal" - "github.com/onmetal/gardener-extension-provider-onmetal/pkg/onmetal" - storagev1alpha1 "github.com/onmetal/onmetal-api/api/storage/v1alpha1" + apisironcore "github.com/ironcore-dev/gardener-extension-provider-ironcore/pkg/apis/ironcore" + "github.com/ironcore-dev/gardener-extension-provider-ironcore/pkg/internal" + "github.com/ironcore-dev/gardener-extension-provider-ironcore/pkg/ironcore" + storagev1alpha1 "github.com/ironcore-dev/ironcore/api/storage/v1alpha1" appsv1 "k8s.io/api/apps/v1" corev1 "k8s.io/api/core/v1" policyv1beta1 "k8s.io/api/policy/v1beta1" @@ -52,7 +52,7 @@ import ( ) const ( - caNameControlPlane = "ca-" + onmetal.ProviderName + "-controlplane" + caNameControlPlane = "ca-" + ironcore.ProviderName + "-controlplane" cloudControllerManagerDeploymentName = "cloud-controller-manager" cloudControllerManagerServerName = "cloud-controller-manager-server" ) @@ -70,8 +70,8 @@ func secretConfigsFunc(namespace string) []extensionssecretsmanager.SecretConfig { Config: &secretutils.CertificateSecretConfig{ Name: cloudControllerManagerServerName, - CommonName: onmetal.CloudControllerManagerName, - DNSNames: kutil.DNSNamesForService(onmetal.CloudControllerManagerName, namespace), + CommonName: ironcore.CloudControllerManagerName, + DNSNames: kutil.DNSNamesForService(ironcore.CloudControllerManagerName, namespace), CertType: secretutils.ServerCert, SkipPublishingCACertificate: true, }, @@ -83,21 +83,21 @@ func secretConfigsFunc(namespace string) []extensionssecretsmanager.SecretConfig func shootAccessSecretsFunc(namespace string) []*gutil.AccessSecret { return []*gutil.AccessSecret{ gutil.NewShootAccessSecret(cloudControllerManagerDeploymentName, namespace), - gutil.NewShootAccessSecret(onmetal.CSIProvisionerName, namespace), - gutil.NewShootAccessSecret(onmetal.CSIAttacherName, namespace), - gutil.NewShootAccessSecret(onmetal.CSIResizerName, namespace), + gutil.NewShootAccessSecret(ironcore.CSIProvisionerName, namespace), + gutil.NewShootAccessSecret(ironcore.CSIAttacherName, namespace), + gutil.NewShootAccessSecret(ironcore.CSIResizerName, namespace), // TODO: This needs to be fixed!!! // Since the csi controller needs to access the Node resources in the Shoot cluster, // it should use the same ServiceAccount as the csi-driver-node in the Shoot. That way // the correct ClusterRolebindings will be used for both components. - gutil.NewShootAccessSecret(onmetal.CSINodeName, namespace), + gutil.NewShootAccessSecret(ironcore.CSINodeName, namespace), } } var ( configChart = &chart.Chart{ Name: "cloud-provider-config", - Path: filepath.Join(onmetal.InternalChartsPath, "cloud-provider-config"), + Path: filepath.Join(ironcore.InternalChartsPath, "cloud-provider-config"), Objects: []*chart.Object{ {Type: &corev1.ConfigMap{}, Name: internal.CloudProviderSecretName}, }, @@ -105,11 +105,11 @@ var ( controlPlaneChart = &chart.Chart{ Name: "seed-controlplane", - Path: filepath.Join(onmetal.InternalChartsPath, "seed-controlplane"), + Path: filepath.Join(ironcore.InternalChartsPath, "seed-controlplane"), SubCharts: []*chart.Chart{ { - Name: onmetal.CloudControllerManagerName, - Images: []string{onmetal.CloudControllerManagerImageName}, + Name: ironcore.CloudControllerManagerName, + Images: []string{ironcore.CloudControllerManagerImageName}, Objects: []*chart.Object{ {Type: &corev1.Service{}, Name: "cloud-controller-manager"}, {Type: &appsv1.Deployment{}, Name: "cloud-controller-manager"}, @@ -118,19 +118,19 @@ var ( }, }, { - Name: onmetal.CSIControllerName, + Name: ironcore.CSIControllerName, Images: []string{ - onmetal.CSIDriverImageName, - onmetal.CSIProvisionerImageName, - onmetal.CSIAttacherImageName, - onmetal.CSIResizerImageName, - onmetal.CSILivenessProbeImageName, + ironcore.CSIDriverImageName, + ironcore.CSIProvisionerImageName, + ironcore.CSIAttacherImageName, + ironcore.CSIResizerImageName, + ironcore.CSILivenessProbeImageName, }, Objects: []*chart.Object{ // csi-driver-controller - {Type: &appsv1.Deployment{}, Name: onmetal.CSIControllerName}, - {Type: &corev1.ConfigMap{}, Name: onmetal.CSIControllerObservabilityConfigName}, - {Type: &autoscalingv1.VerticalPodAutoscaler{}, Name: onmetal.CSIControllerName + "-vpa"}, + {Type: &appsv1.Deployment{}, Name: ironcore.CSIControllerName}, + {Type: &corev1.ConfigMap{}, Name: ironcore.CSIControllerObservabilityConfigName}, + {Type: &autoscalingv1.VerticalPodAutoscaler{}, Name: ironcore.CSIControllerName + "-vpa"}, }, }, }, @@ -138,49 +138,49 @@ var ( controlPlaneShootChart = &chart.Chart{ Name: "shoot-system-components", - Path: filepath.Join(onmetal.InternalChartsPath, "shoot-system-components"), + Path: filepath.Join(ironcore.InternalChartsPath, "shoot-system-components"), SubCharts: []*chart.Chart{ { Name: "cloud-controller-manager", - Path: filepath.Join(onmetal.InternalChartsPath, "cloud-controller-manager"), + Path: filepath.Join(ironcore.InternalChartsPath, "cloud-controller-manager"), Objects: []*chart.Object{ {Type: &rbacv1.ClusterRole{}, Name: "system:controller:cloud-node-controller"}, {Type: &rbacv1.ClusterRoleBinding{}, Name: "system:controller:cloud-node-controller"}, - {Type: &rbacv1.ClusterRole{}, Name: "onmetal:cloud-provider"}, - {Type: &rbacv1.ClusterRoleBinding{}, Name: "onmetal:cloud-provider"}, + {Type: &rbacv1.ClusterRole{}, Name: "ironcore:cloud-provider"}, + {Type: &rbacv1.ClusterRoleBinding{}, Name: "ironcore:cloud-provider"}, }, }, { - Name: onmetal.CSINodeName, + Name: ironcore.CSINodeName, Images: []string{ - onmetal.CSIDriverImageName, - onmetal.CSINodeDriverRegistrarImageName, - onmetal.CSILivenessProbeImageName, + ironcore.CSIDriverImageName, + ironcore.CSINodeDriverRegistrarImageName, + ironcore.CSILivenessProbeImageName, }, Objects: []*chart.Object{ // csi-driver - {Type: &appsv1.DaemonSet{}, Name: onmetal.CSINodeName}, - {Type: &storagev1.CSIDriver{}, Name: onmetal.CSIStorageProvisioner}, - {Type: &corev1.ServiceAccount{}, Name: onmetal.CSIDriverName}, - {Type: &rbacv1.ClusterRole{}, Name: onmetal.UsernamePrefix + onmetal.CSIDriverName}, - {Type: &rbacv1.ClusterRoleBinding{}, Name: onmetal.UsernamePrefix + onmetal.CSIDriverName}, - {Type: &policyv1beta1.PodSecurityPolicy{}, Name: strings.Replace(onmetal.UsernamePrefix+onmetal.CSIDriverName, ":", ".", -1)}, - {Type: extensionscontroller.GetVerticalPodAutoscalerObject(), Name: onmetal.CSINodeName}, + {Type: &appsv1.DaemonSet{}, Name: ironcore.CSINodeName}, + {Type: &storagev1.CSIDriver{}, Name: ironcore.CSIStorageProvisioner}, + {Type: &corev1.ServiceAccount{}, Name: ironcore.CSIDriverName}, + {Type: &rbacv1.ClusterRole{}, Name: ironcore.UsernamePrefix + ironcore.CSIDriverName}, + {Type: &rbacv1.ClusterRoleBinding{}, Name: ironcore.UsernamePrefix + ironcore.CSIDriverName}, + {Type: &policyv1beta1.PodSecurityPolicy{}, Name: strings.Replace(ironcore.UsernamePrefix+ironcore.CSIDriverName, ":", ".", -1)}, + {Type: extensionscontroller.GetVerticalPodAutoscalerObject(), Name: ironcore.CSINodeName}, // csi-provisioner - {Type: &rbacv1.ClusterRole{}, Name: onmetal.UsernamePrefix + onmetal.CSIProvisionerName}, - {Type: &rbacv1.ClusterRoleBinding{}, Name: onmetal.UsernamePrefix + onmetal.CSIProvisionerName}, - {Type: &rbacv1.Role{}, Name: onmetal.UsernamePrefix + onmetal.CSIProvisionerName}, - {Type: &rbacv1.RoleBinding{}, Name: onmetal.UsernamePrefix + onmetal.CSIProvisionerName}, + {Type: &rbacv1.ClusterRole{}, Name: ironcore.UsernamePrefix + ironcore.CSIProvisionerName}, + {Type: &rbacv1.ClusterRoleBinding{}, Name: ironcore.UsernamePrefix + ironcore.CSIProvisionerName}, + {Type: &rbacv1.Role{}, Name: ironcore.UsernamePrefix + ironcore.CSIProvisionerName}, + {Type: &rbacv1.RoleBinding{}, Name: ironcore.UsernamePrefix + ironcore.CSIProvisionerName}, // csi-attacher - {Type: &rbacv1.ClusterRole{}, Name: onmetal.UsernamePrefix + onmetal.CSIAttacherName}, - {Type: &rbacv1.ClusterRoleBinding{}, Name: onmetal.UsernamePrefix + onmetal.CSIAttacherName}, - {Type: &rbacv1.Role{}, Name: onmetal.UsernamePrefix + onmetal.CSIAttacherName}, - {Type: &rbacv1.RoleBinding{}, Name: onmetal.UsernamePrefix + onmetal.CSIAttacherName}, + {Type: &rbacv1.ClusterRole{}, Name: ironcore.UsernamePrefix + ironcore.CSIAttacherName}, + {Type: &rbacv1.ClusterRoleBinding{}, Name: ironcore.UsernamePrefix + ironcore.CSIAttacherName}, + {Type: &rbacv1.Role{}, Name: ironcore.UsernamePrefix + ironcore.CSIAttacherName}, + {Type: &rbacv1.RoleBinding{}, Name: ironcore.UsernamePrefix + ironcore.CSIAttacherName}, // csi-resizer - {Type: &rbacv1.ClusterRole{}, Name: onmetal.UsernamePrefix + onmetal.CSIResizerName}, - {Type: &rbacv1.ClusterRoleBinding{}, Name: onmetal.UsernamePrefix + onmetal.CSIResizerName}, - {Type: &rbacv1.Role{}, Name: onmetal.UsernamePrefix + onmetal.CSIResizerName}, - {Type: &rbacv1.RoleBinding{}, Name: onmetal.UsernamePrefix + onmetal.CSIResizerName}, + {Type: &rbacv1.ClusterRole{}, Name: ironcore.UsernamePrefix + ironcore.CSIResizerName}, + {Type: &rbacv1.ClusterRoleBinding{}, Name: ironcore.UsernamePrefix + ironcore.CSIResizerName}, + {Type: &rbacv1.Role{}, Name: ironcore.UsernamePrefix + ironcore.CSIResizerName}, + {Type: &rbacv1.RoleBinding{}, Name: ironcore.UsernamePrefix + ironcore.CSIResizerName}, }, }, }, @@ -188,11 +188,11 @@ var ( storageClassChart = &chart.Chart{ Name: "shoot-storageclasses", - Path: filepath.Join(onmetal.InternalChartsPath, "shoot-storageclasses"), + Path: filepath.Join(ironcore.InternalChartsPath, "shoot-storageclasses"), } ) -// valuesProvider is a ValuesProvider that provides onmetal-specific values for the 2 charts applied by the generic actuator. +// valuesProvider is a ValuesProvider that provides ironcore-specific values for the 2 charts applied by the generic actuator. type valuesProvider struct { client client.Client decoder runtime.Decoder @@ -220,15 +220,15 @@ func (vp *valuesProvider) GetConfigChartValues( cp *extensionsv1alpha1.ControlPlane, cluster *extensionscontroller.Cluster, ) (map[string]interface{}, error) { - infrastructureStatus := &apisonmetal.InfrastructureStatus{} + infrastructureStatus := &apisironcore.InfrastructureStatus{} if _, _, err := vp.decoder.Decode(cp.Spec.InfrastructureProviderStatus.Raw, nil, infrastructureStatus); err != nil { return nil, fmt.Errorf("failed to decode infrastructure status: %w", err) } // Collect config chart values return map[string]interface{}{ - onmetal.NetworkFieldName: infrastructureStatus.NetworkRef.Name, - onmetal.PrefixFieldName: infrastructureStatus.PrefixRef.Name, - onmetal.ClusterFieldName: cluster.ObjectMeta.Name, + ironcore.NetworkFieldName: infrastructureStatus.NetworkRef.Name, + ironcore.PrefixFieldName: infrastructureStatus.PrefixRef.Name, + ironcore.ClusterFieldName: cluster.ObjectMeta.Name, }, nil } @@ -244,7 +244,7 @@ func (vp *valuesProvider) GetControlPlaneChartValues( map[string]interface{}, error, ) { - cpConfig := &apisonmetal.ControlPlaneConfig{} + cpConfig := &apisironcore.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) @@ -284,7 +284,7 @@ func (vp *valuesProvider) GetStorageClassesChartValues( controlPlane *extensionsv1alpha1.ControlPlane, cluster *extensionscontroller.Cluster, ) (map[string]interface{}, error) { - providerConfig := apisonmetal.CloudProfileConfig{} + providerConfig := apisironcore.CloudProfileConfig{} if config := cluster.CloudProfile.Spec.ProviderConfig; config != nil { if _, _, err := vp.decoder.Decode(config.Raw, nil, &providerConfig); err != nil { return nil, fmt.Errorf("could not decode cloudprofile providerConfig for controlplane '%s': %w", client.ObjectKeyFromObject(controlPlane), err) @@ -297,16 +297,16 @@ func (vp *valuesProvider) GetStorageClassesChartValues( defaultStorageClass++ } - // get onmetal credentials from infrastructure config - onmetalClient, _, err := onmetal.GetOnmetalClientAndNamespaceFromCloudProviderSecret(ctx, vp.client, cluster.ObjectMeta.Name) + // get ironcore credentials from infrastructure config + ironcoreClient, _, err := ironcore.GetIroncoreClientAndNamespaceFromCloudProviderSecret(ctx, vp.client, cluster.ObjectMeta.Name) if err != nil { - return nil, fmt.Errorf("failed to get onmetal client and namespace from cloudprovider secret: %w", err) + return nil, fmt.Errorf("failed to get ironcore client and namespace from cloudprovider secret: %w", err) } var expandable bool storageClasses := make([]map[string]interface{}, 0, len(providerConfig.StorageClasses.Additional)+defaultStorageClass) if providerConfig.StorageClasses.Default != nil { - if expandable, err = isVolumeClassExpandable(ctx, onmetalClient, providerConfig.StorageClasses.Default); err != nil { + if expandable, err = isVolumeClassExpandable(ctx, ironcoreClient, providerConfig.StorageClasses.Default); err != nil { return nil, fmt.Errorf("could not get resize policy from volumeclass : %w", err) } @@ -318,7 +318,7 @@ func (vp *valuesProvider) GetStorageClassesChartValues( }) } for _, sc := range providerConfig.StorageClasses.Additional { - if expandable, err = isVolumeClassExpandable(ctx, onmetalClient, &sc); err != nil { + if expandable, err = isVolumeClassExpandable(ctx, ironcoreClient, &sc); err != nil { return nil, fmt.Errorf("could not get resize policy from volumeclass : %w", err) } storageClasses = append(storageClasses, map[string]interface{}{ @@ -333,9 +333,9 @@ func (vp *valuesProvider) GetStorageClassesChartValues( return values, nil } -func isVolumeClassExpandable(ctx context.Context, onmetalClient client.Client, storageClass *apisonmetal.StorageClass) (bool, error) { +func isVolumeClassExpandable(ctx context.Context, ironcoreClient client.Client, storageClass *apisironcore.StorageClass) (bool, error) { volumeClass := &storagev1alpha1.VolumeClass{} - if err := onmetalClient.Get(ctx, client.ObjectKey{Name: storageClass.Type}, volumeClass); err != nil { + if err := ironcoreClient.Get(ctx, client.ObjectKey{Name: storageClass.Type}, volumeClass); err != nil { if apierrors.IsNotFound(err) { return false, fmt.Errorf("VolumeClass not found") } @@ -346,7 +346,7 @@ func isVolumeClassExpandable(ctx context.Context, onmetalClient client.Client, s // getControlPlaneChartValues collects and returns the control plane chart values. func getControlPlaneChartValues( - cpConfig *apisonmetal.ControlPlaneConfig, + cpConfig *apisironcore.ControlPlaneConfig, cp *extensionsv1alpha1.ControlPlane, cluster *extensionscontroller.Cluster, secretsReader secretsmanager.Reader, @@ -370,14 +370,14 @@ func getControlPlaneChartValues( "global": map[string]interface{}{ "genericTokenKubeconfigSecretName": extensionscontroller.GenericTokenKubeconfigSecretNameFromCluster(cluster), }, - onmetal.CloudControllerManagerName: ccm, - onmetal.CSIControllerName: csi, + ironcore.CloudControllerManagerName: ccm, + ironcore.CSIControllerName: csi, }, nil } // getCCMChartValues collects and returns the CCM chart values. func getCCMChartValues( - cpConfig *apisonmetal.ControlPlaneConfig, + cpConfig *apisironcore.ControlPlaneConfig, cp *extensionsv1alpha1.ControlPlane, cluster *extensionscontroller.Cluster, secretsReader secretsmanager.Reader, @@ -452,7 +452,7 @@ func isOverlayEnabled(networking *gardencorev1beta1.Networking) (bool, error) { // getCSIControllerChartValues collects and returns the CSIController chart values. func getCSIControllerChartValues( - _ *apisonmetal.ControlPlaneConfig, + _ *apisironcore.ControlPlaneConfig, _ *extensionsv1alpha1.ControlPlane, cluster *extensionscontroller.Cluster, _ secretsmanager.Reader, @@ -477,8 +477,8 @@ func (vp *valuesProvider) getControlPlaneShootChartValues(cluster *extensionscon } return map[string]interface{}{ - onmetal.CloudControllerManagerName: map[string]interface{}{"enabled": true}, - onmetal.CSINodeName: csiNodeDriverValues, + ironcore.CloudControllerManagerName: map[string]interface{}{"enabled": true}, + ironcore.CSINodeName: csiNodeDriverValues, }, nil } diff --git a/pkg/controller/controlplane/valuesprovider_test.go b/pkg/controller/controlplane/valuesprovider_test.go index cfc440e8..cf25eee7 100644 --- a/pkg/controller/controlplane/valuesprovider_test.go +++ b/pkg/controller/controlplane/valuesprovider_test.go @@ -1,4 +1,4 @@ -// Copyright 2022 OnMetal authors +// Copyright 2022 IronCore authors // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. @@ -38,12 +38,12 @@ import ( fakeclient "sigs.k8s.io/controller-runtime/pkg/client/fake" . "sigs.k8s.io/controller-runtime/pkg/envtest/komega" - apisonmetal "github.com/onmetal/gardener-extension-provider-onmetal/pkg/apis/onmetal" - "github.com/onmetal/gardener-extension-provider-onmetal/pkg/internal" - "github.com/onmetal/gardener-extension-provider-onmetal/pkg/onmetal" - "github.com/onmetal/onmetal-api/api/common/v1alpha1" - corev1alpha1 "github.com/onmetal/onmetal-api/api/core/v1alpha1" - storagev1alpha1 "github.com/onmetal/onmetal-api/api/storage/v1alpha1" + apisironcore "github.com/ironcore-dev/gardener-extension-provider-ironcore/pkg/apis/ironcore" + "github.com/ironcore-dev/gardener-extension-provider-ironcore/pkg/internal" + "github.com/ironcore-dev/gardener-extension-provider-ironcore/pkg/ironcore" + "github.com/ironcore-dev/ironcore/api/common/v1alpha1" + corev1alpha1 "github.com/ironcore-dev/ironcore/api/core/v1alpha1" + storagev1alpha1 "github.com/ironcore-dev/ironcore/api/storage/v1alpha1" ) var _ = Describe("Valueprovider Reconcile", func() { @@ -79,10 +79,10 @@ var _ = Describe("Valueprovider Reconcile", func() { Namespace: ns.Name, }, DefaultSpec: extensionsv1alpha1.DefaultSpec{ - Type: onmetal.Type, + Type: ironcore.Type, ProviderConfig: &runtime.RawExtension{ - Raw: encode(&apisonmetal.ControlPlaneConfig{ - CloudControllerManager: &apisonmetal.CloudControllerManagerConfig{ + Raw: encode(&apisironcore.ControlPlaneConfig{ + CloudControllerManager: &apisironcore.CloudControllerManagerConfig{ FeatureGates: map[string]bool{ "CustomResourceValidation": true, }, @@ -91,7 +91,7 @@ var _ = Describe("Valueprovider Reconcile", func() { }, }, InfrastructureProviderStatus: &runtime.RawExtension{ - Raw: encode(&apisonmetal.InfrastructureStatus{ + Raw: encode(&apisironcore.InfrastructureStatus{ NetworkRef: v1alpha1.LocalUIDReference{ Name: "my-network", UID: "1234", @@ -154,7 +154,7 @@ var _ = Describe("Valueprovider Reconcile", func() { DeferCleanup(k8sClient.Delete, volumeClassStatic) }) It("should return an empty config chart value map if not storageclasses are present in the cloudprofile", func(ctx SpecContext) { - providerCloudProfile := &apisonmetal.CloudProfileConfig{} + providerCloudProfile := &apisironcore.CloudProfileConfig{} providerCloudProfileJson, err := json.Marshal(providerCloudProfile) Expect(err).NotTo(HaveOccurred()) @@ -179,13 +179,13 @@ var _ = Describe("Valueprovider Reconcile", func() { }) It("should return correct config chart values if default and additional storage classes are present in the cloudprofile", func(ctx SpecContext) { - providerCloudProfile := &apisonmetal.CloudProfileConfig{ - StorageClasses: apisonmetal.StorageClasses{ - Default: &apisonmetal.StorageClass{ + providerCloudProfile := &apisironcore.CloudProfileConfig{ + StorageClasses: apisironcore.StorageClasses{ + Default: &apisironcore.StorageClass{ Name: "foo", Type: "volume-expandable", }, - Additional: []apisonmetal.StorageClass{ + Additional: []apisironcore.StorageClass{ { Name: "foo1", Type: "volume-expandable", @@ -238,9 +238,9 @@ var _ = Describe("Valueprovider Reconcile", func() { }) It("should return correct config chart values if only additional storage classes are present in the cloudprofile", func(ctx SpecContext) { - providerCloudProfile := &apisonmetal.CloudProfileConfig{ - StorageClasses: apisonmetal.StorageClasses{ - Additional: []apisonmetal.StorageClass{ + providerCloudProfile := &apisironcore.CloudProfileConfig{ + StorageClasses: apisironcore.StorageClasses{ + Additional: []apisironcore.StorageClass{ { Name: "foo1", Type: "volume-expandable", @@ -287,9 +287,9 @@ var _ = Describe("Valueprovider Reconcile", func() { }) It("should return error if volumeClass is not available", func(ctx SpecContext) { - providerCloudProfile := &apisonmetal.CloudProfileConfig{ - StorageClasses: apisonmetal.StorageClasses{ - Default: &apisonmetal.StorageClass{ + providerCloudProfile := &apisironcore.CloudProfileConfig{ + StorageClasses: apisironcore.StorageClasses{ + Default: &apisironcore.StorageClass{ Name: "foo", Type: "volume-non-existing", }, @@ -327,13 +327,13 @@ var _ = Describe("Valueprovider Reconcile", func() { Describe("#GetControlPlaneShootChartValues", func() { It("should return correct config chart values", func(ctx SpecContext) { - providerCloudProfile := &apisonmetal.CloudProfileConfig{ - StorageClasses: apisonmetal.StorageClasses{ - Default: &apisonmetal.StorageClass{ + providerCloudProfile := &apisironcore.CloudProfileConfig{ + StorageClasses: apisironcore.StorageClasses{ + Default: &apisironcore.StorageClass{ Name: "foo", Type: "volume-expandable", }, - Additional: []apisonmetal.StorageClass{ + Additional: []apisironcore.StorageClass{ { Name: "bar", Type: "volume-static", @@ -395,10 +395,10 @@ var _ = Describe("Valueprovider Reconcile", func() { Namespace: ns.Name, }, DefaultSpec: extensionsv1alpha1.DefaultSpec{ - Type: onmetal.Type, + Type: ironcore.Type, ProviderConfig: &runtime.RawExtension{ - Raw: encode(&apisonmetal.ControlPlaneConfig{ - CloudControllerManager: &apisonmetal.CloudControllerManagerConfig{ + Raw: encode(&apisironcore.ControlPlaneConfig{ + CloudControllerManager: &apisironcore.CloudControllerManagerConfig{ FeatureGates: map[string]bool{ "CustomResourceValidation": true, }, @@ -407,7 +407,7 @@ var _ = Describe("Valueprovider Reconcile", func() { }, }, InfrastructureProviderStatus: &runtime.RawExtension{ - Raw: encode(&apisonmetal.InfrastructureStatus{ + Raw: encode(&apisironcore.InfrastructureStatus{ NetworkRef: v1alpha1.LocalUIDReference{ Name: "my-network", UID: "1234", @@ -416,13 +416,13 @@ var _ = Describe("Valueprovider Reconcile", func() { }, }, } - providerCloudProfile := &apisonmetal.CloudProfileConfig{ - StorageClasses: apisonmetal.StorageClasses{ - Default: &apisonmetal.StorageClass{ + providerCloudProfile := &apisironcore.CloudProfileConfig{ + StorageClasses: apisironcore.StorageClasses{ + Default: &apisironcore.StorageClass{ Name: "foo", Type: "volumeTypeFoo", }, - Additional: []apisonmetal.StorageClass{ + Additional: []apisironcore.StorageClass{ { Name: "bar", Type: "volumeTypeBar", @@ -470,7 +470,7 @@ var _ = Describe("Valueprovider Reconcile", func() { } checksums := map[string]string{ - onmetal.CloudProviderConfigName: "8bafb35ff1ac60275d62e1cbd495aceb511fb354f74a20f7d06ecb48b3a68432", + ironcore.CloudProviderConfigName: "8bafb35ff1ac60275d62e1cbd495aceb511fb354f74a20f7d06ecb48b3a68432", } values, err := vp.GetControlPlaneChartValues(ctx, cp, cluster, fakeSecretsManager, checksums, false) Expect(err).NotTo(HaveOccurred()) diff --git a/pkg/controller/healthcheck/add.go b/pkg/controller/healthcheck/add.go index 2e29ab59..a0e76fe0 100644 --- a/pkg/controller/healthcheck/add.go +++ b/pkg/controller/healthcheck/add.go @@ -1,4 +1,4 @@ -// Copyright 2022 OnMetal authors +// Copyright 2022 IronCore authors // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. @@ -33,7 +33,7 @@ import ( "sigs.k8s.io/controller-runtime/pkg/manager" "sigs.k8s.io/controller-runtime/pkg/predicate" - "github.com/onmetal/gardener-extension-provider-onmetal/pkg/onmetal" + "github.com/ironcore-dev/gardener-extension-provider-ironcore/pkg/ironcore" ) var ( @@ -55,7 +55,7 @@ var ( // RegisterHealthChecks registers health checks for each extension resource func RegisterHealthChecks(ctx context.Context, mgr manager.Manager, opts healthcheck.DefaultAddArgs) error { if err := healthcheck.DefaultRegistration(ctx, - onmetal.Type, + ironcore.Type, extensionsv1alpha1.SchemeGroupVersion.WithKind(extensionsv1alpha1.ControlPlaneResource), func() client.ObjectList { return &extensionsv1alpha1.ControlPlaneList{} }, func() extensionsv1alpha1.Object { return &extensionsv1alpha1.ControlPlane{} }, @@ -65,11 +65,11 @@ func RegisterHealthChecks(ctx context.Context, mgr manager.Manager, opts healthc []healthcheck.ConditionTypeToHealthCheck{ { ConditionType: string(gardencorev1beta1.ShootControlPlaneHealthy), - HealthCheck: general.NewSeedDeploymentHealthChecker(onmetal.CloudControllerManagerName), + HealthCheck: general.NewSeedDeploymentHealthChecker(ironcore.CloudControllerManagerName), }, { ConditionType: string(gardencorev1beta1.ShootControlPlaneHealthy), - HealthCheck: general.NewSeedDeploymentHealthChecker(onmetal.CSIControllerName), + HealthCheck: general.NewSeedDeploymentHealthChecker(ironcore.CSIControllerName), }, { ConditionType: string(gardencorev1beta1.ShootSystemComponentsHealthy), @@ -96,13 +96,13 @@ func RegisterHealthChecks(ctx context.Context, mgr manager.Manager, opts healthc if !GardenletManagesMCM { workerHealthChecks = append(workerHealthChecks, healthcheck.ConditionTypeToHealthCheck{ ConditionType: string(gardencorev1beta1.ShootControlPlaneHealthy), - HealthCheck: general.NewSeedDeploymentHealthChecker(onmetal.MachineControllerManagerName), + HealthCheck: general.NewSeedDeploymentHealthChecker(ironcore.MachineControllerManagerName), }) workerConditionTypesToRemove = workerConditionTypesToRemove.Delete(gardencorev1beta1.ShootControlPlaneHealthy) } return healthcheck.DefaultRegistration(ctx, - onmetal.Type, + ironcore.Type, extensionsv1alpha1.SchemeGroupVersion.WithKind(extensionsv1alpha1.WorkerResource), func() client.ObjectList { return &extensionsv1alpha1.WorkerList{} }, func() extensionsv1alpha1.Object { return &extensionsv1alpha1.Worker{} }, diff --git a/pkg/controller/infrastructure/actuator.go b/pkg/controller/infrastructure/actuator.go index ebdb6fd3..85c0f37b 100644 --- a/pkg/controller/infrastructure/actuator.go +++ b/pkg/controller/infrastructure/actuator.go @@ -1,4 +1,4 @@ -// Copyright 2022 OnMetal authors +// Copyright 2022 IronCore authors // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. diff --git a/pkg/controller/infrastructure/actuator_delete.go b/pkg/controller/infrastructure/actuator_delete.go index b439e2fb..1e409a9b 100644 --- a/pkg/controller/infrastructure/actuator_delete.go +++ b/pkg/controller/infrastructure/actuator_delete.go @@ -1,4 +1,4 @@ -// Copyright 2022 OnMetal authors +// Copyright 2022 IronCore authors // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. @@ -21,9 +21,9 @@ import ( "github.com/gardener/gardener/extensions/pkg/controller" extensionsv1alpha1 "github.com/gardener/gardener/pkg/apis/extensions/v1alpha1" "github.com/go-logr/logr" - "github.com/onmetal/gardener-extension-provider-onmetal/pkg/onmetal" - ipamv1alpha1 "github.com/onmetal/onmetal-api/api/ipam/v1alpha1" - networkingv1alpha1 "github.com/onmetal/onmetal-api/api/networking/v1alpha1" + "github.com/ironcore-dev/gardener-extension-provider-ironcore/pkg/ironcore" + ipamv1alpha1 "github.com/ironcore-dev/ironcore/api/ipam/v1alpha1" + networkingv1alpha1 "github.com/ironcore-dev/ironcore/api/networking/v1alpha1" metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" "sigs.k8s.io/controller-runtime/pkg/client" ) @@ -32,21 +32,21 @@ import ( func (a *actuator) Delete(ctx context.Context, log logr.Logger, infra *extensionsv1alpha1.Infrastructure, cluster *controller.Cluster) error { log.V(2).Info("Deleting infrastructure") - // get onmetal credentials from infrastructure config - onmetalClient, namespace, err := onmetal.GetOnmetalClientAndNamespaceFromCloudProviderSecret(ctx, a.client, cluster.ObjectMeta.Name) + // get ironcore credentials from infrastructure config + ironcoreClient, namespace, err := ironcore.GetIroncoreClientAndNamespaceFromCloudProviderSecret(ctx, a.client, cluster.ObjectMeta.Name) if err != nil { - return fmt.Errorf("failed to get onmetal client and namespace from cloudprovider secret: %w", err) + return fmt.Errorf("failed to get ironcore client and namespace from cloudprovider secret: %w", err) } - if err := a.deletePrefix(ctx, onmetalClient, namespace, cluster); client.IgnoreNotFound(err) != nil { + if err := a.deletePrefix(ctx, ironcoreClient, namespace, cluster); client.IgnoreNotFound(err) != nil { return fmt.Errorf("failed to delete infrastructure: %w", err) } - if err := a.deleteNATGateway(ctx, onmetalClient, namespace, cluster); client.IgnoreNotFound(err) != nil { + if err := a.deleteNATGateway(ctx, ironcoreClient, namespace, cluster); client.IgnoreNotFound(err) != nil { return fmt.Errorf("failed to delete infrastructure: %w", err) } - if err := a.deleteNetwork(ctx, onmetalClient, namespace, cluster); client.IgnoreNotFound(err) != nil { + if err := a.deleteNetwork(ctx, ironcoreClient, namespace, cluster); client.IgnoreNotFound(err) != nil { return fmt.Errorf("failed to delete infrastructure: %w", err) } @@ -54,32 +54,32 @@ func (a *actuator) Delete(ctx context.Context, log logr.Logger, infra *extension return nil } -func (a *actuator) deletePrefix(ctx context.Context, onmetalClient client.Client, namespace string, cluster *controller.Cluster) error { +func (a *actuator) deletePrefix(ctx context.Context, ironcoreClient client.Client, namespace string, cluster *controller.Cluster) error { prefix := &ipamv1alpha1.Prefix{ ObjectMeta: metav1.ObjectMeta{ Namespace: namespace, Name: generateResourceNameFromCluster(cluster), }, } - return onmetalClient.Delete(ctx, prefix) + return ironcoreClient.Delete(ctx, prefix) } -func (a *actuator) deleteNATGateway(ctx context.Context, onmetalClient client.Client, namespace string, cluster *controller.Cluster) error { +func (a *actuator) deleteNATGateway(ctx context.Context, ironcoreClient client.Client, namespace string, cluster *controller.Cluster) error { natGateway := &networkingv1alpha1.NATGateway{ ObjectMeta: metav1.ObjectMeta{ Namespace: namespace, Name: generateResourceNameFromCluster(cluster), }, } - return onmetalClient.Delete(ctx, natGateway) + return ironcoreClient.Delete(ctx, natGateway) } -func (a *actuator) deleteNetwork(ctx context.Context, onmetalClient client.Client, namespace string, cluster *controller.Cluster) error { +func (a *actuator) deleteNetwork(ctx context.Context, ironcoreClient client.Client, namespace string, cluster *controller.Cluster) error { network := &networkingv1alpha1.Network{ ObjectMeta: metav1.ObjectMeta{ Namespace: namespace, Name: generateResourceNameFromCluster(cluster), }, } - return onmetalClient.Delete(ctx, network) + return ironcoreClient.Delete(ctx, network) } diff --git a/pkg/controller/infrastructure/actuator_delete_test.go b/pkg/controller/infrastructure/actuator_delete_test.go index 0b861a94..ec2ac47d 100644 --- a/pkg/controller/infrastructure/actuator_delete_test.go +++ b/pkg/controller/infrastructure/actuator_delete_test.go @@ -1,4 +1,4 @@ -// Copyright 2023 OnMetal authors +// Copyright 2023 IronCore authors // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. @@ -18,10 +18,10 @@ import ( extensionscontroller "github.com/gardener/gardener/extensions/pkg/controller" "github.com/gardener/gardener/pkg/apis/core/v1beta1/constants" extensionsv1alpha1 "github.com/gardener/gardener/pkg/apis/extensions/v1alpha1" - "github.com/onmetal/gardener-extension-provider-onmetal/pkg/apis/onmetal/v1alpha1" - "github.com/onmetal/gardener-extension-provider-onmetal/pkg/onmetal" - ipamv1alpha1 "github.com/onmetal/onmetal-api/api/ipam/v1alpha1" - networkingv1alpha1 "github.com/onmetal/onmetal-api/api/networking/v1alpha1" + "github.com/ironcore-dev/gardener-extension-provider-ironcore/pkg/apis/ironcore/v1alpha1" + "github.com/ironcore-dev/gardener-extension-provider-ironcore/pkg/ironcore" + ipamv1alpha1 "github.com/ironcore-dev/ironcore/api/ipam/v1alpha1" + networkingv1alpha1 "github.com/ironcore-dev/ironcore/api/networking/v1alpha1" . "github.com/onsi/ginkgo/v2" . "github.com/onsi/gomega" apierrors "k8s.io/apimachinery/pkg/api/errors" @@ -52,7 +52,7 @@ var _ = Describe("Infrastructure Reconcile", func() { }, Spec: extensionsv1alpha1.InfrastructureSpec{ DefaultSpec: extensionsv1alpha1.DefaultSpec{ - Type: onmetal.Type, + Type: ironcore.Type, ProviderConfig: &runtime.RawExtension{Object: providerConfig}, }, Region: "foo", diff --git a/pkg/controller/infrastructure/actuator_migrate.go b/pkg/controller/infrastructure/actuator_migrate.go index c9163656..8698a928 100644 --- a/pkg/controller/infrastructure/actuator_migrate.go +++ b/pkg/controller/infrastructure/actuator_migrate.go @@ -1,4 +1,4 @@ -// Copyright 2022 OnMetal authors +// Copyright 2022 IronCore authors // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. diff --git a/pkg/controller/infrastructure/actuator_reconcile.go b/pkg/controller/infrastructure/actuator_reconcile.go index 756347ac..43790013 100644 --- a/pkg/controller/infrastructure/actuator_reconcile.go +++ b/pkg/controller/infrastructure/actuator_reconcile.go @@ -1,4 +1,4 @@ -// Copyright 2022 OnMetal authors +// Copyright 2022 IronCore authors // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. @@ -21,13 +21,13 @@ import ( "github.com/gardener/gardener/extensions/pkg/controller" extensionsv1alpha1 "github.com/gardener/gardener/pkg/apis/extensions/v1alpha1" "github.com/go-logr/logr" - api "github.com/onmetal/gardener-extension-provider-onmetal/pkg/apis/onmetal" - "github.com/onmetal/gardener-extension-provider-onmetal/pkg/apis/onmetal/helper" - apiv1alpha1 "github.com/onmetal/gardener-extension-provider-onmetal/pkg/apis/onmetal/v1alpha1" - "github.com/onmetal/gardener-extension-provider-onmetal/pkg/onmetal" - "github.com/onmetal/onmetal-api/api/common/v1alpha1" - ipamv1alpha1 "github.com/onmetal/onmetal-api/api/ipam/v1alpha1" - networkingv1alpha1 "github.com/onmetal/onmetal-api/api/networking/v1alpha1" + api "github.com/ironcore-dev/gardener-extension-provider-ironcore/pkg/apis/ironcore" + "github.com/ironcore-dev/gardener-extension-provider-ironcore/pkg/apis/ironcore/helper" + apiv1alpha1 "github.com/ironcore-dev/gardener-extension-provider-ironcore/pkg/apis/ironcore/v1alpha1" + "github.com/ironcore-dev/gardener-extension-provider-ironcore/pkg/ironcore" + "github.com/ironcore-dev/ironcore/api/common/v1alpha1" + ipamv1alpha1 "github.com/ironcore-dev/ironcore/api/ipam/v1alpha1" + networkingv1alpha1 "github.com/ironcore-dev/ironcore/api/networking/v1alpha1" corev1 "k8s.io/api/core/v1" metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" "k8s.io/apimachinery/pkg/runtime" @@ -53,23 +53,23 @@ func (a *actuator) reconcile(ctx context.Context, log logr.Logger, infra *extens return err } - // get onmetal credentials from infrastructure config - onmetalClient, namespace, err := onmetal.GetOnmetalClientAndNamespaceFromCloudProviderSecret(ctx, a.client, cluster.ObjectMeta.Name) + // get ironcore credentials from infrastructure config + ironcoreClient, namespace, err := ironcore.GetIroncoreClientAndNamespaceFromCloudProviderSecret(ctx, a.client, cluster.ObjectMeta.Name) if err != nil { - return fmt.Errorf("failed to get onmetal client and namespace from cloudprovider secret: %w", err) + return fmt.Errorf("failed to get ironcore client and namespace from cloudprovider secret: %w", err) } - network, err := a.applyNetwork(ctx, onmetalClient, namespace, config, cluster) + network, err := a.applyNetwork(ctx, ironcoreClient, namespace, config, cluster) if err != nil { return err } - natGateway, err := a.applyNATGateway(ctx, onmetalClient, namespace, cluster, network) + natGateway, err := a.applyNATGateway(ctx, ironcoreClient, namespace, cluster, network) if err != nil { return err } - prefix, err := a.applyPrefix(ctx, onmetalClient, namespace, cluster) + prefix, err := a.applyPrefix(ctx, ironcoreClient, namespace, cluster) if err != nil { return err } @@ -80,11 +80,11 @@ func (a *actuator) reconcile(ctx context.Context, log logr.Logger, infra *extens return a.updateProviderStatus(ctx, infra, network, natGateway, prefix) } -func (a *actuator) applyPrefix(ctx context.Context, onmetalClient client.Client, namespace string, cluster *controller.Cluster) (*ipamv1alpha1.Prefix, error) { +func (a *actuator) applyPrefix(ctx context.Context, ironcoreClient client.Client, namespace string, cluster *controller.Cluster) (*ipamv1alpha1.Prefix, error) { prefix := &ipamv1alpha1.Prefix{ TypeMeta: metav1.TypeMeta{ Kind: "Prefix", - APIVersion: "ipam.api.onmetal.de/v1alpha1", + APIVersion: "ipam.ironcore.dev/v1alpha1", }, ObjectMeta: metav1.ObjectMeta{ Namespace: namespace, @@ -100,18 +100,18 @@ func (a *actuator) applyPrefix(ctx context.Context, onmetalClient client.Client, prefix.Spec.Prefix = v1alpha1.MustParseNewIPPrefix(pointer.StringDeref(nodeCIDR, "")) } - if _, err := controllerutil.CreateOrPatch(ctx, onmetalClient, prefix, nil); err != nil { + if _, err := controllerutil.CreateOrPatch(ctx, ironcoreClient, prefix, nil); err != nil { return nil, fmt.Errorf("failed to apply prefix %s: %w", client.ObjectKeyFromObject(prefix), err) } return prefix, nil } -func (a *actuator) applyNATGateway(ctx context.Context, onmetalClient client.Client, namespace string, cluster *controller.Cluster, network *networkingv1alpha1.Network) (*networkingv1alpha1.NATGateway, error) { +func (a *actuator) applyNATGateway(ctx context.Context, ironcoreClient client.Client, namespace string, cluster *controller.Cluster, network *networkingv1alpha1.Network) (*networkingv1alpha1.NATGateway, error) { natGateway := &networkingv1alpha1.NATGateway{ TypeMeta: metav1.TypeMeta{ Kind: "NATGateway", - APIVersion: "networking.api.onmetal.de/v1alpha1", + APIVersion: "networking.ironcore.dev/v1alpha1", }, ObjectMeta: metav1.ObjectMeta{ Namespace: namespace, @@ -127,17 +127,17 @@ func (a *actuator) applyNATGateway(ctx context.Context, onmetalClient client.Cli }, } - if _, err := controllerutil.CreateOrPatch(ctx, onmetalClient, natGateway, nil); err != nil { + if _, err := controllerutil.CreateOrPatch(ctx, ironcoreClient, natGateway, nil); err != nil { return nil, fmt.Errorf("failed to apply natgateway %s: %w", client.ObjectKeyFromObject(natGateway), err) } return natGateway, nil } -func (a *actuator) applyNetwork(ctx context.Context, onmetalClient client.Client, namespace string, config *api.InfrastructureConfig, cluster *controller.Cluster) (*networkingv1alpha1.Network, error) { +func (a *actuator) applyNetwork(ctx context.Context, ironcoreClient client.Client, namespace string, config *api.InfrastructureConfig, cluster *controller.Cluster) (*networkingv1alpha1.Network, error) { if config != nil && config.NetworkRef != nil { network := &networkingv1alpha1.Network{} networkKey := client.ObjectKey{Namespace: namespace, Name: config.NetworkRef.Name} - if err := onmetalClient.Get(ctx, networkKey, network); err != nil { + if err := ironcoreClient.Get(ctx, networkKey, network); err != nil { return nil, fmt.Errorf("failed to get network %s: %w", networkKey, err) } return network, nil @@ -146,7 +146,7 @@ func (a *actuator) applyNetwork(ctx context.Context, onmetalClient client.Client network := &networkingv1alpha1.Network{ TypeMeta: metav1.TypeMeta{ Kind: "Network", - APIVersion: "networking.api.onmetal.de/v1alpha1", + APIVersion: "networking.ironcore.dev/v1alpha1", }, ObjectMeta: metav1.ObjectMeta{ Namespace: namespace, @@ -154,7 +154,7 @@ func (a *actuator) applyNetwork(ctx context.Context, onmetalClient client.Client }, } - if _, err := controllerutil.CreateOrPatch(ctx, onmetalClient, network, nil); err != nil { + if _, err := controllerutil.CreateOrPatch(ctx, ironcoreClient, network, nil); err != nil { return nil, fmt.Errorf("failed to apply network %s: %w", client.ObjectKeyFromObject(network), err) } return network, nil diff --git a/pkg/controller/infrastructure/actuator_reconcile_test.go b/pkg/controller/infrastructure/actuator_reconcile_test.go index 49603aea..b7e61e98 100644 --- a/pkg/controller/infrastructure/actuator_reconcile_test.go +++ b/pkg/controller/infrastructure/actuator_reconcile_test.go @@ -1,4 +1,4 @@ -// Copyright 2023 OnMetal authors +// Copyright 2023 IronCore authors // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. @@ -20,9 +20,9 @@ import ( extensionscontroller "github.com/gardener/gardener/extensions/pkg/controller" "github.com/gardener/gardener/pkg/apis/core/v1beta1/constants" extensionsv1alpha1 "github.com/gardener/gardener/pkg/apis/extensions/v1alpha1" - commonv1alpha1 "github.com/onmetal/onmetal-api/api/common/v1alpha1" - ipamv1alpha1 "github.com/onmetal/onmetal-api/api/ipam/v1alpha1" - networkingv1alpha1 "github.com/onmetal/onmetal-api/api/networking/v1alpha1" + commonv1alpha1 "github.com/ironcore-dev/ironcore/api/common/v1alpha1" + ipamv1alpha1 "github.com/ironcore-dev/ironcore/api/ipam/v1alpha1" + networkingv1alpha1 "github.com/ironcore-dev/ironcore/api/networking/v1alpha1" . "github.com/onsi/ginkgo/v2" . "github.com/onsi/gomega" corev1 "k8s.io/api/core/v1" @@ -31,8 +31,8 @@ import ( "sigs.k8s.io/controller-runtime/pkg/client" . "sigs.k8s.io/controller-runtime/pkg/envtest/komega" - "github.com/onmetal/gardener-extension-provider-onmetal/pkg/apis/onmetal/v1alpha1" - "github.com/onmetal/gardener-extension-provider-onmetal/pkg/onmetal" + "github.com/ironcore-dev/gardener-extension-provider-ironcore/pkg/apis/ironcore/v1alpha1" + "github.com/ironcore-dev/gardener-extension-provider-ironcore/pkg/ironcore" ) var _ = Describe("Infrastructure Reconcile", func() { @@ -62,7 +62,7 @@ var _ = Describe("Infrastructure Reconcile", func() { }, Spec: extensionsv1alpha1.InfrastructureSpec{ DefaultSpec: extensionsv1alpha1.DefaultSpec{ - Type: onmetal.Type, + Type: ironcore.Type, ProviderConfig: &runtime.RawExtension{Object: &v1alpha1.InfrastructureConfig{ TypeMeta: metav1.TypeMeta{ APIVersion: v1alpha1.SchemeGroupVersion.String(), @@ -124,7 +124,7 @@ var _ = Describe("Infrastructure Reconcile", func() { By("ensuring that the infrastructure state contains the correct refs") providerStatus := map[string]interface{}{ - "apiVersion": "onmetal.provider.extensions.gardener.cloud/v1alpha1", + "apiVersion": "ironcore.provider.extensions.gardener.cloud/v1alpha1", "kind": "InfrastructureStatus", "networkRef": map[string]interface{}{ "name": network.Name, @@ -162,7 +162,7 @@ var _ = Describe("Infrastructure Reconcile", func() { }, Spec: extensionsv1alpha1.InfrastructureSpec{ DefaultSpec: extensionsv1alpha1.DefaultSpec{ - Type: onmetal.Type, + Type: ironcore.Type, ProviderConfig: &runtime.RawExtension{Object: &v1alpha1.InfrastructureConfig{}}, }, Region: "foo", @@ -224,7 +224,7 @@ var _ = Describe("Infrastructure Reconcile", func() { By("ensuring that the infrastructure state contains the correct refs") providerStatus := map[string]interface{}{ - "apiVersion": "onmetal.provider.extensions.gardener.cloud/v1alpha1", + "apiVersion": "ironcore.provider.extensions.gardener.cloud/v1alpha1", "kind": "InfrastructureStatus", "networkRef": map[string]interface{}{ "name": network.Name, diff --git a/pkg/controller/infrastructure/actuator_restore.go b/pkg/controller/infrastructure/actuator_restore.go index 72eb7291..33e85cd7 100644 --- a/pkg/controller/infrastructure/actuator_restore.go +++ b/pkg/controller/infrastructure/actuator_restore.go @@ -1,4 +1,4 @@ -// Copyright 2022 OnMetal authors +// Copyright 2022 IronCore authors // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. diff --git a/pkg/controller/infrastructure/add.go b/pkg/controller/infrastructure/add.go index 3faaedb6..49eb4429 100644 --- a/pkg/controller/infrastructure/add.go +++ b/pkg/controller/infrastructure/add.go @@ -1,4 +1,4 @@ -// Copyright 2022 OnMetal authors +// Copyright 2022 IronCore authors // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. @@ -18,7 +18,7 @@ import ( "context" "github.com/gardener/gardener/extensions/pkg/controller/infrastructure" - "github.com/onmetal/gardener-extension-provider-onmetal/pkg/onmetal" + "github.com/ironcore-dev/gardener-extension-provider-ironcore/pkg/ironcore" "sigs.k8s.io/controller-runtime/pkg/controller" "sigs.k8s.io/controller-runtime/pkg/log" "sigs.k8s.io/controller-runtime/pkg/manager" @@ -29,7 +29,7 @@ var ( DefaultAddOptions = AddOptions{} ) -// AddOptions are options to apply when adding the onmetal infrastructure controller to the manager. +// AddOptions are options to apply when adding the ironcore infrastructure controller to the manager. type AddOptions struct { // Controller are the controller.Options. Controller controller.Options @@ -45,7 +45,7 @@ func AddToManagerWithOptions(ctx context.Context, mgr manager.Manager, opts AddO ConfigValidator: NewConfigValidator(mgr.GetClient(), log.Log), ControllerOptions: opts.Controller, Predicates: infrastructure.DefaultPredicates(ctx, mgr, opts.IgnoreOperationAnnotation), - Type: onmetal.Type, + Type: ironcore.Type, }) } diff --git a/pkg/controller/infrastructure/configvalidator.go b/pkg/controller/infrastructure/configvalidator.go index 72ae2f42..f0614ae2 100644 --- a/pkg/controller/infrastructure/configvalidator.go +++ b/pkg/controller/infrastructure/configvalidator.go @@ -1,4 +1,4 @@ -// Copyright 2022 OnMetal authors +// Copyright 2022 IronCore authors // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. @@ -21,16 +21,16 @@ import ( "github.com/gardener/gardener/extensions/pkg/controller/infrastructure" extensionsv1alpha1 "github.com/gardener/gardener/pkg/apis/extensions/v1alpha1" "github.com/go-logr/logr" - networkingv1alpha1 "github.com/onmetal/onmetal-api/api/networking/v1alpha1" + networkingv1alpha1 "github.com/ironcore-dev/ironcore/api/networking/v1alpha1" apierrors "k8s.io/apimachinery/pkg/api/errors" "k8s.io/apimachinery/pkg/util/validation/field" "sigs.k8s.io/controller-runtime/pkg/client" - "github.com/onmetal/gardener-extension-provider-onmetal/pkg/apis/onmetal/helper" - "github.com/onmetal/gardener-extension-provider-onmetal/pkg/onmetal" + "github.com/ironcore-dev/gardener-extension-provider-ironcore/pkg/apis/ironcore/helper" + "github.com/ironcore-dev/gardener-extension-provider-ironcore/pkg/ironcore" ) -// configValidator implements ConfigValidator for onmetal infrastructure resources. +// configValidator implements ConfigValidator for ironcore infrastructure resources. type configValidator struct { client client.Client logger logr.Logger @@ -40,7 +40,7 @@ type configValidator struct { func NewConfigValidator(client client.Client, logger logr.Logger) infrastructure.ConfigValidator { return &configValidator{ client: client, - logger: logger.WithName("onmetal-infrastructure-config-validator"), + logger: logger.WithName("ironcore-infrastructure-config-validator"), } } @@ -64,21 +64,21 @@ func (c *configValidator) Validate(ctx context.Context, infra *extensionsv1alpha return allErrs } - // get onmetal credentials from infrastructure config - onmetalClient, namespace, err := onmetal.GetOnmetalClientAndNamespaceFromCloudProviderSecret(ctx, c.client, infra.Namespace) + // get ironcore credentials from infrastructure config + ironcoreClient, namespace, err := ironcore.GetIroncoreClientAndNamespaceFromCloudProviderSecret(ctx, c.client, infra.Namespace) if err != nil { - allErrs = append(allErrs, field.InternalError(nil, fmt.Errorf("could not get onmetal client and namespace: %w", err))) + allErrs = append(allErrs, field.InternalError(nil, fmt.Errorf("could not get ironcore client and namespace: %w", err))) return allErrs } // ensure that the referenced network exists network := &networkingv1alpha1.Network{} - if err := onmetalClient.Get(ctx, client.ObjectKey{Namespace: namespace, Name: config.NetworkRef.Name}, network); err != nil { + if err := ironcoreClient.Get(ctx, client.ObjectKey{Namespace: namespace, Name: config.NetworkRef.Name}, network); err != nil { if apierrors.IsNotFound(err) { - allErrs = append(allErrs, field.NotFound(field.NewPath("networkRef"), fmt.Errorf("could not find onmetal network %s: %w", client.ObjectKeyFromObject(network), err))) + allErrs = append(allErrs, field.NotFound(field.NewPath("networkRef"), fmt.Errorf("could not find ironcore network %s: %w", client.ObjectKeyFromObject(network), err))) return allErrs } - allErrs = append(allErrs, field.InternalError(field.NewPath("networkRef"), fmt.Errorf("failed to get onmetal network %s: %w", client.ObjectKeyFromObject(network), err))) + allErrs = append(allErrs, field.InternalError(field.NewPath("networkRef"), fmt.Errorf("failed to get ironcore network %s: %w", client.ObjectKeyFromObject(network), err))) } return allErrs diff --git a/pkg/controller/infrastructure/configvalidator_test.go b/pkg/controller/infrastructure/configvalidator_test.go index 369c7a21..2c8ee878 100644 --- a/pkg/controller/infrastructure/configvalidator_test.go +++ b/pkg/controller/infrastructure/configvalidator_test.go @@ -1,4 +1,4 @@ -// Copyright 2023 OnMetal authors +// Copyright 2023 IronCore authors // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. @@ -18,7 +18,7 @@ import ( "github.com/gardener/gardener/extensions/pkg/controller/infrastructure" gardenerextensionv1alpha1 "github.com/gardener/gardener/pkg/apis/extensions/v1alpha1" . "github.com/gardener/gardener/pkg/utils/test/matchers" - networkingv1alpha1 "github.com/onmetal/onmetal-api/api/networking/v1alpha1" + networkingv1alpha1 "github.com/ironcore-dev/ironcore/api/networking/v1alpha1" . "github.com/onsi/ginkgo/v2" . "github.com/onsi/gomega" . "github.com/onsi/gomega/gstruct" @@ -28,8 +28,8 @@ import ( "k8s.io/apimachinery/pkg/util/validation/field" "sigs.k8s.io/controller-runtime/pkg/log" - "github.com/onmetal/gardener-extension-provider-onmetal/pkg/apis/onmetal/v1alpha1" - "github.com/onmetal/gardener-extension-provider-onmetal/pkg/onmetal" + "github.com/ironcore-dev/gardener-extension-provider-ironcore/pkg/apis/ironcore/v1alpha1" + "github.com/ironcore-dev/gardener-extension-provider-ironcore/pkg/ironcore" ) var _ = Describe("ConfigValidator", func() { @@ -74,7 +74,7 @@ var _ = Describe("ConfigValidator", func() { }, Spec: gardenerextensionv1alpha1.InfrastructureSpec{ DefaultSpec: gardenerextensionv1alpha1.DefaultSpec{ - Type: onmetal.Type, + Type: ironcore.Type, ProviderConfig: &runtime.RawExtension{Object: &v1alpha1.InfrastructureConfig{ TypeMeta: metav1.TypeMeta{ APIVersion: v1alpha1.SchemeGroupVersion.String(), @@ -103,7 +103,7 @@ var _ = Describe("ConfigValidator", func() { }, Spec: gardenerextensionv1alpha1.InfrastructureSpec{ DefaultSpec: gardenerextensionv1alpha1.DefaultSpec{ - Type: onmetal.Type, + Type: ironcore.Type, ProviderConfig: &runtime.RawExtension{Object: &v1alpha1.InfrastructureConfig{ TypeMeta: metav1.TypeMeta{ APIVersion: v1alpha1.SchemeGroupVersion.String(), diff --git a/pkg/controller/infrastructure/suite_test.go b/pkg/controller/infrastructure/suite_test.go index c51b5443..02d02885 100644 --- a/pkg/controller/infrastructure/suite_test.go +++ b/pkg/controller/infrastructure/suite_test.go @@ -1,4 +1,4 @@ -// Copyright 2022 OnMetal authors +// Copyright 2022 IronCore authors // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. @@ -23,15 +23,15 @@ import ( "github.com/gardener/gardener/pkg/apis/core/v1beta1" extensionsv1alpha1 "github.com/gardener/gardener/pkg/apis/extensions/v1alpha1" - "github.com/onmetal/controller-utils/buildutils" - "github.com/onmetal/controller-utils/modutils" - apiv1alpha1 "github.com/onmetal/gardener-extension-provider-onmetal/pkg/apis/onmetal/v1alpha1" - computev1alpha1 "github.com/onmetal/onmetal-api/api/compute/v1alpha1" - ipamv1alpha1 "github.com/onmetal/onmetal-api/api/ipam/v1alpha1" - networkingv1alpha1 "github.com/onmetal/onmetal-api/api/networking/v1alpha1" - storagev1alpha1 "github.com/onmetal/onmetal-api/api/storage/v1alpha1" - utilsenvtest "github.com/onmetal/onmetal-api/utils/envtest" - "github.com/onmetal/onmetal-api/utils/envtest/apiserver" + "github.com/ironcore-dev/controller-utils/buildutils" + "github.com/ironcore-dev/controller-utils/modutils" + apiv1alpha1 "github.com/ironcore-dev/gardener-extension-provider-ironcore/pkg/apis/ironcore/v1alpha1" + computev1alpha1 "github.com/ironcore-dev/ironcore/api/compute/v1alpha1" + ipamv1alpha1 "github.com/ironcore-dev/ironcore/api/ipam/v1alpha1" + networkingv1alpha1 "github.com/ironcore-dev/ironcore/api/networking/v1alpha1" + storagev1alpha1 "github.com/ironcore-dev/ironcore/api/storage/v1alpha1" + utilsenvtest "github.com/ironcore-dev/ironcore/utils/envtest" + "github.com/ironcore-dev/ironcore/utils/envtest/apiserver" . "github.com/onsi/ginkgo/v2" . "github.com/onsi/gomega" corev1 "k8s.io/api/core/v1" @@ -88,7 +88,7 @@ var _ = BeforeSuite(func() { } testEnvExt = &utilsenvtest.EnvironmentExtensions{ APIServiceDirectoryPaths: []string{ - modutils.Dir("github.com/onmetal/onmetal-api", "config", "apiserver", "apiservice", "bases"), + modutils.Dir("github.com/ironcore-dev/ironcore", "config", "apiserver", "apiservice", "bases"), }, ErrorIfAPIServicePathIsMissing: true, } @@ -114,7 +114,7 @@ var _ = BeforeSuite(func() { komega.SetClient(k8sClient) apiSrv, err := apiserver.New(cfg, apiserver.Options{ - MainPath: "github.com/onmetal/onmetal-api/cmd/onmetal-apiserver", + MainPath: "github.com/ironcore-dev/ironcore/cmd/ironcore-apiserver", BuildOptions: []buildutils.BuildOption{buildutils.ModModeMod}, ETCDServers: []string{testEnv.ControlPlane.Etcd.URL.String()}, Host: testEnvExt.APIServiceInstallOptions.LocalServingHost, diff --git a/pkg/controller/worker/actuator.go b/pkg/controller/worker/actuator.go index 7eab9451..47b558e4 100644 --- a/pkg/controller/worker/actuator.go +++ b/pkg/controller/worker/actuator.go @@ -1,4 +1,4 @@ -// Copyright 2022 OnMetal authors +// Copyright 2022 IronCore authors // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. @@ -24,10 +24,10 @@ import ( extensionsv1alpha1 "github.com/gardener/gardener/pkg/apis/extensions/v1alpha1" "github.com/gardener/gardener/pkg/utils/chart" imagevectorutils "github.com/gardener/gardener/pkg/utils/imagevector" - api "github.com/onmetal/gardener-extension-provider-onmetal/pkg/apis/onmetal" - "github.com/onmetal/gardener-extension-provider-onmetal/pkg/apis/onmetal/helper" - "github.com/onmetal/gardener-extension-provider-onmetal/pkg/internal/imagevector" - "github.com/onmetal/gardener-extension-provider-onmetal/pkg/onmetal" + api "github.com/ironcore-dev/gardener-extension-provider-ironcore/pkg/apis/ironcore" + "github.com/ironcore-dev/gardener-extension-provider-ironcore/pkg/apis/ironcore/helper" + "github.com/ironcore-dev/gardener-extension-provider-ironcore/pkg/internal/imagevector" + "github.com/ironcore-dev/gardener-extension-provider-ironcore/pkg/ironcore" "k8s.io/apimachinery/pkg/runtime" "k8s.io/apimachinery/pkg/runtime/serializer" "k8s.io/client-go/kubernetes" @@ -60,7 +60,7 @@ func NewActuator(mgr manager.Manager, gardenletManagesMCM bool) (worker.Actuator ) if !gardenletManagesMCM { - mcmName = onmetal.MachineControllerManagerName + mcmName = ironcore.MachineControllerManagerName mcmChartSeed = mcmChart mcmChartShoot = mcmShootChart imageVector = imagevector.ImageVector() diff --git a/pkg/controller/worker/add.go b/pkg/controller/worker/add.go index 2403b12d..8a2228c3 100644 --- a/pkg/controller/worker/add.go +++ b/pkg/controller/worker/add.go @@ -1,4 +1,4 @@ -// Copyright 2022 OnMetal authors +// Copyright 2022 IronCore authors // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. @@ -19,7 +19,7 @@ import ( "github.com/gardener/gardener/extensions/pkg/controller/worker" machinescheme "github.com/gardener/machine-controller-manager/pkg/client/clientset/versioned/scheme" - "github.com/onmetal/gardener-extension-provider-onmetal/pkg/onmetal" + "github.com/ironcore-dev/gardener-extension-provider-ironcore/pkg/ironcore" apiextensionsscheme "k8s.io/apiextensions-apiserver/pkg/client/clientset/clientset/scheme" "k8s.io/apimachinery/pkg/runtime" "k8s.io/utils/pointer" @@ -34,7 +34,7 @@ var ( } ) -// AddOptions are options to apply when adding the onmetal worker controller to the manager. +// AddOptions are options to apply when adding the ironcore worker controller to the manager. type AddOptions struct { // Controller are the controller.Options. Controller controller.Options @@ -65,7 +65,7 @@ func AddToManagerWithOptions(ctx context.Context, mgr manager.Manager, opts AddO Actuator: actuator, ControllerOptions: opts.Controller, Predicates: worker.DefaultPredicates(ctx, mgr, opts.IgnoreOperationAnnotation), - Type: onmetal.Type, + Type: ironcore.Type, }) } diff --git a/pkg/controller/worker/machine_controller_manager.go b/pkg/controller/worker/machine_controller_manager.go index 2f2796ba..660b2382 100644 --- a/pkg/controller/worker/machine_controller_manager.go +++ b/pkg/controller/worker/machine_controller_manager.go @@ -1,4 +1,4 @@ -// Copyright 2022 OnMetal authors +// Copyright 2022 IronCore authors // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. @@ -27,30 +27,30 @@ import ( corev1 "k8s.io/api/core/v1" rbacv1 "k8s.io/api/rbac/v1" - "github.com/onmetal/gardener-extension-provider-onmetal/pkg/onmetal" + "github.com/ironcore-dev/gardener-extension-provider-ironcore/pkg/ironcore" ) var ( mcmChart = &chart.Chart{ - Name: onmetal.MachineControllerManagerName, - Path: filepath.Join(onmetal.InternalChartsPath, onmetal.MachineControllerManagerName, "seed"), - Images: []string{onmetal.MachineControllerManagerImageName, onmetal.MachineControllerManagerProviderOnmetalImageName}, + Name: ironcore.MachineControllerManagerName, + Path: filepath.Join(ironcore.InternalChartsPath, ironcore.MachineControllerManagerName, "seed"), + Images: []string{ironcore.MachineControllerManagerImageName, ironcore.MachineControllerManagerProviderIroncoreImageName}, Objects: []*chart.Object{ - {Type: &appsv1.Deployment{}, Name: onmetal.MachineControllerManagerName}, - {Type: &corev1.Service{}, Name: onmetal.MachineControllerManagerName}, - {Type: &corev1.ServiceAccount{}, Name: onmetal.MachineControllerManagerName}, - {Type: &corev1.Secret{}, Name: onmetal.MachineControllerManagerName}, - {Type: extensionscontroller.GetVerticalPodAutoscalerObject(), Name: onmetal.MachineControllerManagerVpaName}, - {Type: &corev1.ConfigMap{}, Name: onmetal.MachineControllerManagerMonitoringConfigName}, + {Type: &appsv1.Deployment{}, Name: ironcore.MachineControllerManagerName}, + {Type: &corev1.Service{}, Name: ironcore.MachineControllerManagerName}, + {Type: &corev1.ServiceAccount{}, Name: ironcore.MachineControllerManagerName}, + {Type: &corev1.Secret{}, Name: ironcore.MachineControllerManagerName}, + {Type: extensionscontroller.GetVerticalPodAutoscalerObject(), Name: ironcore.MachineControllerManagerVpaName}, + {Type: &corev1.ConfigMap{}, Name: ironcore.MachineControllerManagerMonitoringConfigName}, }, } mcmShootChart = &chart.Chart{ - Name: onmetal.MachineControllerManagerName, - Path: filepath.Join(onmetal.InternalChartsPath, onmetal.MachineControllerManagerName, "shoot"), + Name: ironcore.MachineControllerManagerName, + Path: filepath.Join(ironcore.InternalChartsPath, ironcore.MachineControllerManagerName, "shoot"), Objects: []*chart.Object{ - {Type: &rbacv1.ClusterRole{}, Name: fmt.Sprintf("extensions.gardener.cloud:%s:%s", onmetal.ProviderName, onmetal.MachineControllerManagerName)}, - {Type: &rbacv1.ClusterRoleBinding{}, Name: fmt.Sprintf("extensions.gardener.cloud:%s:%s", onmetal.ProviderName, onmetal.MachineControllerManagerName)}, + {Type: &rbacv1.ClusterRole{}, Name: fmt.Sprintf("extensions.gardener.cloud:%s:%s", ironcore.ProviderName, ironcore.MachineControllerManagerName)}, + {Type: &rbacv1.ClusterRoleBinding{}, Name: fmt.Sprintf("extensions.gardener.cloud:%s:%s", ironcore.ProviderName, ironcore.MachineControllerManagerName)}, }, } ) @@ -62,7 +62,7 @@ func (w *workerDelegate) GetMachineControllerManagerChartValues(ctx context.Cont } return map[string]interface{}{ - "providerName": onmetal.ProviderName, + "providerName": ironcore.ProviderName, "namespace": map[string]interface{}{ "uid": namespace.UID, }, @@ -74,6 +74,6 @@ func (w *workerDelegate) GetMachineControllerManagerChartValues(ctx context.Cont func (w *workerDelegate) GetMachineControllerManagerShootChartValues(ctx context.Context) (map[string]interface{}, error) { return map[string]interface{}{ - "providerName": onmetal.ProviderName, + "providerName": ironcore.ProviderName, }, nil } diff --git a/pkg/controller/worker/machine_dependencies.go b/pkg/controller/worker/machine_dependencies.go index 3cbe961a..9a811195 100644 --- a/pkg/controller/worker/machine_dependencies.go +++ b/pkg/controller/worker/machine_dependencies.go @@ -1,4 +1,4 @@ -// Copyright 2022 OnMetal authors +// Copyright 2022 IronCore authors // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. diff --git a/pkg/controller/worker/machine_images.go b/pkg/controller/worker/machine_images.go index b00960c1..6ab8e473 100644 --- a/pkg/controller/worker/machine_images.go +++ b/pkg/controller/worker/machine_images.go @@ -1,4 +1,4 @@ -// Copyright 2022 OnMetal authors +// Copyright 2022 IronCore authors // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. @@ -26,8 +26,8 @@ import ( "k8s.io/utils/pointer" "sigs.k8s.io/controller-runtime/pkg/client" - apiv1alpha1 "github.com/onmetal/gardener-extension-provider-onmetal/pkg/apis/onmetal/v1alpha1" - "github.com/onmetal/gardener-extension-provider-onmetal/pkg/onmetal/helper" + apiv1alpha1 "github.com/ironcore-dev/gardener-extension-provider-ironcore/pkg/apis/ironcore/v1alpha1" + "github.com/ironcore-dev/gardener-extension-provider-ironcore/pkg/ironcore/helper" ) // UpdateMachineImagesStatus updates the machine image status diff --git a/pkg/controller/worker/machine_images_test.go b/pkg/controller/worker/machine_images_test.go index 051a800d..13b70c5a 100644 --- a/pkg/controller/worker/machine_images_test.go +++ b/pkg/controller/worker/machine_images_test.go @@ -1,4 +1,4 @@ -// Copyright 2022 OnMetal authors +// Copyright 2022 IronCore authors // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. @@ -15,7 +15,7 @@ package worker import ( - commonv1alpha1 "github.com/onmetal/onmetal-api/api/common/v1alpha1" + commonv1alpha1 "github.com/ironcore-dev/ironcore/api/common/v1alpha1" . "github.com/onsi/ginkgo/v2" . "github.com/onsi/gomega" metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" @@ -25,7 +25,7 @@ import ( "k8s.io/utils/pointer" "sigs.k8s.io/controller-runtime/pkg/client" - apiv1alpha1 "github.com/onmetal/gardener-extension-provider-onmetal/pkg/apis/onmetal/v1alpha1" + apiv1alpha1 "github.com/ironcore-dev/gardener-extension-provider-ironcore/pkg/apis/ironcore/v1alpha1" ) var _ = Describe("MachinesImages", func() { diff --git a/pkg/controller/worker/machines.go b/pkg/controller/worker/machines.go index 2c96a616..f507662f 100644 --- a/pkg/controller/worker/machines.go +++ b/pkg/controller/worker/machines.go @@ -1,4 +1,4 @@ -// Copyright 2022 OnMetal authors +// Copyright 2022 IronCore authors // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. @@ -31,11 +31,11 @@ import ( "sigs.k8s.io/controller-runtime/pkg/client" "sigs.k8s.io/controller-runtime/pkg/controller/controllerutil" - onmetalextensionv1alpha1 "github.com/onmetal/gardener-extension-provider-onmetal/pkg/apis/onmetal/v1alpha1" - "github.com/onmetal/gardener-extension-provider-onmetal/pkg/onmetal" + ironcoreextensionv1alpha1 "github.com/ironcore-dev/gardener-extension-provider-ironcore/pkg/apis/ironcore/v1alpha1" + "github.com/ironcore-dev/gardener-extension-provider-ironcore/pkg/ironcore" ) -// MachineClassKind yields the name of the machine class kind used by onmetal provider. +// MachineClassKind yields the name of the machine class kind used by ironcore provider. func (w *workerDelegate) MachineClassKind() string { return "MachineClass" } @@ -50,7 +50,7 @@ func (w *workerDelegate) MachineClassList() client.ObjectList { return &machinecontrollerv1alpha1.MachineClassList{} } -// DeployMachineClasses generates and creates the onmetal specific machine classes. +// DeployMachineClasses generates and creates the ironcore specific machine classes. func (w *workerDelegate) DeployMachineClasses(ctx context.Context) error { machineClasses, machineClassSecrets, err := w.generateMachineClassAndSecrets() if err != nil { @@ -116,7 +116,7 @@ func (w *workerDelegate) generateMachineClassAndSecrets() ([]*machinecontrollerv machineClassSecrets []*corev1.Secret ) - infrastructureStatus := &onmetalextensionv1alpha1.InfrastructureStatus{} + infrastructureStatus := &ironcoreextensionv1alpha1.InfrastructureStatus{} if _, _, err := w.decoder.Decode(w.worker.Spec.InfrastructureProviderStatus.Raw, nil, infrastructureStatus); err != nil { return nil, nil, fmt.Errorf("failed to decode infra status: %w", err) } @@ -134,13 +134,13 @@ func (w *workerDelegate) generateMachineClassAndSecrets() ([]*machinecontrollerv } machineClassProviderSpec := map[string]interface{}{ - onmetal.ImageFieldName: machineImage, + ironcore.ImageFieldName: machineImage, } if pool.Volume != nil { - machineClassProviderSpec[onmetal.RootDiskFieldName] = map[string]interface{}{ - onmetal.SizeFieldName: pool.Volume.Size, - onmetal.VolumeClassFieldName: pool.Volume.Type, + machineClassProviderSpec[ironcore.RootDiskFieldName] = map[string]interface{}{ + ironcore.SizeFieldName: pool.Volume.Size, + ironcore.VolumeClassFieldName: pool.Volume.Type, } } @@ -164,10 +164,10 @@ func (w *workerDelegate) generateMachineClassAndSecrets() ([]*machinecontrollerv } } - machineClassProviderSpec[onmetal.NetworkFieldName] = infrastructureStatus.NetworkRef.Name - machineClassProviderSpec[onmetal.PrefixFieldName] = infrastructureStatus.PrefixRef.Name - machineClassProviderSpec[onmetal.LabelsFieldName] = map[string]string{ - onmetal.ClusterNameLabel: w.cluster.ObjectMeta.Name, + machineClassProviderSpec[ironcore.NetworkFieldName] = infrastructureStatus.NetworkRef.Name + machineClassProviderSpec[ironcore.PrefixFieldName] = infrastructureStatus.PrefixRef.Name + machineClassProviderSpec[ironcore.LabelsFieldName] = map[string]string{ + ironcore.ClusterNameLabel: w.cluster.ObjectMeta.Name, } machineClassProviderSpecJSON, err := json.Marshal(machineClassProviderSpec) @@ -191,7 +191,7 @@ func (w *workerDelegate) generateMachineClassAndSecrets() ([]*machinecontrollerv ProviderSpec: runtime.RawExtension{ Raw: machineClassProviderSpecJSON, }, - Provider: onmetal.Type, + Provider: ironcore.Type, SecretRef: &corev1.SecretReference{ Name: className, Namespace: w.worker.Namespace, @@ -207,7 +207,7 @@ func (w *workerDelegate) generateMachineClassAndSecrets() ([]*machinecontrollerv }, }, Data: map[string][]byte{ - onmetal.UserDataFieldName: pool.UserData, + ironcore.UserDataFieldName: pool.UserData, }, } diff --git a/pkg/controller/worker/machines_test.go b/pkg/controller/worker/machines_test.go index 52c57fa2..4a3dcb68 100644 --- a/pkg/controller/worker/machines_test.go +++ b/pkg/controller/worker/machines_test.go @@ -1,4 +1,4 @@ -// Copyright 2022 OnMetal authors +// Copyright 2022 IronCore authors // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. @@ -22,9 +22,9 @@ import ( genericworkeractuator "github.com/gardener/gardener/extensions/pkg/controller/worker/genericactuator" v1beta1constants "github.com/gardener/gardener/pkg/apis/core/v1beta1/constants" machinecontrollerv1alpha1 "github.com/gardener/machine-controller-manager/pkg/apis/machine/v1alpha1" - onmetalextensionv1alpha1 "github.com/onmetal/gardener-extension-provider-onmetal/pkg/apis/onmetal/v1alpha1" - "github.com/onmetal/gardener-extension-provider-onmetal/pkg/onmetal" - commonv1alpha1 "github.com/onmetal/onmetal-api/api/common/v1alpha1" + ironcoreextensionv1alpha1 "github.com/ironcore-dev/gardener-extension-provider-ironcore/pkg/apis/ironcore/v1alpha1" + "github.com/ironcore-dev/gardener-extension-provider-ironcore/pkg/ironcore" + commonv1alpha1 "github.com/ironcore-dev/ironcore/api/common/v1alpha1" . "github.com/onsi/ginkgo/v2" . "github.com/onsi/gomega" corev1 "k8s.io/api/core/v1" @@ -58,9 +58,9 @@ var _ = Describe("Machines", func() { It("should create the expected machine class for a multi zone cluster", func(ctx SpecContext) { By("defining and setting infrastructure status for worker") - infraStatus := &onmetalextensionv1alpha1.InfrastructureStatus{ + infraStatus := &ironcoreextensionv1alpha1.InfrastructureStatus{ TypeMeta: metav1.TypeMeta{ - APIVersion: onmetalextensionv1alpha1.SchemeGroupVersion.String(), + APIVersion: ironcoreextensionv1alpha1.SchemeGroupVersion.String(), Kind: "InfrastructureStatus", }, NetworkRef: commonv1alpha1.LocalUIDReference{ @@ -107,7 +107,7 @@ var _ = Describe("Machines", func() { "networkName": infraStatus.NetworkRef.Name, "prefixName": infraStatus.PrefixRef.Name, "labels": map[string]interface{}{ - onmetal.ClusterNameLabel: cluster.ObjectMeta.Name, + ironcore.ClusterNameLabel: cluster.ObjectMeta.Name, }, } @@ -121,7 +121,7 @@ var _ = Describe("Machines", func() { Namespace: ns.Name, Name: className, }), - HaveField("Provider", "onmetal"), + HaveField("Provider", "ironcore"), HaveField("NodeTemplate", &machinecontrollerv1alpha1.NodeTemplate{ Capacity: pool.NodeTemplate.Capacity, InstanceType: pool.MachineType, diff --git a/pkg/controller/worker/suite_test.go b/pkg/controller/worker/suite_test.go index 975f377f..b7feabf6 100644 --- a/pkg/controller/worker/suite_test.go +++ b/pkg/controller/worker/suite_test.go @@ -1,4 +1,4 @@ -// Copyright 2022 OnMetal authors +// Copyright 2022 IronCore authors // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. @@ -25,9 +25,9 @@ import ( gardenerextensionv1alpha1 "github.com/gardener/gardener/pkg/apis/extensions/v1alpha1" gardener "github.com/gardener/gardener/pkg/client/kubernetes" machinescheme "github.com/gardener/machine-controller-manager/pkg/client/clientset/versioned/scheme" - "github.com/onmetal/controller-utils/modutils" - networkingv1alpha1 "github.com/onmetal/onmetal-api/api/networking/v1alpha1" - envtestutils "github.com/onmetal/onmetal-api/utils/envtest" + "github.com/ironcore-dev/controller-utils/modutils" + networkingv1alpha1 "github.com/ironcore-dev/ironcore/api/networking/v1alpha1" + envtestutils "github.com/ironcore-dev/ironcore/utils/envtest" . "github.com/onsi/ginkgo/v2" . "github.com/onsi/gomega" "go.uber.org/zap/zapcore" @@ -46,7 +46,7 @@ import ( logf "sigs.k8s.io/controller-runtime/pkg/log" "sigs.k8s.io/controller-runtime/pkg/log/zap" - apiv1alpha1 "github.com/onmetal/gardener-extension-provider-onmetal/pkg/apis/onmetal/v1alpha1" + apiv1alpha1 "github.com/ironcore-dev/gardener-extension-provider-ironcore/pkg/apis/ironcore/v1alpha1" ) const ( @@ -107,7 +107,7 @@ var _ = BeforeSuite(func() { } testEnvExt = &envtestutils.EnvironmentExtensions{ APIServiceDirectoryPaths: []string{ - modutils.Dir("github.com/onmetal/onmetal-api", "config", "apiserver", "apiservice", "bases"), + modutils.Dir("github.com/ironcore-dev/ironcore", "config", "apiserver", "apiservice", "bases"), }, ErrorIfAPIServicePathIsMissing: true, } @@ -214,7 +214,7 @@ func SetupTest() (*corev1.Namespace, *gardener.ChartApplier) { cluster = &extensionscontroller.Cluster{ CloudProfile: &gardencorev1beta1.CloudProfile{ ObjectMeta: metav1.ObjectMeta{ - Name: "onmetal", + Name: "ironcore", }, Spec: gardencorev1beta1.CloudProfileSpec{ ProviderConfig: &runtime.RawExtension{ diff --git a/pkg/internal/imagevector/imagevector.go b/pkg/internal/imagevector/imagevector.go index 3ff7a28c..864d7ed0 100644 --- a/pkg/internal/imagevector/imagevector.go +++ b/pkg/internal/imagevector/imagevector.go @@ -1,4 +1,4 @@ -// Copyright 2022 OnMetal authors +// Copyright 2022 IronCore authors // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. @@ -18,7 +18,7 @@ import ( "github.com/gardener/gardener/pkg/utils/imagevector" "k8s.io/apimachinery/pkg/util/runtime" - "github.com/onmetal/gardener-extension-provider-onmetal/charts" + "github.com/ironcore-dev/gardener-extension-provider-ironcore/charts" ) var imageVector imagevector.ImageVector diff --git a/pkg/internal/types.go b/pkg/internal/types.go index 29e00385..7234a032 100644 --- a/pkg/internal/types.go +++ b/pkg/internal/types.go @@ -1,4 +1,4 @@ -// Copyright 2022 OnMetal authors +// Copyright 2022 IronCore authors // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. diff --git a/pkg/onmetal/clientutils.go b/pkg/ironcore/clientutils.go similarity index 66% rename from pkg/onmetal/clientutils.go rename to pkg/ironcore/clientutils.go index 5ad5ff35..4d542067 100644 --- a/pkg/onmetal/clientutils.go +++ b/pkg/ironcore/clientutils.go @@ -1,4 +1,4 @@ -// Copyright 2023 OnMetal authors +// Copyright 2023 IronCore authors // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. @@ -12,7 +12,7 @@ // See the License for the specific language governing permissions and // limitations under the License. -package onmetal +package ironcore import ( "context" @@ -27,26 +27,26 @@ import ( "k8s.io/client-go/tools/clientcmd" "sigs.k8s.io/controller-runtime/pkg/client" - computev1alpha1 "github.com/onmetal/onmetal-api/api/compute/v1alpha1" - ipamv1alpha1 "github.com/onmetal/onmetal-api/api/ipam/v1alpha1" - networkingv1alpha1 "github.com/onmetal/onmetal-api/api/networking/v1alpha1" - storagev1alpha1 "github.com/onmetal/onmetal-api/api/storage/v1alpha1" + computev1alpha1 "github.com/ironcore-dev/ironcore/api/compute/v1alpha1" + ipamv1alpha1 "github.com/ironcore-dev/ironcore/api/ipam/v1alpha1" + networkingv1alpha1 "github.com/ironcore-dev/ironcore/api/networking/v1alpha1" + storagev1alpha1 "github.com/ironcore-dev/ironcore/api/storage/v1alpha1" ) -var onmetalScheme = runtime.NewScheme() +var ironcoreScheme = runtime.NewScheme() func init() { - utilruntime.Must(corev1.AddToScheme(onmetalScheme)) - utilruntime.Must(networkingv1alpha1.AddToScheme(onmetalScheme)) - utilruntime.Must(computev1alpha1.AddToScheme(onmetalScheme)) - utilruntime.Must(storagev1alpha1.AddToScheme(onmetalScheme)) - utilruntime.Must(ipamv1alpha1.AddToScheme(onmetalScheme)) - utilruntime.Must(extensionsv1alpha1.AddToScheme(onmetalScheme)) + utilruntime.Must(corev1.AddToScheme(ironcoreScheme)) + utilruntime.Must(networkingv1alpha1.AddToScheme(ironcoreScheme)) + utilruntime.Must(computev1alpha1.AddToScheme(ironcoreScheme)) + utilruntime.Must(storagev1alpha1.AddToScheme(ironcoreScheme)) + utilruntime.Must(ipamv1alpha1.AddToScheme(ironcoreScheme)) + utilruntime.Must(extensionsv1alpha1.AddToScheme(ironcoreScheme)) } -// GetOnmetalClientAndNamespaceFromCloudProviderSecret extracts the