diff --git a/charts/images.yaml b/charts/images.yaml index d6aef1ba7..f0981ea69 100644 --- a/charts/images.yaml +++ b/charts/images.yaml @@ -2,7 +2,7 @@ images: - name: terraformer sourceRepository: github.com/gardener/terraformer repository: eu.gcr.io/gardener-project/gardener/terraformer - tag: "0.20.0" + tag: "v1.0.0" - name: cloud-controller-manager sourceRepository: github.com/kubernetes/kubernetes repository: k8s.gcr.io/hyperkube diff --git a/go.mod b/go.mod index f9f8d3735..56c5e60c7 100644 --- a/go.mod +++ b/go.mod @@ -8,7 +8,7 @@ require ( github.com/coreos/go-systemd v0.0.0-20190719114852-fd7a80b32e1f github.com/gardener/etcd-druid v0.1.3 github.com/gardener/gardener v1.1.1-0.20200330051317-a326f96cf32b - github.com/gardener/gardener-extensions v1.5.1-0.20200330101454-c65957bd80b5 + github.com/gardener/gardener-extensions v1.5.1-0.20200402091828-df061f8dae06 github.com/gardener/machine-controller-manager v0.26.2 github.com/go-logr/logr v0.1.0 github.com/gobuffalo/packr/v2 v2.1.0 diff --git a/go.sum b/go.sum index 9820b07b8..f3005c08b 100644 --- a/go.sum +++ b/go.sum @@ -122,8 +122,8 @@ github.com/gardener/external-dns-management v0.7.3 h1:SAW9ur2mjZ+x89xbmcplJgqNUm github.com/gardener/external-dns-management v0.7.3/go.mod h1:Y3om11E865x4aQ7cmcHjknb8RMgCO153huRb/SvP+9o= github.com/gardener/gardener v1.1.1-0.20200330051317-a326f96cf32b h1:MkEDp9PdrZPkIAPGj6oNcKl0fBaOcJ1ddKsAA7bVWnI= github.com/gardener/gardener v1.1.1-0.20200330051317-a326f96cf32b/go.mod h1:lGAx5NkFDWoC4hPIL+lHJamafBxmOt5MrHq9hGtp5VI= -github.com/gardener/gardener-extensions v1.5.1-0.20200330101454-c65957bd80b5 h1:zDXG4369jfXvZlPNQe4YX38VA0h5SDq2xk8dqLg73e4= -github.com/gardener/gardener-extensions v1.5.1-0.20200330101454-c65957bd80b5/go.mod h1:+0MkNqbRaTvPMfEe/MoS31L5FM8W32WYvhpH4Y53Y5s= +github.com/gardener/gardener-extensions v1.5.1-0.20200402091828-df061f8dae06 h1:ZMAxjMWvydRD1ndHAFfa/ItQp4JEy9OPsVmNc1gc0og= +github.com/gardener/gardener-extensions v1.5.1-0.20200402091828-df061f8dae06/go.mod h1:+0MkNqbRaTvPMfEe/MoS31L5FM8W32WYvhpH4Y53Y5s= github.com/gardener/gardener-resource-manager v0.10.0 h1:6OUKoWI3oha42F0oJN8OEo3UR+D3onOCel4Th+zgotU= github.com/gardener/gardener-resource-manager v0.10.0/go.mod h1:0pKTHOhvU91eQB0EYr/6Ymd7lXc/5Hi8P8tF/gpV0VQ= github.com/gardener/hvpa-controller v0.0.0-20191014062307-fad3bdf06a25 h1:nOFITmV7vt4fcYPEXgj66Qs83FdDEMvL/LQcR0diRRE= diff --git a/vendor/github.com/gardener/gardener-extensions/pkg/controller/backupbucket/reconciler.go b/vendor/github.com/gardener/gardener-extensions/pkg/controller/backupbucket/reconciler.go index 682bd6578..dc94ca1cf 100644 --- a/vendor/github.com/gardener/gardener-extensions/pkg/controller/backupbucket/reconciler.go +++ b/vendor/github.com/gardener/gardener-extensions/pkg/controller/backupbucket/reconciler.go @@ -95,7 +95,7 @@ func (r *reconciler) Reconcile(request reconcile.Request) (reconcile.Result, err func (r *reconciler) reconcile(ctx context.Context, bb *extensionsv1alpha1.BackupBucket) (reconcile.Result, error) { if err := extensionscontroller.EnsureFinalizer(ctx, r.client, FinalizerName, bb); err != nil { - r.logger.Info("failed to ensure finalizer on backup bucket, %v", err) + r.logger.Error(err, "failed to ensure finalizer on backup bucket", "backupbucket", bb.Name) return reconcile.Result{}, err } @@ -106,11 +106,11 @@ func (r *reconciler) reconcile(ctx context.Context, bb *extensionsv1alpha1.Backu secret, err := extensionscontroller.GetSecretByReference(ctx, r.client, &bb.Spec.SecretRef) if err != nil { - r.logger.Info("failed to get backup bucket secret, %v", err) + r.logger.Error(err, "failed to get backup bucket secret", "backupbucket", bb.Name) return reconcile.Result{}, err } if err := extensionscontroller.EnsureFinalizer(ctx, r.client, FinalizerName, secret); err != nil { - r.logger.Info("failed to ensure finalizer on bucket secret, %v", err) + r.logger.Error(err, "failed to ensure finalizer on bucket secret", "backupbucket", bb.Name) return reconcile.Result{}, err } @@ -168,11 +168,11 @@ func (r *reconciler) delete(ctx context.Context, bb *extensionsv1alpha1.BackupBu secret, err := extensionscontroller.GetSecretByReference(ctx, r.client, &bb.Spec.SecretRef) if err != nil { - r.logger.Info("failed to get backup bucket secret, %v", err) + r.logger.Error(err, "failed to get backup bucket secret", "backupbucket", bb.Name) return reconcile.Result{}, err } if err := extensionscontroller.DeleteFinalizer(ctx, r.client, FinalizerName, secret); err != nil { - r.logger.Info("failed to remove finalizer on bucket secret, %v", err) + r.logger.Error(err, "failed to remove finalizer on bucket secret", "backupbucket", bb.Name) return reconcile.Result{}, err } diff --git a/vendor/github.com/gardener/gardener-extensions/pkg/controller/backupentry/reconciler.go b/vendor/github.com/gardener/gardener-extensions/pkg/controller/backupentry/reconciler.go index b62a7d557..5e0348a89 100644 --- a/vendor/github.com/gardener/gardener-extensions/pkg/controller/backupentry/reconciler.go +++ b/vendor/github.com/gardener/gardener-extensions/pkg/controller/backupentry/reconciler.go @@ -105,11 +105,11 @@ func (r *reconciler) reconcile(ctx context.Context, be *extensionsv1alpha1.Backu secret, err := extensionscontroller.GetSecretByReference(ctx, r.client, &be.Spec.SecretRef) if err != nil { - r.logger.Info("failed to get backup entry secret, %v", err) + r.logger.Error(err, "failed to get backup entry secret", "backupentry", be.Name) return reconcile.Result{}, err } if err := extensionscontroller.EnsureFinalizer(ctx, r.client, FinalizerName, secret); err != nil { - r.logger.Info("failed to ensure finalizer on backup entry secret, %v", err) + r.logger.Error(err, "failed to ensure finalizer on backup entry secret", "backupentry", be.Name) return reconcile.Result{}, err } @@ -167,11 +167,11 @@ func (r *reconciler) delete(ctx context.Context, be *extensionsv1alpha1.BackupEn secret, err := extensionscontroller.GetSecretByReference(ctx, r.client, &be.Spec.SecretRef) if err != nil { - r.logger.Info("failed to get backup entry secret, %v", err) + r.logger.Error(err, "failed to get backup entry secret", "backupentry", be.Name) return reconcile.Result{}, err } if err := extensionscontroller.DeleteFinalizer(ctx, r.client, FinalizerName, secret); err != nil { - r.logger.Info("failed to remove finalizer on backup entry secret, %v", err) + r.logger.Error(err, "failed to remove finalizer on backup entry secret", "backupentry", be.Name) return reconcile.Result{}, err } diff --git a/vendor/github.com/gardener/gardener-extensions/pkg/controller/cluster.go b/vendor/github.com/gardener/gardener-extensions/pkg/controller/cluster.go index 63f45b3d2..b675f0b91 100644 --- a/vendor/github.com/gardener/gardener-extensions/pkg/controller/cluster.go +++ b/vendor/github.com/gardener/gardener-extensions/pkg/controller/cluster.go @@ -23,6 +23,7 @@ import ( "github.com/gardener/gardener/pkg/apis/core" kutil "github.com/gardener/gardener/pkg/utils/kubernetes" + metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" "k8s.io/apimachinery/pkg/runtime" "k8s.io/apimachinery/pkg/runtime/serializer" "sigs.k8s.io/controller-runtime/pkg/client" @@ -37,6 +38,7 @@ func init() { // Cluster contains the decoded resources of Gardener's extension Cluster resource. type Cluster struct { + ObjectMeta metav1.ObjectMeta CloudProfile *gardencorev1beta1.CloudProfile Seed *gardencorev1beta1.Seed Shoot *gardencorev1beta1.Shoot @@ -67,7 +69,7 @@ func GetCluster(ctx context.Context, c client.Client, namespace string) (*Cluste return nil, err } - return &Cluster{cloudProfile, seed, shoot}, nil + return &Cluster{cluster.ObjectMeta, cloudProfile, seed, shoot}, nil } // CloudProfileFromCluster returns the CloudProfile resource inside the Cluster resource. diff --git a/vendor/github.com/gardener/gardener-extensions/pkg/controller/healthcheck/healtcheck_actuator.go b/vendor/github.com/gardener/gardener-extensions/pkg/controller/healthcheck/healtcheck_actuator.go index dc8dc5cd0..08635814f 100644 --- a/vendor/github.com/gardener/gardener-extensions/pkg/controller/healthcheck/healtcheck_actuator.go +++ b/vendor/github.com/gardener/gardener-extensions/pkg/controller/healthcheck/healtcheck_actuator.go @@ -147,7 +147,7 @@ func (a *Actuator) ExecuteHealthCheckFunctions(ctx context.Context, request type } if !preCheckFunc(obj, cluster) { - a.logger.Info("Skipping health check for condition type %q as pre check function returned false", healthConditionType) + a.logger.Info("Skipping health check as pre check function returned false", "conditionType", healthConditionType) channel <- channelResult{ healthCheckResult: &SingleCheckResult{ IsHealthy: true, diff --git a/vendor/github.com/gardener/gardener-extensions/pkg/terraformer/terraformer.go b/vendor/github.com/gardener/gardener-extensions/pkg/terraformer/terraformer.go index 53d7f8920..16ec2985f 100644 --- a/vendor/github.com/gardener/gardener-extensions/pkg/terraformer/terraformer.go +++ b/vendor/github.com/gardener/gardener-extensions/pkg/terraformer/terraformer.go @@ -251,6 +251,11 @@ func (t *terraformer) createOrUpdateRole(ctx context.Context) error { Resources: []string{"configmaps"}, Verbs: []string{"*"}, }, + { + APIGroups: []string{""}, + Resources: []string{"secrets"}, + Verbs: []string{"*"}, + }, } return nil }) @@ -320,7 +325,9 @@ func (t *terraformer) env() []corev1.EnvVar { envVars := []corev1.EnvVar{ {Name: "MAX_BACKOFF_SEC", Value: "60"}, {Name: "MAX_TIME_SEC", Value: "1800"}, + {Name: "TF_CONFIGURATION_CONFIG_MAP_NAME", Value: t.configName}, {Name: "TF_STATE_CONFIG_MAP_NAME", Value: t.stateName}, + {Name: "TF_VARIABLES_SECRET_NAME", Value: t.variablesName}, } for k, v := range t.variablesEnvironment { envVars = append(envVars, corev1.EnvVar{Name: k, Value: v}) @@ -328,19 +335,8 @@ func (t *terraformer) env() []corev1.EnvVar { return envVars } -func (t *terraformer) podSpec(scriptName string) *corev1.PodSpec { - const ( - tfVolume = "tf" - tfVarsVolume = "tfvars" - tfStateVolume = "tfstate" - - tfVolumeMountPath = tfVolume - tfVarsVolumeMountPath = tfVarsVolume - tfStateVolumeMountPath = "tf-state-in" - ) - +func (t *terraformer) podSpec(command string) *corev1.PodSpec { terminationGracePeriodSeconds := t.terminationGracePeriodSeconds - shCommand := fmt.Sprintf("sh /terraform.sh %s 2>&1; [[ -f /success ]] && exit 0 || exit 1", scriptName) return &corev1.PodSpec{ RestartPolicy: corev1.RestartPolicyNever, @@ -350,9 +346,8 @@ func (t *terraformer) podSpec(scriptName string) *corev1.PodSpec { Image: t.image, ImagePullPolicy: corev1.PullIfNotPresent, Command: []string{ - "sh", - "-c", - shCommand, + "/terraformer.sh", + command, }, Resources: corev1.ResourceRequirements{ Requests: corev1.ResourceList{ @@ -365,41 +360,10 @@ func (t *terraformer) podSpec(scriptName string) *corev1.PodSpec { }, }, Env: t.env(), - VolumeMounts: []corev1.VolumeMount{ - {Name: tfVolume, MountPath: fmt.Sprintf("/%s", tfVolumeMountPath)}, - {Name: tfVarsVolume, MountPath: fmt.Sprintf("/%s", tfVarsVolumeMountPath)}, - {Name: tfStateVolume, MountPath: fmt.Sprintf("/%s", tfStateVolumeMountPath)}, - }, }, }, ServiceAccountName: terraformerName, TerminationGracePeriodSeconds: &terminationGracePeriodSeconds, - Volumes: []corev1.Volume{ - { - Name: tfVolume, - VolumeSource: corev1.VolumeSource{ - ConfigMap: &corev1.ConfigMapVolumeSource{ - LocalObjectReference: corev1.LocalObjectReference{Name: t.configName}, - }, - }, - }, - { - Name: tfVarsVolume, - VolumeSource: corev1.VolumeSource{ - Secret: &corev1.SecretVolumeSource{ - SecretName: t.variablesName, - }, - }, - }, - { - Name: tfStateVolume, - VolumeSource: corev1.VolumeSource{ - ConfigMap: &corev1.ConfigMapVolumeSource{ - LocalObjectReference: corev1.LocalObjectReference{Name: t.stateName}, - }, - }, - }, - }, } } diff --git a/vendor/modules.txt b/vendor/modules.txt index cd0b503fb..9826facb5 100644 --- a/vendor/modules.txt +++ b/vendor/modules.txt @@ -166,7 +166,7 @@ github.com/gardener/gardener/test/framework/config github.com/gardener/gardener/test/framework/reporter github.com/gardener/gardener/test/integration/framework github.com/gardener/gardener/test/integration/shoots -# github.com/gardener/gardener-extensions v1.5.1-0.20200330101454-c65957bd80b5 +# github.com/gardener/gardener-extensions v1.5.1-0.20200402091828-df061f8dae06 github.com/gardener/gardener-extensions/hack github.com/gardener/gardener-extensions/hack/.ci github.com/gardener/gardener-extensions/hack/api-reference/template