diff --git a/components/ws-manager/cmd/run.go b/components/ws-manager/cmd/run.go index 5ed317b6c2e97b..919fa85538b0cd 100644 --- a/components/ws-manager/cmd/run.go +++ b/components/ws-manager/cmd/run.go @@ -12,7 +12,7 @@ import ( // to ensure that exec-entrypoint and run can make use of them. _ "k8s.io/client-go/plugin/pkg/client/auth" - "github.com/bombsimon/logrusr" + "github.com/bombsimon/logrusr/v2" grpc_prometheus "github.com/grpc-ecosystem/go-grpc-prometheus" "github.com/spf13/cobra" "google.golang.org/grpc" @@ -48,7 +48,7 @@ var runCmd = &cobra.Command{ common_grpc.SetupLogging() - ctrl.SetLogger(logrusr.NewLogger(log.Log)) + ctrl.SetLogger(logrusr.New(log.Log)) opts := ctrl.Options{ Scheme: scheme, diff --git a/components/ws-manager/pkg/manager/create.go b/components/ws-manager/pkg/manager/create.go index 4736e64149cdf9..2faacbdc70a7d1 100644 --- a/components/ws-manager/pkg/manager/create.go +++ b/components/ws-manager/pkg/manager/create.go @@ -516,7 +516,7 @@ func (m *Manager) createWorkspaceContainer(startContext *startWorkspaceContext) var ( command = []string{"/.supervisor/workspacekit", "ring0"} readinessProbe = &corev1.Probe{ - Handler: corev1.Handler{ + ProbeHandler: corev1.ProbeHandler{ HTTPGet: &corev1.HTTPGetAction{ Path: "/_supervisor/v1/status/content/wait/true", Port: intstr.FromInt((int)(startContext.SupervisorPort)), diff --git a/components/ws-manager/pkg/manager/monitor_integration_test.go b/components/ws-manager/pkg/manager/monitor_integration_test.go index 9f6b94856335c1..3836b19f85d222 100644 --- a/components/ws-manager/pkg/manager/monitor_integration_test.go +++ b/components/ws-manager/pkg/manager/monitor_integration_test.go @@ -34,7 +34,7 @@ func TestIntegrationWorkspaceDisposal(t *testing.T) { { Name: "workspace", ReadinessProbe: &corev1.Probe{ - Handler: corev1.Handler{ + ProbeHandler: corev1.ProbeHandler{ Exec: &corev1.ExecAction{Command: []string{"echo"}}, }, }, diff --git a/components/ws-manager/pkg/manager/testing_test.go b/components/ws-manager/pkg/manager/testing_test.go index 7a98ff3bd37d0f..d2248934a976ec 100644 --- a/components/ws-manager/pkg/manager/testing_test.go +++ b/components/ws-manager/pkg/manager/testing_test.go @@ -9,6 +9,9 @@ import ( "testing" "time" + corev1 "k8s.io/api/core/v1" + "k8s.io/apimachinery/pkg/types" + "k8s.io/apimachinery/pkg/util/wait" "k8s.io/client-go/kubernetes" "sigs.k8s.io/controller-runtime/pkg/client" "sigs.k8s.io/controller-runtime/pkg/envtest" @@ -95,6 +98,18 @@ func forTestingOnlyGetManager(t *testing.T, objects ...client.Object) *Manager { return nil } + err = wait.PollImmediate(5*time.Second, 1*time.Minute, func() (bool, error) { + err := ctrlClient.Get(context.Background(), types.NamespacedName{Name: "default"}, &corev1.Namespace{}) + if err != nil { + return false, nil + } + return true, nil + }) + if err != nil { + t.Errorf("cannot create test environment: %v", err) + return nil + } + for _, obj := range objects { err := ctrlClient.Create(context.Background(), obj) if err != nil { diff --git a/components/ws-proxy/cmd/run.go b/components/ws-proxy/cmd/run.go index 4c36ca129b357d..c1d3b5994f8847 100644 --- a/components/ws-proxy/cmd/run.go +++ b/components/ws-proxy/cmd/run.go @@ -11,7 +11,7 @@ import ( "path/filepath" "time" - "github.com/bombsimon/logrusr" + "github.com/bombsimon/logrusr/v2" common_grpc "github.com/gitpod-io/gitpod/common-go/grpc" "github.com/gitpod-io/gitpod/common-go/log" "github.com/gitpod-io/gitpod/common-go/pprof" @@ -46,7 +46,7 @@ var runCmd = &cobra.Command{ log.WithError(err).WithField("filename", args[0]).Fatal("cannot load config") } - ctrl.SetLogger(logrusr.NewLogger(log.Log)) + ctrl.SetLogger(logrusr.New(log.Log)) opts := ctrl.Options{ Scheme: scheme,