Skip to content

Commit

Permalink
Debug graceful shutdown
Browse files Browse the repository at this point in the history
  • Loading branch information
alvaroaleman committed Jun 21, 2020
1 parent 52baca0 commit b8ba348
Show file tree
Hide file tree
Showing 7 changed files with 243 additions and 173 deletions.
2 changes: 1 addition & 1 deletion go.mod
Original file line number Diff line number Diff line change
Expand Up @@ -40,4 +40,4 @@ replace sigs.k8s.io/cluster-api-provider-azure => github.com/openshift/cluster-a

replace sigs.k8s.io/cluster-api-provider-gcp => github.com/openshift/cluster-api-provider-gcp v0.0.1-0.20200528175251-4f2fdeb49fe1

replace sigs.k8s.io/controller-runtime => github.com/mgugino-upstream-stage/controller-runtime v0.6.1-0.20200618201807-9d82bf2a7266
replace sigs.k8s.io/controller-runtime => github.com/alvaroaleman/controller-runtime v0.1.5-0.20200619152754-4a802fb9b747
2 changes: 2 additions & 0 deletions go.sum
Original file line number Diff line number Diff line change
Expand Up @@ -36,6 +36,8 @@ github.com/alecthomas/template v0.0.0-20160405071501-a0175ee3bccc/go.mod h1:LOuy
github.com/alecthomas/template v0.0.0-20190718012654-fb15b899a751/go.mod h1:LOuyumcjzFXgccqObfd/Ljyb9UuFJ6TxHnclSeseNhc=
github.com/alecthomas/units v0.0.0-20151022065526-2efee857e7cf/go.mod h1:ybxpYRFXyAe+OPACYpWeL0wqObRcbAqCMya13uyzqw0=
github.com/alecthomas/units v0.0.0-20190717042225-c3de453c63f4/go.mod h1:ybxpYRFXyAe+OPACYpWeL0wqObRcbAqCMya13uyzqw0=
github.com/alvaroaleman/controller-runtime v0.1.5-0.20200619152754-4a802fb9b747 h1:l5sFFGjYd9YsVYN8u1JRsa4pSURnxBEpM80B1W2y46E=
github.com/alvaroaleman/controller-runtime v0.1.5-0.20200619152754-4a802fb9b747/go.mod h1:qN/IYzFHXI7mP9qhUiGRN9uDH3fdAAqBTCqP1YkMEtQ=
github.com/andreyvit/diff v0.0.0-20170406064948-c7f18ee00883/go.mod h1:rCTlJbsFo29Kk6CurOXKm700vrz8f0KW0JNfpkRJY/8=
github.com/armon/consul-api v0.0.0-20180202201655-eb2c6b5be1b6/go.mod h1:grANhF5doyWs3UAsr3K4I6qtAmlQcZDesFNEHPZAzj8=
github.com/asaskevich/govalidator v0.0.0-20180720115003-f9ffefc3facf/go.mod h1:lB+ZfQJz7igIIfQNfa7Ml4HSf2uFQQRzpGGRXenZAgY=
Expand Down
17 changes: 11 additions & 6 deletions pkg/apis/machine/v1beta1/machine_webhook_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@ import (
"encoding/json"
"fmt"
"testing"
"time"

. "github.com/onsi/gomega"
osconfigv1 "github.com/openshift/api/config/v1"
Expand Down Expand Up @@ -145,10 +146,12 @@ func TestMachineCreation(t *testing.T) {
t.Run(tc.name, func(t *testing.T) {
gs := NewWithT(t)

gracefulShutdownTimeout := 500 * time.Millisecond
mgr, err := manager.New(cfg, manager.Options{
MetricsBindAddress: "0",
Port: testEnv.WebhookInstallOptions.LocalServingPort,
CertDir: testEnv.WebhookInstallOptions.LocalServingCertDir,
GracefulShutdownTimeout: &gracefulShutdownTimeout,
MetricsBindAddress: "0",
Port: testEnv.WebhookInstallOptions.LocalServingPort,
CertDir: testEnv.WebhookInstallOptions.LocalServingCertDir,
})
gs.Expect(err).ToNot(HaveOccurred())

Expand Down Expand Up @@ -543,10 +546,12 @@ func TestMachineUpdate(t *testing.T) {
t.Run(tc.name, func(t *testing.T) {
gs := NewWithT(t)

gracefulShutdownTimeout := 500 * time.Millisecond
mgr, err := manager.New(cfg, manager.Options{
MetricsBindAddress: "0",
Port: testEnv.WebhookInstallOptions.LocalServingPort,
CertDir: testEnv.WebhookInstallOptions.LocalServingCertDir,
GracefulShutdownTimeout: &gracefulShutdownTimeout,
MetricsBindAddress: "0",
Port: testEnv.WebhookInstallOptions.LocalServingPort,
CertDir: testEnv.WebhookInstallOptions.LocalServingCertDir,
})
gs.Expect(err).ToNot(HaveOccurred())

Expand Down
2 changes: 1 addition & 1 deletion vendor/modules.txt
Original file line number Diff line number Diff line change
Expand Up @@ -793,7 +793,7 @@ sigs.k8s.io/cluster-api-provider-aws/pkg/apis/awsprovider/v1beta1
sigs.k8s.io/cluster-api-provider-azure/pkg/apis/azureprovider/v1beta1
# sigs.k8s.io/cluster-api-provider-gcp v0.0.0-00010101000000-000000000000 => github.com/openshift/cluster-api-provider-gcp v0.0.1-0.20200528175251-4f2fdeb49fe1
sigs.k8s.io/cluster-api-provider-gcp/pkg/apis/gcpprovider/v1beta1
# sigs.k8s.io/controller-runtime v0.6.0 => github.com/mgugino-upstream-stage/controller-runtime v0.6.1-0.20200618201807-9d82bf2a7266
# sigs.k8s.io/controller-runtime v0.6.0 => github.com/alvaroaleman/controller-runtime v0.1.5-0.20200619152754-4a802fb9b747
sigs.k8s.io/controller-runtime
sigs.k8s.io/controller-runtime/pkg/builder
sigs.k8s.io/controller-runtime/pkg/cache
Expand Down
4 changes: 2 additions & 2 deletions vendor/sigs.k8s.io/controller-runtime/OWNERS_ALIASES

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

Loading

0 comments on commit b8ba348

Please sign in to comment.