Skip to content
This repository has been archived by the owner on Apr 7, 2020. It is now read-only.

Commit

Permalink
Merge pull request #603 from georgekuruvillak/webhook_change
Browse files Browse the repository at this point in the history
Changed implementation to handle etcd resource instead of statefulset.
  • Loading branch information
rfranzke authored Feb 26, 2020
2 parents f5f5268 + 319b89d commit 1b80dce
Show file tree
Hide file tree
Showing 392 changed files with 47,238 additions and 3,794 deletions.
16 changes: 8 additions & 8 deletions go.mod
Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,9 @@ module github.com/gardener/gardener-extensions
go 1.13

require (
github.com/Masterminds/semver v1.4.2
github.com/Masterminds/semver v1.5.0
github.com/coreos/go-systemd v0.0.0-20190719114852-fd7a80b32e1f
github.com/gardener/etcd-druid v0.1.1-0.20200206100633-e7606e1225d7
github.com/gardener/gardener v1.0.1-0.20200213093126-7a6123b6ae21
github.com/gardener/gardener-resource-manager v0.10.0
github.com/gardener/machine-controller-manager v0.25.1-0.20200115123605-0510de7ddfca // master
Expand All @@ -13,27 +14,26 @@ require (
github.com/gobuffalo/packr/v2 v2.1.0
github.com/golang/mock v1.3.1
github.com/huandu/xstrings v1.3.0
github.com/json-iterator/go v1.1.9 // indirect
github.com/onsi/ginkgo v1.10.1
github.com/onsi/gomega v1.7.0
github.com/pkg/errors v0.8.1
github.com/sirupsen/logrus v1.4.2
github.com/spf13/cobra v0.0.5
github.com/spf13/pflag v1.0.5
go.uber.org/zap v1.10.0
go.uber.org/zap v1.13.0
gomodules.xyz/jsonpatch/v2 v2.0.1
k8s.io/api v0.0.0-20191010143144-fbf594f18f80
k8s.io/apiextensions-apiserver v0.0.0-20190918161926-8f644eb6e783
k8s.io/apimachinery v0.0.0-20191016060620-86f2f1b9c076
k8s.io/api v0.17.0
k8s.io/apiextensions-apiserver v0.17.0
k8s.io/apimachinery v0.17.0
k8s.io/autoscaler v0.0.0-20190805135949-100e91ba756e
k8s.io/client-go v11.0.1-0.20190409021438-1a26190bd76a+incompatible
k8s.io/component-base v0.0.0-20190918160511-547f6c5d7090
k8s.io/gengo v0.0.0-20190826232639-a874a240740c
k8s.io/helm v2.14.2+incompatible
k8s.io/helm v2.16.1+incompatible
k8s.io/klog v1.0.0
k8s.io/kube-aggregator v0.0.0-20191004104030-d9d5f0cc7532
k8s.io/kubelet v0.0.0-20190918162654-250a1838aa2c
k8s.io/utils v0.0.0-20190801114015-581e00157fb1
k8s.io/utils v0.0.0-20191218082557-f07c713de883
sigs.k8s.io/controller-runtime v0.4.0
sigs.k8s.io/yaml v1.1.0
)
Expand Down
120 changes: 120 additions & 0 deletions go.sum

Large diffs are not rendered by default.

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

197 changes: 0 additions & 197 deletions pkg/webhook/controlplane/etcd.go

This file was deleted.

9 changes: 5 additions & 4 deletions pkg/webhook/controlplane/genericmutator/mutator.go
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,7 @@ import (
"github.com/gardener/gardener-extensions/pkg/webhook/controlplane"

"github.com/coreos/go-systemd/unit"
druidv1alpha1 "github.com/gardener/etcd-druid/api/v1alpha1"
v1beta1constants "github.com/gardener/gardener/pkg/apis/core/v1beta1/constants"
extensionsv1alpha1 "github.com/gardener/gardener/pkg/apis/extensions/v1alpha1"
"github.com/go-logr/logr"
Expand Down Expand Up @@ -54,8 +55,8 @@ type Ensurer interface {
EnsureKubeControllerManagerDeployment(context.Context, EnsurerContext, *appsv1.Deployment) error
// EnsureKubeSchedulerDeployment ensures that the kube-scheduler deployment conforms to the provider requirements.
EnsureKubeSchedulerDeployment(context.Context, EnsurerContext, *appsv1.Deployment) error
// EnsureETCDStatefulSet ensures that the etcd stateful sets conform to the provider requirements.
EnsureETCDStatefulSet(context.Context, EnsurerContext, *appsv1.StatefulSet) error
// EnsureETCD ensures that the etcds conform to the respective provider requirements.
EnsureETCD(context.Context, EnsurerContext, *druidv1alpha1.Etcd) error
// EnsureKubeletServiceUnitOptions ensures that the kubelet.service unit options conform to the provider requirements.
EnsureKubeletServiceUnitOptions(context.Context, EnsurerContext, []*unit.UnitOption) ([]*unit.UnitOption, error)
// EnsureKubeletConfiguration ensures that the kubelet configuration conforms to the provider requirements.
Expand Down Expand Up @@ -176,11 +177,11 @@ func (m *mutator) Mutate(ctx context.Context, obj runtime.Object) error {
extensionswebhook.LogMutation(m.logger, x.Kind, x.Namespace, x.Name)
return m.ensurer.EnsureKubeSchedulerDeployment(ctx, ectx, x)
}
case *appsv1.StatefulSet:
case *druidv1alpha1.Etcd:
switch x.Name {
case v1beta1constants.ETCDMain, v1beta1constants.ETCDEvents:
extensionswebhook.LogMutation(m.logger, x.Kind, x.Namespace, x.Name)
return m.ensurer.EnsureETCDStatefulSet(ctx, ectx, x)
return m.ensurer.EnsureETCD(ctx, ectx, x)
}
case *extensionsv1alpha1.OperatingSystemConfig:
if x.Spec.Purpose == extensionsv1alpha1.OperatingSystemConfigPurposeReconcile {
Expand Down
Loading

0 comments on commit 1b80dce

Please sign in to comment.