Skip to content

Commit

Permalink
Update signatures due to k8s v1.23 changes
Browse files Browse the repository at this point in the history
  • Loading branch information
aledbf committed Mar 2, 2022
1 parent f93d0be commit cceb7ac
Show file tree
Hide file tree
Showing 5 changed files with 21 additions and 6 deletions.
4 changes: 2 additions & 2 deletions components/ws-manager/cmd/run.go
Original file line number Diff line number Diff line change
Expand Up @@ -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"
Expand Down Expand Up @@ -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,
Expand Down
2 changes: 1 addition & 1 deletion components/ws-manager/pkg/manager/create.go
Original file line number Diff line number Diff line change
Expand Up @@ -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)),
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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"}},
},
},
Expand Down
15 changes: 15 additions & 0 deletions components/ws-manager/pkg/manager/testing_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -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"
Expand Down Expand Up @@ -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 {
Expand Down
4 changes: 2 additions & 2 deletions components/ws-proxy/cmd/run.go
Original file line number Diff line number Diff line change
Expand Up @@ -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"
Expand Down Expand Up @@ -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,
Expand Down

0 comments on commit cceb7ac

Please sign in to comment.