Skip to content

Commit b7d7433

Browse files
author
Christian Weichel
committed
[tests] Make compatible with Kubernetes v1.20.1
1 parent 339d036 commit b7d7433

File tree

3 files changed

+7
-7
lines changed

3 files changed

+7
-7
lines changed

test/pkg/integration/apis.go

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -144,7 +144,7 @@ func (c *ComponentAPI) GitpodServer(opts ...GitpodServerOpt) (res gitpod.APIInte
144144
c.serverStatus.Token[options.User] = tkn
145145
}
146146

147-
pods, err := c.t.clientset.CoreV1().Pods(c.t.namespace).List(metav1.ListOptions{
147+
pods, err := c.t.clientset.CoreV1().Pods(c.t.namespace).List(context.Background(), metav1.ListOptions{
148148
LabelSelector: "component=server",
149149
})
150150
if err != nil {
@@ -315,12 +315,12 @@ func (c *ComponentAPI) DB() *sql.DB {
315315
}()
316316

317317
if c.dbStatus.Port == 0 {
318-
svc, err := c.t.clientset.CoreV1().Services(c.t.namespace).Get("db", metav1.GetOptions{})
318+
svc, err := c.t.clientset.CoreV1().Services(c.t.namespace).Get(context.Background(), "db", metav1.GetOptions{})
319319
if err != nil {
320320
rerr = err
321321
return nil
322322
}
323-
pods, err := c.t.clientset.CoreV1().Pods(c.t.namespace).List(metav1.ListOptions{
323+
pods, err := c.t.clientset.CoreV1().Pods(c.t.namespace).List(context.Background(), metav1.ListOptions{
324324
LabelSelector: labels.SelectorFromSet(svc.Spec.Selector).String(),
325325
})
326326
if err != nil {
@@ -375,7 +375,7 @@ func (c *ComponentAPI) DB() *sql.DB {
375375
c.dbStatus.Port = localPort
376376
}
377377
if c.dbStatus.Password == "" {
378-
sct, err := c.t.clientset.CoreV1().Secrets(c.t.namespace).Get("db-password", metav1.GetOptions{})
378+
sct, err := c.t.clientset.CoreV1().Secrets(c.t.namespace).Get(context.Background(), "db-password", metav1.GetOptions{})
379379
if err != nil {
380380
rerr = err
381381
return nil

test/pkg/integration/integration.go

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -478,7 +478,7 @@ func (t *Test) selectPod(component ComponentType, options selectPodOptions) (pod
478478
}
479479
if component == ComponentWorkspaceDaemon && options.InstanceID != "" {
480480
var pods *corev1.PodList
481-
pods, err = t.clientset.CoreV1().Pods(t.namespace).List(metav1.ListOptions{
481+
pods, err = t.clientset.CoreV1().Pods(t.namespace).List(context.Background(), metav1.ListOptions{
482482
LabelSelector: "component=workspace,workspaceID=" + options.InstanceID,
483483
})
484484
if err != nil {
@@ -492,7 +492,7 @@ func (t *Test) selectPod(component ComponentType, options selectPodOptions) (pod
492492
listOptions.FieldSelector = "spec.nodeName=" + pods.Items[0].Spec.NodeName
493493
}
494494

495-
pods, err := t.clientset.CoreV1().Pods(t.namespace).List(listOptions)
495+
pods, err := t.clientset.CoreV1().Pods(t.namespace).List(context.Background(), listOptions)
496496
if err != nil {
497497
err = xerrors.Errorf("cannot list pods: %w", err)
498498
return

test/pkg/integration/workspace.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -132,7 +132,7 @@ func LaunchWorkspaceDirectly(it *Test, opts ...LaunchWorkspaceDirectlyOpt) (res
132132

133133
ideImage := options.IdeImage
134134
if ideImage == "" {
135-
pods, err := it.clientset.CoreV1().Pods(it.namespace).List(metav1.ListOptions{
135+
pods, err := it.clientset.CoreV1().Pods(it.namespace).List(context.Background(), metav1.ListOptions{
136136
LabelSelector: "component=server",
137137
})
138138
if err != nil {

0 commit comments

Comments
 (0)