Skip to content

Commit c8017af

Browse files
amisevskAObuchow
authored andcommitted
Update code to remove incompatibilities with new dependencies
* Replace corev1.Handler with corev1.LifecycleHandler or ProbeHandler as required * Replace k8s.io/apimachinery/pkg/util/clock with k8s.io/utils/clock Signed-off-by: Angel Misevski <amisevsk@redhat.com>
1 parent e478e38 commit c8017af

File tree

6 files changed

+9
-9
lines changed

6 files changed

+9
-9
lines changed

controllers/workspace/status.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,7 @@ import (
3131
corev1 "k8s.io/api/core/v1"
3232
k8sErrors "k8s.io/apimachinery/pkg/api/errors"
3333
metav1 "k8s.io/apimachinery/pkg/apis/meta/v1"
34-
kubeclock "k8s.io/apimachinery/pkg/util/clock"
34+
kubeclock "k8s.io/utils/clock"
3535
"sigs.k8s.io/controller-runtime/pkg/reconcile"
3636

3737
"github.com/devfile/devworkspace-operator/apis/controller/v1alpha1"

controllers/workspace/util_test.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -32,7 +32,7 @@ import (
3232
k8sErrors "k8s.io/apimachinery/pkg/api/errors"
3333
metav1 "k8s.io/apimachinery/pkg/apis/meta/v1"
3434
"k8s.io/apimachinery/pkg/types"
35-
kubeclock "k8s.io/apimachinery/pkg/util/clock"
35+
kubeclock "k8s.io/utils/clock"
3636
)
3737

3838
const (

pkg/library/lifecycle/poststart.go

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -66,7 +66,7 @@ func AddPostStartLifecycleHooks(wksp *dw.DevWorkspaceTemplateSpec, containers []
6666
return nil
6767
}
6868

69-
func processCommandForPostStart(command *dw.ExecCommand) (*corev1.Handler, error) {
69+
func processCommandForPostStart(command *dw.ExecCommand) (*corev1.LifecycleHandler, error) {
7070
cmd := []string{"/bin/sh", "-c"}
7171

7272
if len(command.Env) > 0 {
@@ -81,7 +81,7 @@ func processCommandForPostStart(command *dw.ExecCommand) (*corev1.Handler, error
8181

8282
cmd = append(cmd, strings.Join(fullCmd, "\n"))
8383

84-
handler := &corev1.Handler{
84+
handler := &corev1.LifecycleHandler{
8585
Exec: &corev1.ExecAction{
8686
Command: cmd,
8787
},

pkg/provision/storage/asyncstorage/sidecar.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -77,7 +77,7 @@ func GetAsyncSidecar(devworkspaceID, sshVolumeName string, volumes []corev1.Volu
7777
},
7878
VolumeMounts: volumeMounts,
7979
Lifecycle: &corev1.Lifecycle{
80-
PreStop: &corev1.Handler{
80+
PreStop: &corev1.LifecycleHandler{
8181
Exec: &corev1.ExecAction{
8282
Command: []string{"/bin/sh", "-c", "/scripts/backup.sh"},
8383
},

pkg/provision/workspace/rbac/common_test.go

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,7 @@ import (
2525
"github.com/devfile/devworkspace-operator/pkg/config"
2626
"github.com/devfile/devworkspace-operator/pkg/constants"
2727
"github.com/devfile/devworkspace-operator/pkg/provision/sync"
28-
testlog "github.com/go-logr/logr/testing"
28+
"github.com/go-logr/logr/testr"
2929
"github.com/stretchr/testify/assert"
3030
rbacv1 "k8s.io/api/rbac/v1"
3131
metav1 "k8s.io/apimachinery/pkg/apis/meta/v1"
@@ -175,7 +175,7 @@ func getTestClusterAPI(t *testing.T, initialObjects ...client.Object) sync.Clust
175175
Ctx: context.Background(),
176176
Client: fakeClient,
177177
Scheme: scheme,
178-
Logger: testlog.TestLogger{T: t},
178+
Logger: testr.New(t),
179179
}
180180
}
181181

pkg/webhook/deployment.go

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -128,7 +128,7 @@ func getSpecDeployment(webhooksSecretName, namespace string) (*appsv1.Deployment
128128
Args: []string{"/usr/local/bin/webhook-server", "--metrics-addr=127.0.0.1:8080"},
129129
ImagePullPolicy: corev1.PullAlways,
130130
LivenessProbe: &corev1.Probe{
131-
Handler: corev1.Handler{
131+
ProbeHandler: corev1.ProbeHandler{
132132
HTTPGet: &corev1.HTTPGetAction{
133133
Path: "/healthz",
134134
Port: intstr.FromString("liveness-port"),
@@ -142,7 +142,7 @@ func getSpecDeployment(webhooksSecretName, namespace string) (*appsv1.Deployment
142142
FailureThreshold: 5,
143143
},
144144
ReadinessProbe: &corev1.Probe{
145-
Handler: corev1.Handler{
145+
ProbeHandler: corev1.ProbeHandler{
146146
HTTPGet: &corev1.HTTPGetAction{
147147
Path: "/readyz",
148148
Port: intstr.FromString("liveness-port"),

0 commit comments

Comments
 (0)