Skip to content

Commit

Permalink
Remove obsolete go-test job (#261)
Browse files Browse the repository at this point in the history
* Remove obsolete go-test job

* Update dependencies

* Replace ioutil

* Replace ioutil

* Update architect-orb to avoid nancy false positives

* Mitigate goconst linter warning in unit test

* More linter silencing

* Upgrade golang.org/x/net
  • Loading branch information
marians committed Dec 4, 2023
1 parent 77ad877 commit dab8c31
Show file tree
Hide file tree
Showing 12 changed files with 172 additions and 142 deletions.
11 changes: 1 addition & 10 deletions .circleci/config.yml
Original file line number Diff line number Diff line change
@@ -1,23 +1,14 @@
version: 2.1

orbs:
architect: giantswarm/architect@4.33.0
architect: giantswarm/architect@4.35.5

workflows:
test:
jobs:
- architect/go-test:
name: go-test
filters:
# Trigger job also on git tag.
tags:
only: /^v.*/

- architect/go-build:
name: go-build-standup
binary: standup
requires:
- go-test
# Needed to trigger job also on git tag.
filters:
tags:
Expand Down
30 changes: 0 additions & 30 deletions .nancy-ignore
Original file line number Diff line number Diff line change
@@ -1,30 +0,0 @@
# pkg:golang/github.com/hashicorp/consul/sdk@v0.3.0
# pkg:golang/github.com/hashicorp/consul/api@v1.3.0
CVE-2022-29153 until=2023-12-31

pkg:golang/github.com/nats-io/nats-server/v2@v2.1.2
CVE-2020-26892 until=2023-12-31
CVE-2022-24450 until=2023-12-31
CVE-2020-26521 until=2023-12-31
CVE-2020-28466 until=2023-12-31
CVE-2021-3127 until=2023-12-31
CVE-2022-29946 until=2023-12-31
CVE-2021-32026 until=2023-12-31

# pkg:golang/github.com/lucas-clemente/quic-go@v0.10.2
# The current latest 0.28.1 has vulnerabilities
CVE-2022-30591 until=2023-08-31

# pkg:golang/github.com/caddyserver/caddy@v1.0.3
CVE-2022-34037 until=2023-12-31
CVE-2022-29718 until=2023-12-31

# pkg:golang/github.com/lucas-clemente/quic-go@v0.21.2
# The latest version that we can upgrade to without a breaking change is v0.21.2
# that has the same vulnerability
CVE-2022-30591

sonatype-2022-6522
CVE-2022-32149
CVE-2022-42708
CVE-2022-42709
4 changes: 2 additions & 2 deletions cmd/create/cluster/runner.go
Original file line number Diff line number Diff line change
Expand Up @@ -4,8 +4,8 @@ import (
"context"
"fmt"
"io"
"io/ioutil"
"math/rand"
"os"
"path/filepath"
"time"

Expand Down Expand Up @@ -142,7 +142,7 @@ func (r *runner) run(ctx context.Context, _ *cobra.Command, _ []string) error {
{
clusterIDPath := filepath.Join(r.flag.Output, "cluster-id")
r.logger.LogCtx(ctx, "message", fmt.Sprintf("writing cluster ID to path %s", clusterIDPath))
err := ioutil.WriteFile(clusterIDPath, []byte(clusterID), 0644) //#nosec
err := os.WriteFile(clusterIDPath, []byte(clusterID), 0644) //#nosec
if err != nil {
return microerror.Mask(err)
}
Expand Down
10 changes: 5 additions & 5 deletions cmd/create/release/runner.go
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ import (
"context"
"fmt"
"io"
"io/ioutil"
"os"
"path/filepath"
"regexp"
"strconv"
Expand Down Expand Up @@ -126,7 +126,7 @@ func (r *runner) run(ctx context.Context, _ *cobra.Command, _ []string) error {

r.logger.LogCtx(ctx, "message", "determined target installation is "+installation)

releaseYAML, err := ioutil.ReadFile(releasePath)
releaseYAML, err := os.ReadFile(releasePath)
if err != nil {
return microerror.Mask(err)
}
Expand Down Expand Up @@ -183,7 +183,7 @@ func (r *runner) run(ctx context.Context, _ *cobra.Command, _ []string) error {
{
providerPath := filepath.Join(r.flag.Output, "provider")
r.logger.LogCtx(ctx, "message", fmt.Sprintf("writing provider (%s) to path %s", provider, providerPath))
err := ioutil.WriteFile(providerPath, []byte(provider), 0644) //#nosec
err := os.WriteFile(providerPath, []byte(provider), 0644) //#nosec
if err != nil {
return microerror.Mask(err)
}
Expand All @@ -193,7 +193,7 @@ func (r *runner) run(ctx context.Context, _ *cobra.Command, _ []string) error {
{
installationPath := filepath.Join(r.flag.Output, "installation")
r.logger.LogCtx(ctx, "message", fmt.Sprintf("writing target installation (%s) to path %s", installation, installationPath))
err := ioutil.WriteFile(installationPath, []byte(installation), 0644) //#nosec
err := os.WriteFile(installationPath, []byte(installation), 0644) //#nosec
if err != nil {
return microerror.Mask(err)
}
Expand All @@ -216,7 +216,7 @@ func (r *runner) run(ctx context.Context, _ *cobra.Command, _ []string) error {
{
releaseIDPath := filepath.Join(r.flag.Output, "release-id")
r.logger.LogCtx(ctx, "message", fmt.Sprintf("writing release ID to path %s", releaseIDPath))
err := ioutil.WriteFile(releaseIDPath, []byte(release.Name), 0644) //#nosec
err := os.WriteFile(releaseIDPath, []byte(release.Name), 0644) //#nosec
if err != nil {
return microerror.Mask(err)
}
Expand Down
6 changes: 3 additions & 3 deletions cmd/create/release/runner_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -37,17 +37,17 @@ func Test_generateReleaseName(t *testing.T) {
{
name: "case 0: simple release version",
input: "v13.0.0",
expected: "v13.0.0-" + strconv.Itoa(int(time.Now().Unix())),
expected: "v13.0.0-" + strconv.Itoa(int(time.Now().Unix())), //nolint:goconst
},
{
name: "case 1: alpha release version",
input: "v13.0.0-alpha3",
expected: "v13.0.0-" + strconv.Itoa(int(time.Now().Unix())),
expected: "v13.0.0-" + strconv.Itoa(int(time.Now().Unix())), //nolint:goconst
},
{
name: "case 2: beta release version",
input: "v13.0.0-beta1",
expected: "v13.0.0-" + strconv.Itoa(int(time.Now().Unix())),
expected: "v13.0.0-" + strconv.Itoa(int(time.Now().Unix())), //nolint:goconst
},
{
name: "case 3: non-standard release version",
Expand Down
4 changes: 2 additions & 2 deletions cmd/create/testoperatorrelease/requests.go
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ package testoperatorrelease
import (
"context"
"fmt"
"io/ioutil"
"os"
"path/filepath"
"strings"

Expand Down Expand Up @@ -35,7 +35,7 @@ func (r *runner) updateFromRequests(ctx context.Context, release *v1alpha1.Relea
{
requestsPath := filepath.Join(r.flag.ReleasesPath, r.flag.Provider, "requests.yaml")

releaseYAML, err := ioutil.ReadFile(requestsPath)
releaseYAML, err := os.ReadFile(requestsPath)
if err != nil {
return microerror.Mask(err)
}
Expand Down
11 changes: 5 additions & 6 deletions cmd/create/testoperatorrelease/runner.go
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,6 @@ import (
"context"
"fmt"
"io"
"io/ioutil"
"os"
"path/filepath"
"regexp"
Expand Down Expand Up @@ -153,7 +152,7 @@ func (r *runner) createRelease(ctx context.Context, release *v1alpha1.Release) e
{
providerPath := filepath.Join(r.flag.Output, "provider")
r.logger.LogCtx(ctx, "message", fmt.Sprintf("writing provider to path %s", providerPath))
err := ioutil.WriteFile(providerPath, []byte(r.flag.Provider), 0644) //#nosec
err := os.WriteFile(providerPath, []byte(r.flag.Provider), 0644) //#nosec
if err != nil {
return microerror.Mask(err)
}
Expand All @@ -163,7 +162,7 @@ func (r *runner) createRelease(ctx context.Context, release *v1alpha1.Release) e
{
installationPath := filepath.Join(r.flag.Output, "installation")
r.logger.LogCtx(ctx, "message", fmt.Sprintf("writing target installation (%s) to path %s", installation, installationPath))
err := ioutil.WriteFile(installationPath, []byte(installation), 0644) //#nosec
err := os.WriteFile(installationPath, []byte(installation), 0644) //#nosec
if err != nil {
return microerror.Mask(err)
}
Expand All @@ -183,7 +182,7 @@ func (r *runner) createRelease(ctx context.Context, release *v1alpha1.Release) e
{
releaseIDPath := filepath.Join(r.flag.Output, "release-id")
r.logger.LogCtx(ctx, "message", fmt.Sprintf("writing release ID to path %s", releaseIDPath))
err := ioutil.WriteFile(releaseIDPath, []byte(release.Name), 0644) //#nosec
err := os.WriteFile(releaseIDPath, []byte(release.Name), 0644) //#nosec
if err != nil {
return microerror.Mask(err)
}
Expand Down Expand Up @@ -223,7 +222,7 @@ func (r *runner) findLatestRelease(ctx context.Context) (*v1alpha1.Release, erro
provider := r.flag.Provider
r.logger.LogCtx(ctx, "message", fmt.Sprintf("determining latest release for provider %s", provider))
{
entries, err := ioutil.ReadDir(filepath.Join(r.flag.ReleasesPath, provider))
entries, err := os.ReadDir(filepath.Join(r.flag.ReleasesPath, provider))
if err != nil {
return nil, microerror.Mask(err)
}
Expand Down Expand Up @@ -256,7 +255,7 @@ func (r *runner) findLatestRelease(ctx context.Context) (*v1alpha1.Release, erro
releasePath = filepath.Join(r.flag.ReleasesPath, provider, fmt.Sprintf("v%s", latest.String()), "release.yaml")
}

releaseYAML, err := ioutil.ReadFile(releasePath)
releaseYAML, err := os.ReadFile(releasePath)
if err != nil {
return nil, microerror.Mask(err)
}
Expand Down
6 changes: 3 additions & 3 deletions cmd/create/testoperatorrelease/runner_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -19,17 +19,17 @@ func Test_generateReleaseName(t *testing.T) {
{
name: "case 0: simple release version",
input: "v13.0.0",
expected: "v13.0.0-" + strconv.Itoa(int(time.Now().Unix())),
expected: "v13.0.0-" + strconv.Itoa(int(time.Now().Unix())), //nolint:goconst
},
{
name: "case 1: alpha release version",
input: "v13.0.0-alpha3",
expected: "v13.0.0-" + strconv.Itoa(int(time.Now().Unix())),
expected: "v13.0.0-" + strconv.Itoa(int(time.Now().Unix())), //nolint:goconst
},
{
name: "case 2: beta release version",
input: "v13.0.0-beta1",
expected: "v13.0.0-" + strconv.Itoa(int(time.Now().Unix())),
expected: "v13.0.0-" + strconv.Itoa(int(time.Now().Unix())), //nolint:goconst
},
{
name: "case 3: non-standard release version",
Expand Down
4 changes: 2 additions & 2 deletions cmd/wait/runner.go
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ import (
"context"
"fmt"
"io"
"io/ioutil"
"os"
"time"

applicationv1alpha1 "github.com/giantswarm/apiextensions/v3/pkg/apis/application/v1alpha1"
Expand Down Expand Up @@ -56,7 +56,7 @@ func labelsToSelector(labels map[string]string) string {
}

func (r *runner) run(ctx context.Context, _ *cobra.Command, _ []string) error {
kubeconfig, err := ioutil.ReadFile(r.flag.Kubeconfig)
kubeconfig, err := os.ReadFile(r.flag.Kubeconfig)
if err != nil {
return microerror.Mask(err)
}
Expand Down
83 changes: 69 additions & 14 deletions go.mod
Original file line number Diff line number Diff line change
@@ -1,10 +1,9 @@
module github.com/giantswarm/standup

go 1.14
go 1.19

require (
github.com/Masterminds/semver/v3 v3.1.1
github.com/fsnotify/fsnotify v1.5.1 // indirect
github.com/giantswarm/apiextensions/v2 v2.6.2
github.com/giantswarm/apiextensions/v3 v3.30.0
github.com/giantswarm/backoff v1.0.0
Expand All @@ -13,34 +12,90 @@ require (
github.com/giantswarm/k8sclient/v5 v5.12.0
github.com/giantswarm/microerror v0.4.0
github.com/giantswarm/micrologger v0.6.0
github.com/go-openapi/runtime v0.19.20 // indirect
github.com/golang/groupcache v0.0.0-20210331224755-41bb18bfe9da // indirect
github.com/google/go-cmp v0.5.9
github.com/mitchellh/mapstructure v1.4.3 // indirect
github.com/spf13/cobra v1.5.0
go.mongodb.org/mongo-driver v1.10.0 // indirect
golang.org/x/oauth2 v0.0.0-20211104180415-d3ed0bb246c8 // indirect
google.golang.org/protobuf v1.27.1 // indirect
k8s.io/api v0.18.19
k8s.io/apimachinery v0.18.19
k8s.io/client-go v0.18.19
k8s.io/utils v0.0.0-20200731180307-f00132d28269 // indirect
sigs.k8s.io/controller-runtime v0.6.4
sigs.k8s.io/yaml v1.3.0
)

require (
github.com/beorn7/perks v1.0.1 // indirect
github.com/blang/semver v3.5.1+incompatible // indirect
github.com/cenkalti/backoff/v4 v4.1.2 // indirect
github.com/cespare/xxhash/v2 v2.2.0 // indirect
github.com/davecgh/go-spew v1.1.1 // indirect
github.com/docker/distribution v2.7.1+incompatible // indirect
github.com/evanphx/json-patch v4.9.0+incompatible // indirect
github.com/fsnotify/fsnotify v1.5.1 // indirect
github.com/go-kit/log v0.2.1 // indirect
github.com/go-logfmt/logfmt v0.5.1 // indirect
github.com/go-logr/logr v0.1.0 // indirect
github.com/go-openapi/errors v0.19.6 // indirect
github.com/go-openapi/runtime v0.19.20 // indirect
github.com/go-openapi/spec v0.19.8 // indirect
github.com/go-openapi/strfmt v0.19.5 // indirect
github.com/go-openapi/validate v0.19.10 // indirect
github.com/go-stack/stack v1.8.1 // indirect
github.com/gobuffalo/flect v0.2.2 // indirect
github.com/gogo/protobuf v1.3.2 // indirect
github.com/golang/groupcache v0.0.0-20210331224755-41bb18bfe9da // indirect
github.com/golang/protobuf v1.5.3 // indirect
github.com/google/gofuzz v1.1.0 // indirect
github.com/google/uuid v1.1.2 // indirect
github.com/googleapis/gnostic v0.3.1 // indirect
github.com/hashicorp/golang-lru v0.5.4 // indirect
github.com/imdario/mergo v0.3.9 // indirect
github.com/inconshreveable/mousetrap v1.0.0 // indirect
github.com/json-iterator/go v1.1.12 // indirect
github.com/matttproud/golang_protobuf_extensions v1.0.4 // indirect
github.com/mitchellh/mapstructure v1.4.3 // indirect
github.com/modern-go/concurrent v0.0.0-20180306012644-bacd9c7ef1dd // indirect
github.com/modern-go/reflect2 v1.0.2 // indirect
github.com/onsi/gomega v1.10.1 // indirect
github.com/opencontainers/go-digest v1.0.0 // indirect
github.com/pkg/errors v0.9.1 // indirect
github.com/prometheus/client_golang v1.17.0 // indirect
github.com/prometheus/client_model v0.4.1-0.20230718164431-9a2bf3000d16 // indirect
github.com/prometheus/common v0.44.0 // indirect
github.com/prometheus/procfs v0.11.1 // indirect
github.com/spf13/pflag v1.0.5 // indirect
go.mongodb.org/mongo-driver v1.10.0 // indirect
go.uber.org/zap v1.17.0 // indirect
golang.org/x/crypto v0.16.0 // indirect
golang.org/x/net v0.19.0 // indirect
golang.org/x/oauth2 v0.8.0 // indirect
golang.org/x/sys v0.15.0 // indirect
golang.org/x/term v0.15.0 // indirect
golang.org/x/text v0.14.0 // indirect
golang.org/x/time v0.0.0-20191024005414-555d28b269f0 // indirect
golang.org/x/xerrors v0.0.0-20200804184101-5ec99f83aff1 // indirect
gomodules.xyz/jsonpatch/v2 v2.0.1 // indirect
google.golang.org/appengine v1.6.7 // indirect
google.golang.org/protobuf v1.31.0 // indirect
gopkg.in/inf.v0 v0.9.1 // indirect
gopkg.in/yaml.v2 v2.4.0 // indirect
k8s.io/apiextensions-apiserver v0.18.9 // indirect
k8s.io/klog v1.0.0 // indirect
k8s.io/klog/v2 v2.0.0 // indirect
k8s.io/kube-openapi v0.0.0-20200410145947-61e04a5be9a6 // indirect
k8s.io/utils v0.0.0-20200731180307-f00132d28269 // indirect
sigs.k8s.io/cluster-api v0.3.13 // indirect
sigs.k8s.io/structured-merge-diff/v3 v3.0.1 // indirect
)

replace (
github.com/aws/aws-sdk-go => github.com/aws/aws-sdk-go v1.44.66
github.com/coreos/etcd v3.3.10+incompatible => github.com/coreos/etcd v3.3.25+incompatible
github.com/coreos/etcd v3.3.13+incompatible => github.com/coreos/etcd v3.3.25+incompatible
github.com/dgrijalva/jwt-go => github.com/golang-jwt/jwt v3.2.1+incompatible
github.com/coreos/etcd => github.com/coreos/etcd v3.3.25+incompatible
github.com/dgrijalva/jwt-go => github.com/golang-jwt/jwt/v4 v4.1.0
github.com/gobuffalo/packr/v2 => github.com/gobuffalo/packr/v2 v2.8.3
github.com/gogo/protobuf v1.3.1 => github.com/gogo/protobuf v1.3.2
github.com/gorilla/websocket v1.4.0 => github.com/gorilla/websocket v1.4.2
github.com/miekg/dns => github.com/miekg/dns v1.1.50
github.com/pkg/sftp => github.com/pkg/sftp v1.13.5
github.com/prometheus/client_golang v1.11.0 => github.com/prometheus/client_golang v1.12.2
github.com/prometheus/client_golang v1.5.1 => github.com/prometheus/client_golang v1.12.2
github.com/prometheus/client_golang => github.com/prometheus/client_golang v1.17.0
go.mongodb.org/mongo-driver v1.3.4 => go.mongodb.org/mongo-driver v1.10.0
sigs.k8s.io/cluster-api => github.com/giantswarm/cluster-api v0.3.10-gs
)
Loading

0 comments on commit dab8c31

Please sign in to comment.