Skip to content

Commit

Permalink
Removed outdated method
Browse files Browse the repository at this point in the history
  • Loading branch information
satr committed Jul 3, 2024
1 parent 612bfc3 commit efbe764
Showing 1 changed file with 1 addition and 32 deletions.
33 changes: 1 addition & 32 deletions api/applications/applications_controller_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,6 @@ import (
"bytes"
"context"
"encoding/json"
"errors"
"fmt"
"net/http"
"net/url"
Expand Down Expand Up @@ -38,7 +37,7 @@ import (
"github.com/stretchr/testify/assert"
"github.com/stretchr/testify/require"
metav1 "k8s.io/apimachinery/pkg/apis/meta/v1"
kubernetes "k8s.io/client-go/kubernetes"
"k8s.io/client-go/kubernetes"
kubefake "k8s.io/client-go/kubernetes/fake"
secretproviderfake "sigs.k8s.io/secrets-store-csi-driver/pkg/client/clientset/versioned/fake"
)
Expand Down Expand Up @@ -1854,36 +1853,6 @@ func TestRegenerateDeployKey_InvalidKeyInParam_ErrorIsReturned(t *testing.T) {
assert.Equal(t, http.StatusBadRequest, response.Code)
}

func setStatusOfCloneJob(kubeclient kubernetes.Interface, appNamespace string, succeededStatus bool) error {
timeout := time.After(1 * time.Second)
tick := time.Tick(200 * time.Millisecond)
var errs []error

for {
select {
case <-timeout:
return errors.Join(errs...)

case <-tick:
jobs, _ := kubeclient.BatchV1().Jobs(appNamespace).List(context.Background(), metav1.ListOptions{})
if len(jobs.Items) > 0 {
job := jobs.Items[0]

if succeededStatus {
job.Status.Succeeded = int32(1)
} else {
job.Status.Failed = int32(1)
}

_, le := kubeclient.BatchV1().Jobs(appNamespace).Update(context.Background(), &job, metav1.UpdateOptions{})
if le != nil {
errs = append(errs, le)
}
}
}
}
}

func createRadixJob(commonTestUtils *commontest.Utils, appName, jobName string, started time.Time) error {
_, err := commonTestUtils.ApplyJob(
builders.ARadixBuildDeployJob().
Expand Down

0 comments on commit efbe764

Please sign in to comment.