Skip to content

Commit 8a3a62d

Browse files
use naisv1 for jobs and handle errors when deleting jobs
Co-authored-by: Thomas Krampl <[email protected]>
1 parent 0049703 commit 8a3a62d

File tree

2 files changed

+4
-2
lines changed

2 files changed

+4
-2
lines changed

internal/graph/naisjob.resolvers.go

+2
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

internal/k8s/naisjobs.go

+2-2
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,6 @@ import (
99
"time"
1010

1111
naisv1 "github.com/nais/liberator/pkg/apis/nais.io/v1"
12-
naisv1alpha1 "github.com/nais/liberator/pkg/apis/nais.io/v1alpha1"
1312
sync_states "github.com/nais/liberator/pkg/events"
1413
"gopkg.in/yaml.v2"
1514
batchv1 "k8s.io/api/batch/v1"
@@ -36,13 +35,14 @@ func (c *Client) DeleteJob(ctx context.Context, name, team, env string) error {
3635
return c.error(ctx, fmt.Errorf("no client set for env %q", env), "getting client")
3736
}
3837

39-
app := cli.dynamicClient.Resource(naisv1alpha1.GroupVersion.WithResource("naisjobs")).Namespace(team)
38+
app := cli.dynamicClient.Resource(naisv1.GroupVersion.WithResource("naisjobs")).Namespace(team)
4039
if err := app.Delete(ctx, name, metav1.DeleteOptions{}); err != nil {
4140
return c.error(ctx, err, "deleting naisjob")
4241
}
4342

4443
return nil
4544
}
45+
4646
func (c *Client) NaisJob(ctx context.Context, name, team, env string) (*model.NaisJob, error) {
4747
c.log.Debugf("getting job %q in namespace %q in env %q", name, team, env)
4848
if c.informers[env] == nil {

0 commit comments

Comments
 (0)