Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Only perform health check if DNS is enabled #10

Merged
merged 1 commit into from
Mar 23, 2020
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
The table of contents is too big for display.
Diff view
Diff view
  •  
  •  
  •  
2 changes: 1 addition & 1 deletion example/controller-registration.yaml
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
---
apiVersion: core.gardener.cloud/v1alpha1
apiVersion: core.gardener.cloud/v1beta1
kind: ControllerRegistration
metadata:
name: extension-shoot-cert-service
Expand Down
13 changes: 7 additions & 6 deletions go.mod
Original file line number Diff line number Diff line change
Expand Up @@ -4,8 +4,8 @@ go 1.13

require (
github.com/ahmetb/gen-crd-api-reference-docs v0.1.5
github.com/gardener/gardener v0.35.1-0.20200128130120-5b69a02f511a
github.com/gardener/gardener-extensions v1.3.0
github.com/gardener/gardener v1.1.6
github.com/gardener/gardener-extensions v1.5.0
github.com/go-logr/logr v0.1.0
github.com/gobuffalo/packr/v2 v2.1.0
github.com/golang/mock v1.3.1
Expand All @@ -14,11 +14,11 @@ require (
github.com/pkg/errors v0.8.1
github.com/spf13/cobra v0.0.5
github.com/spf13/pflag v1.0.5
k8s.io/api v0.0.0-20191010143144-fbf594f18f80
k8s.io/apimachinery v0.0.0-20191016060620-86f2f1b9c076
k8s.io/api v0.17.0
k8s.io/apimachinery v0.17.0
k8s.io/client-go v11.0.1-0.20190409021438-1a26190bd76a+incompatible
k8s.io/code-generator v0.0.0-20190912054826-cd179ad6a269
k8s.io/component-base v0.0.0-20190918160511-547f6c5d7090
k8s.io/code-generator v0.17.0
k8s.io/component-base v0.17.0
rfranzke marked this conversation as resolved.
Show resolved Hide resolved
sigs.k8s.io/controller-runtime v0.4.0
)

Expand All @@ -28,5 +28,6 @@ replace (
k8s.io/apiserver => k8s.io/apiserver v0.0.0-20190918160949-bfa5e2e684ad // kubernetes-1.16.0
k8s.io/client-go => k8s.io/client-go v0.0.0-20190918160344-1fbdaa4c8d90 // kubernetes-1.16.0
k8s.io/code-generator => k8s.io/code-generator v0.0.0-20190912054826-cd179ad6a269 // kubernetes-1.16.0
k8s.io/component-base => k8s.io/component-base v0.0.0-20190918160511-547f6c5d7090 // kubernetes-1.16.0
k8s.io/kube-aggregator => k8s.io/kube-aggregator v0.0.0-20190918161219-8c8f079fddc3 // kubernetes-1.16.0
)
192 changes: 186 additions & 6 deletions go.sum

Large diffs are not rendered by default.

22 changes: 18 additions & 4 deletions pkg/controller/healthcheck/add.go
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,7 @@ import (
certv1alpha1 "github.com/gardener/gardener-extension-shoot-cert-service/pkg/apis/service/v1alpha1"
certcontroller "github.com/gardener/gardener-extension-shoot-cert-service/pkg/controller"

extensionscontroller "github.com/gardener/gardener-extensions/pkg/controller"
"github.com/gardener/gardener-extensions/pkg/controller/healthcheck"
healthcheckconfig "github.com/gardener/gardener-extensions/pkg/controller/healthcheck/config"
"github.com/gardener/gardener-extensions/pkg/controller/healthcheck/general"
Expand All @@ -41,17 +42,30 @@ var (
// RegisterHealthChecks registers health checks for each extension resource
// HealthChecks are grouped by extension (e.g worker), extension.type (e.g aws) and Health Check Type (e.g SystemComponentsHealthy)
func RegisterHealthChecks(mgr manager.Manager, opts healthcheck.DefaultAddArgs) error {
preCheckFunc := func(_ runtime.Object, cluster *extensionscontroller.Cluster) bool {
return cluster.Shoot.Spec.DNS != nil && cluster.Shoot.Spec.DNS.Domain != nil
}

return healthcheck.DefaultRegistration(
certcontroller.Type,
extensionsv1alpha1.SchemeGroupVersion.WithKind(extensionsv1alpha1.ExtensionResource),
func() runtime.Object { return &extensionsv1alpha1.Extension{} },
mgr,
opts,
nil,
map[healthcheck.HealthCheck]string{
general.CheckManagedResource(certv1alpha1.CertManagementResourceNameSeed): string(gardencorev1beta1.ShootControlPlaneHealthy),
general.CheckManagedResource(certv1alpha1.CertManagementResourceNameShoot): string(gardencorev1beta1.ShootSystemComponentsHealthy),
})
[]healthcheck.ConditionTypeToHealthCheck{
{
ConditionType: string(gardencorev1beta1.ShootControlPlaneHealthy),
HealthCheck: general.CheckManagedResource(certv1alpha1.CertManagementResourceNameSeed),
PreCheckFunc: preCheckFunc,
},
{
ConditionType: string(gardencorev1beta1.ShootSystemComponentsHealthy),
HealthCheck: general.CheckManagedResource(certv1alpha1.CertManagementResourceNameShoot),
PreCheckFunc: preCheckFunc,
},
},
)
}

// AddToManager adds a controller with the default Options.
Expand Down
2 changes: 2 additions & 0 deletions vendor/github.com/Masterminds/semver/.travis.yml

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

23 changes: 23 additions & 0 deletions vendor/github.com/Masterminds/semver/CHANGELOG.md

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

3 changes: 1 addition & 2 deletions vendor/github.com/Masterminds/semver/LICENSE.txt

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

43 changes: 36 additions & 7 deletions vendor/github.com/Masterminds/semver/README.md

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

43 changes: 20 additions & 23 deletions vendor/github.com/Masterminds/semver/constraints.go

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

2 changes: 1 addition & 1 deletion vendor/github.com/Masterminds/semver/doc.go

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

16 changes: 10 additions & 6 deletions vendor/github.com/Masterminds/semver/version.go

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

10 changes: 10 additions & 0 deletions vendor/github.com/Masterminds/semver/version_fuzz.go

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

8 changes: 8 additions & 0 deletions vendor/github.com/cespare/xxhash/v2/.travis.yml

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

22 changes: 22 additions & 0 deletions vendor/github.com/cespare/xxhash/v2/LICENSE.txt

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

Loading