Skip to content

Commit

Permalink
chore: bump go version to 1.18 (#25)
Browse files Browse the repository at this point in the history
Signed-off-by: ArtemTrofimushkin <artemtrofimushkin@gmail.com>
  • Loading branch information
ArtemTrofimushkin authored Jul 13, 2022
1 parent 67b8e64 commit a889a32
Show file tree
Hide file tree
Showing 3 changed files with 11 additions and 15 deletions.
6 changes: 3 additions & 3 deletions .github/workflows/main.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ on:
- "*"

env:
GOLANG_VERSION: "^1.17.6"
GOLANG_VERSION: "^1.18.2"

jobs:
doc:
Expand Down Expand Up @@ -52,9 +52,9 @@ jobs:
- name: Lint
uses: golangci/golangci-lint-action@v2
with:
version: v1.42
version: v1.46.2
github-token: ${{ secrets.GITHUB_TOKEN }}
args: "--fix=false"
args: "--fix=false --timeout=10m"

tidy:
name: Mod tidy
Expand Down
2 changes: 1 addition & 1 deletion go.mod
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
module github.com/dodopizza/kubectl-shovel

go 1.17
go 1.18

require (
github.com/google/uuid v1.2.0
Expand Down
18 changes: 7 additions & 11 deletions internal/kubernetes/jobs.go
Original file line number Diff line number Diff line change
Expand Up @@ -106,10 +106,10 @@ func (j *JobRunSpec) Build(namespace string) *batch.Job {
},
ObjectMeta: metaSpec,
Spec: batch.JobSpec{
Parallelism: int32Ptr(1),
Completions: int32Ptr(1),
TTLSecondsAfterFinished: int32Ptr(5),
BackoffLimit: int32Ptr(0),
Parallelism: ptr(int32(1)),
Completions: ptr(int32(1)),
TTLSecondsAfterFinished: ptr(int32(5)),
BackoffLimit: ptr(int32(0)),
Template: core.PodTemplateSpec{
ObjectMeta: metaSpec,
Spec: core.PodSpec{
Expand Down Expand Up @@ -183,7 +183,7 @@ func (j *JobRunSpec) securityContext() *core.SecurityContext {
Capabilities: &core.Capabilities{
Add: []core.Capability{"SYS_PTRACE"},
},
Privileged: boolPtr(true),
Privileged: ptr(true),
}
}

Expand Down Expand Up @@ -212,10 +212,6 @@ func (k *Client) DeleteJob(name string) error {
Delete(context.Background(), name, options)
}

func int32Ptr(i int32) *int32 {
return &i
}

func boolPtr(b bool) *bool {
return &b
func ptr[T any](t T) *T {
return &t
}

0 comments on commit a889a32

Please sign in to comment.