diff --git a/.github/workflows/aws-integration.yaml b/.github/workflows/aws-integration.yaml index f09f1e3048..cbcedaa460 100644 --- a/.github/workflows/aws-integration.yaml +++ b/.github/workflows/aws-integration.yaml @@ -47,7 +47,7 @@ jobs: - name: Set up Go uses: actions/setup-go@v5 with: - go-version: "1.23" + go-version: "1.24" - name: Check out code into the Go module directory uses: actions/checkout@v4 - name: Cache go module diff --git a/.github/workflows/ci.yaml b/.github/workflows/ci.yaml index 4b3f5f92aa..f4f5cf591f 100644 --- a/.github/workflows/ci.yaml +++ b/.github/workflows/ci.yaml @@ -33,7 +33,7 @@ jobs: python-version: '3.12' - uses: actions/setup-go@v5 with: - go-version: "1.23" + go-version: "1.24" - uses: pre-commit/action@v3.0.1 - uses: pre-commit/action@v3.0.1 name: Verify generated files are up-to-date @@ -81,7 +81,7 @@ jobs: - name: Set up Go uses: actions/setup-go@v5 with: - go-version: "1.23" + go-version: "1.24" - name: Check out code into the Go module directory uses: actions/checkout@v4 - name: Cache go module diff --git a/.github/workflows/emailsender-central-compatibility.yaml b/.github/workflows/emailsender-central-compatibility.yaml index f5ed3e151e..e8d30b3914 100644 --- a/.github/workflows/emailsender-central-compatibility.yaml +++ b/.github/workflows/emailsender-central-compatibility.yaml @@ -35,7 +35,7 @@ jobs: - name: Set up Go uses: actions/setup-go@v5 with: - go-version: "1.23" + go-version: "1.24" - name: Cache go module uses: actions/cache@v4 with: diff --git a/.golangci.yml b/.golangci.yml index 82162f6a6d..0851bc9862 100644 --- a/.golangci.yml +++ b/.golangci.yml @@ -1,17 +1,21 @@ +# golangci-lint configuration v2 +version: 2 + run: - skip-dirs: - - internal/central/pkg/api/public - - internal/central/pkg/api/private - - internal/central/pkg/api/admin/private - - pkg/client/redhatsso/api - - emailsender/pkg/client/openapi - skip-files: - - ".*_moq.go" # timeout for analysis, e.g. 30s, 5m, default is 1m timeout: 10m + go: "1.24.7" issues: exclude-use-default: false + exclude-files: + - ".*_moq.go" + exclude-dirs: + - "internal/central/pkg/api/public" + - "internal/central/pkg/api/private" + - "internal/central/pkg/api/admin/private" + - "pkg/client/redhatsso/api" + - "emailsender/pkg/client/openapi" exclude-rules: - path: _test\.go linters: @@ -39,6 +43,10 @@ issues: text: "don't use leading k in Go names" linters-settings: + staticcheck: + # Disable specific staticcheck rules that were excluded in v1 config + # staticcheck now includes both SA (staticcheck) and ST (stylecheck) rules + checks: ["all", "-ST1000", "-ST1001", "-ST1003", "-ST1005", "-SA1019", "-SA4001", "-ST1016"] gosec: includes: - G601 @@ -90,9 +98,6 @@ linters-settings: allow-unused: false # report any unused nolint directives require-explanation: false # don't require an explanation for nolint directives require-specific: true # require nolint directives to be specific about which linter is being skipped - staticcheck: - go: "1.23" - checks: [ all,-ST1000,-ST1001,-ST1003,-ST1005,-SA1019,-SA4001,-ST1016 ] wrapcheck: {} # ignoreSigRegexps: uncomment to add ignore rules @@ -120,13 +125,10 @@ linters: # - godot # - godox # - goerr113 - - gofmt - - goimports - revive # - gomnd # - goprintffuncname - gosec - - gosimple - govet - ineffassign # - interfacer @@ -141,7 +143,6 @@ linters: # - scopelint - staticcheck # - structcheck - # - stylecheck # - testpackage # - typecheck # - unconvert diff --git a/.openshift-ci/e2e-runtime/Dockerfile b/.openshift-ci/e2e-runtime/Dockerfile index a07473ecb9..1b0be29fb7 100644 --- a/.openshift-ci/e2e-runtime/Dockerfile +++ b/.openshift-ci/e2e-runtime/Dockerfile @@ -5,7 +5,7 @@ RUN rpm --import /etc/pki/rpm-gpg/RPM-GPG-KEY-centosofficial RUN dnf update -y --disablerepo=\* --enablerepo=baseos,appstream && dnf -y install procps make which git gettext jq gcc && dnf clean all && rm -rf /var/cache/dnf -COPY --from=registry.ci.openshift.org/openshift/release:golang-1.23 /usr/lib/golang /usr/lib/golang +COPY --from=registry.redhat.io/rhel9/go-toolset:1.24.6 /usr/lib/golang /usr/lib/golang COPY --from=quay.io/openshift/origin-cli:4.20 /usr/bin/oc /usr/bin ENV GOPATH=/go diff --git a/.pre-commit-config.yaml b/.pre-commit-config.yaml index 8a8fbeeb1c..956f8a9118 100644 --- a/.pre-commit-config.yaml +++ b/.pre-commit-config.yaml @@ -15,7 +15,7 @@ repos: - id: detect-secrets args: ["--baseline", ".secrets.baseline"] - repo: https://github.com/golangci/golangci-lint - rev: v1.64.8 + rev: v2.4.0 hooks: - id: golangci-lint - repo: https://github.com/pre-commit/pre-commit-hooks diff --git a/CLAUDE.md b/CLAUDE.md index e1b82abdf8..ddc66ca4a5 100644 --- a/CLAUDE.md +++ b/CLAUDE.md @@ -152,7 +152,7 @@ The codebase follows a dependency injection pattern using the `goava/di` framewo ## Development Workflow ### Environment Setup -1. Install prerequisites: Go 1.23+, Docker, Node.js, Java, OCM CLI +1. Install prerequisites: Go 1.24+, Docker, Node.js, Java, OCM CLI 2. Run `make setup/git/hooks` to install pre-commit hooks 3. Use `make deploy/bootstrap` to set up development cluster 4. Run `make deploy/dev` to start local development environment diff --git a/Dockerfile b/Dockerfile index d895ce8931..aa3fa3a18e 100644 --- a/Dockerfile +++ b/Dockerfile @@ -1,4 +1,4 @@ -FROM --platform=$BUILDPLATFORM registry.access.redhat.com/ubi8/go-toolset:1.23.6-4 AS build +FROM --platform=$BUILDPLATFORM registry.access.redhat.com/ubi8/go-toolset:1.24.6-1756315360 AS build USER root RUN mkdir /src /rds_ca diff --git a/README.md b/README.md index 78a6f7b8c9..22f9218047 100644 --- a/README.md +++ b/README.md @@ -29,7 +29,7 @@ ACS fleet-manager repository for the ACS managed service. #### Prerequisites -* [Golang 1.23+](https://golang.org/dl/) +* [Golang 1.24+](https://golang.org/dl/) * [Docker](https://docs.docker.com/get-docker/) - to create database * [ocm cli](https://github.com/openshift-online/ocm-cli/releases) - ocm command line tool * [Node.js v12.20+](https://nodejs.org/en/download/) and [npm](https://docs.npmjs.com/downloading-and-installing-node-js-and-npm) diff --git a/emailsender/Dockerfile b/emailsender/Dockerfile index f49fc7ac15..60cbe38a36 100644 --- a/emailsender/Dockerfile +++ b/emailsender/Dockerfile @@ -1,4 +1,4 @@ -FROM registry.access.redhat.com/ubi8/go-toolset:1.23.6-4 AS build +FROM registry.access.redhat.com/ubi8/go-toolset:1.24.6-1756315360 AS build USER root ENV GOFLAGS="-mod=mod" diff --git a/fleetshard-operator/Dockerfile b/fleetshard-operator/Dockerfile index 157fc5a839..a069d69104 100644 --- a/fleetshard-operator/Dockerfile +++ b/fleetshard-operator/Dockerfile @@ -14,7 +14,7 @@ RUN microdnf install gzip tar && \ ARG IMAGE_TAG=latest RUN yq -i ".global.image.tag = strenv(IMAGE_TAG)" rhacs-terraform/values.yaml -FROM --platform=$BUILDPLATFORM registry.access.redhat.com/ubi8/go-toolset:1.23.6-4 AS build-go +FROM --platform=$BUILDPLATFORM registry.access.redhat.com/ubi8/go-toolset:1.24.6-1756315360 AS build-go USER root RUN mkdir /src diff --git a/go.mod b/go.mod index 430c23a3ee..302c56e386 100644 --- a/go.mod +++ b/go.mod @@ -1,12 +1,12 @@ module github.com/stackrox/acs-fleet-manager -go 1.23.0 +go 1.24.6 require ( github.com/DATA-DOG/go-sqlmock v1.5.2 github.com/antihax/optional v1.0.0 github.com/argoproj-labs/argocd-operator v0.14.0 - github.com/argoproj/argo-cd/v2 v2.14.13 + github.com/argoproj/argo-cd/v2 v2.14.17 github.com/aws/aws-sdk-go-v2 v1.36.5 github.com/aws/aws-sdk-go-v2/config v1.29.17 github.com/aws/aws-sdk-go-v2/credentials v1.17.70 diff --git a/go.sum b/go.sum index 0b88ba74f3..ff9686d78b 100644 --- a/go.sum +++ b/go.sum @@ -94,8 +94,8 @@ github.com/antihax/optional v1.0.0 h1:xK2lYat7ZLaVVcIuj82J8kIro4V6kDe0AUDFboUCwc github.com/antihax/optional v1.0.0/go.mod h1:uupD/76wgC+ih3iEmQUL+0Ugr19nfwCT1kdvxnR2qWY= github.com/argoproj-labs/argocd-operator v0.14.0 h1:ksHsdV5hC8u275PWU746EXB/c09g7UzdJPdkIqDQwjU= github.com/argoproj-labs/argocd-operator v0.14.0/go.mod h1:UHe70eXnnCEfzp7EWRofMU+BFnPgZiT5OSqpuInEARA= -github.com/argoproj/argo-cd/v2 v2.14.13 h1:oSLPHV9Gon6mEqVkyBOuLJ7T16ShZv6xSjkCiquzEDM= -github.com/argoproj/argo-cd/v2 v2.14.13/go.mod h1:P72XxcRigWQpQsuAgaXyHPFYkSPE4sdACA5g/s3Si1I= +github.com/argoproj/argo-cd/v2 v2.14.17 h1:r/CkYKzHoPjGgJ/4/fdubUVpG+LBj6AtOigbitNHgy4= +github.com/argoproj/argo-cd/v2 v2.14.17/go.mod h1:CF9GX0CjKiszpAnvYNCLV5tLSVqgfOgn/tcOt2VHTQo= github.com/argoproj/gitops-engine v0.7.1-0.20250521000818-c08b0a72c1f1 h1:Ze4U6kV49vSzlUBhH10HkO52bYKAIXS4tHr/MlNDfdU= github.com/argoproj/gitops-engine v0.7.1-0.20250521000818-c08b0a72c1f1/go.mod h1:WsnykM8idYRUnneeT31cM/Fq/ZsjkefCbjiD8ioCJkU= github.com/argoproj/pkg v0.13.7-0.20230626144333-d56162821bd1 h1:qsHwwOJ21K2Ao0xPju1sNuqphyMnMYkyB3ZLoLtxWpo= diff --git a/internal/central/pkg/handlers/admin_central.go b/internal/central/pkg/handlers/admin_central.go index ea5d1be9c9..11fed43686 100644 --- a/internal/central/pkg/handlers/admin_central.go +++ b/internal/central/pkg/handlers/admin_central.go @@ -3,7 +3,6 @@ package handlers import ( "encoding/json" - "fmt" "io" "net/http" "regexp" @@ -376,7 +375,7 @@ func (h adminCentralHandler) GetTrait(w http.ResponseWriter, r *http.Request) { return nil, svcErr } if !arrays.Contains(cr.Traits, trait) { - return nil, errors.NotFound(fmt.Sprintf("Trait %q not found", trait)) + return nil, errors.NotFound("Trait %q not found", trait) } return nil, nil }, diff --git a/internal/central/pkg/services/central.go b/internal/central/pkg/services/central.go index c2dd4eb0b7..ea5be03743 100644 --- a/internal/central/pkg/services/central.go +++ b/internal/central/pkg/services/central.go @@ -287,7 +287,7 @@ func (k *centralService) RegisterCentralJob(ctx context.Context, centralRequest } else if !hasCapacity { errorMsg := fmt.Sprintf("Cluster capacity(%d) exhausted in %s region", int64(k.dataplaneClusterConfig.ClusterConfig.GetCapacityForRegion(centralRequest.Region)), centralRequest.Region) logger.Logger.Warningf(errorMsg) - return errors.TooManyCentralInstancesReached(errorMsg) + return errors.TooManyCentralInstancesReached("%s", errorMsg) } instanceType := k.DetectInstanceType(centralRequest) @@ -298,7 +298,7 @@ func (k *centralService) RegisterCentralJob(ctx context.Context, centralRequest if e != nil || cluster == nil { msg := fmt.Sprintf("No available cluster found for '%s' central instance in region: '%s'", centralRequest.InstanceType, centralRequest.Region) logger.Logger.Errorf(msg) - return errors.TooManyCentralInstancesReached(fmt.Sprintf("Region %s cannot accept instance type: %s at this moment", centralRequest.Region, centralRequest.InstanceType)) + return errors.TooManyCentralInstancesReached("Region %s cannot accept instance type: %s at this moment", centralRequest.Region, centralRequest.InstanceType) } centralRequest.ClusterID = cluster.ClusterID subscriptionID, err := k.reserveQuota(ctx, centralRequest, "", "") @@ -747,7 +747,7 @@ func (k *centralService) VerifyAndUpdateCentralAdmin(ctx context.Context, centra return errors.NewWithCause(errors.ErrorGeneral, svcErr, "Unable to find cluster associated with central request: %s", centralRequest.ID) } if cluster == nil { - return errors.New(errors.ErrorValidation, fmt.Sprintf("Unable to get cluster for central %s", centralRequest.ID)) + return errors.New(errors.ErrorValidation, "Unable to get cluster for central %s", centralRequest.ID) } return k.UpdateIgnoreNils(centralRequest) diff --git a/internal/central/pkg/services/quota/ams_quota_service.go b/internal/central/pkg/services/quota/ams_quota_service.go index 0ac851702f..f6e8538d86 100644 --- a/internal/central/pkg/services/quota/ams_quota_service.go +++ b/internal/central/pkg/services/quota/ams_quota_service.go @@ -3,7 +3,6 @@ package quota import ( "context" - "fmt" "net/http" "time" @@ -50,9 +49,9 @@ func (q amsQuotaService) HasQuotaAllowance(central *dbapi.CentralRequest, instan quotaType := instanceType.GetQuotaType() quotaCosts, err := q.amsClient.GetQuotaCostsForProduct(org.ID(), quotaType.GetResourceName(), quotaType.GetProduct()) if err != nil { - return false, errors.NewWithCause(errors.ErrorGeneral, err, fmt.Sprintf( + return false, errors.NewWithCause(errors.ErrorGeneral, err, "failed to get assigned quota of type %q for organization with external id %q and id %q", - quotaType, central.OrganisationID, org.ID())) + quotaType, central.OrganisationID, org.ID()) } quotaCostsByModel, unsupportedModels := mapAllowedQuotaCosts(quotaCosts) diff --git a/internal/central/pkg/services/quota/quota_management_list_service.go b/internal/central/pkg/services/quota/quota_management_list_service.go index 38f8a37279..b9f15de5ad 100644 --- a/internal/central/pkg/services/quota/quota_management_list_service.go +++ b/internal/central/pkg/services/quota/quota_management_list_service.go @@ -95,12 +95,12 @@ func (q QuotaManagementListService) ReserveQuota(_ context.Context, central *dba if quotaManagementListItem.IsInstanceCountWithinLimit(totalInstanceCount) { return "", nil } - return "", errors.MaximumAllowedInstanceReached(message) + return "", errors.MaximumAllowedInstanceReached("%s", message) } if instanceType == types.EVAL && quotaManagementListItem == nil { if totalInstanceCount >= quotamanagement.GetDefaultMaxAllowedInstances() { - return "", errors.MaximumAllowedInstanceReached(message) + return "", errors.MaximumAllowedInstanceReached("%s", message) } return "", nil } diff --git a/internal/central/test/integration/centrals_test.go b/internal/central/test/integration/centrals_test.go index 22c9c76b01..8a0ad5e170 100644 --- a/internal/central/test/integration/centrals_test.go +++ b/internal/central/test/integration/centrals_test.go @@ -142,7 +142,7 @@ func TestCentral_Delete(t *testing.T) { ocmServerBuilder := mocks.NewMockConfigurableServerBuilder() mockedGetClusterResponse, err := mockedClusterWithMetricsInfo(mocks.MockClusterComputeNodes) if err != nil { - t.Fatalf(err.Error()) + t.Fatalf("%s", err.Error()) } ocmServerBuilder.SetClusterGetResponse(mockedGetClusterResponse, nil) diff --git a/internal/central/test/integration/data_plane_endpoints_test.go b/internal/central/test/integration/data_plane_endpoints_test.go index b4e28b28d7..24b7561098 100644 --- a/internal/central/test/integration/data_plane_endpoints_test.go +++ b/internal/central/test/integration/data_plane_endpoints_test.go @@ -28,7 +28,7 @@ func TestDataPlaneClusterStatus(t *testing.T) { ocmServerBuilder := mocks.NewMockConfigurableServerBuilder() mockedGetClusterResponse, err := mockedClusterWithMetricsInfo(mocks.MockClusterComputeNodes) if err != nil { - t.Fatalf(err.Error()) + t.Fatalf("%s", err.Error()) } ocmServerBuilder.SetClusterGetResponse(mockedGetClusterResponse, nil) diff --git a/internal/central/test/integration/require_terms_acceptance_middleware_test.go b/internal/central/test/integration/require_terms_acceptance_middleware_test.go index 9144849733..4d85a257e9 100644 --- a/internal/central/test/integration/require_terms_acceptance_middleware_test.go +++ b/internal/central/test/integration/require_terms_acceptance_middleware_test.go @@ -28,7 +28,7 @@ func termsRequiredSetup(termsRequired bool, t *testing.T) TestEnv { ocmServerBuilder := mocks.NewMockConfigurableServerBuilder() termsReviewResponse, err := mocks.GetMockTermsReviewBuilder(nil).TermsRequired(termsRequired).Build() if err != nil { - t.Fatalf(err.Error()) + t.Fatalf("%s", err.Error()) } ocmServerBuilder.SetTermsReviewPostResponse(termsReviewResponse, nil) ocmServer := ocmServerBuilder.Build() diff --git a/pkg/api/error.go b/pkg/api/error.go index 95f968469d..4f22c378d5 100644 --- a/pkg/api/error.go +++ b/pkg/api/error.go @@ -17,11 +17,7 @@ func SendNotFound(w http.ResponseWriter, r *http.Request) { w.Header().Set("Content-Type", "application/json") // Prepare the body: - reason := fmt.Sprintf( - "The requested resource '%s' doesn't exist", - r.URL.Path, - ) - apiError := errors.NotFound(reason).AsOpenapiError("", r.RequestURI) + apiError := errors.NotFound("The requested resource '%s' doesn't exist", r.URL.Path).AsOpenapiError("", r.RequestURI) data, err := json.Marshal(apiError) if err != nil { SendPanic(w, r) @@ -41,8 +37,7 @@ func SendNotFound(w http.ResponseWriter, r *http.Request) { // SendMethodNotAllowed response func SendMethodNotAllowed(w http.ResponseWriter, r *http.Request) { - reason := fmt.Sprintf("Method: %s is not allowed or not yet implemented for %s", r.Method, r.URL.Path) - apiError := errors.NotImplemented(reason).AsOpenapiError("", r.RequestURI) + apiError := errors.NotImplemented("Method: %s is not allowed or not yet implemented for %s", r.Method, r.URL.Path).AsOpenapiError("", r.RequestURI) jsonPayload, err := json.Marshal(apiError) if err != nil { SendPanic(w, r) @@ -87,7 +82,7 @@ func SendServiceUnavailable(w http.ResponseWriter, r *http.Request, reason strin w.Header().Set("Content-Type", "application/json") w.WriteHeader(http.StatusServiceUnavailable) - apiError := errors.GeneralError(reason).AsOpenapiError("", r.RequestURI) + apiError := errors.GeneralError("%s", reason).AsOpenapiError("", r.RequestURI) jsonPayload, err := json.Marshal(apiError) if err != nil { SendPanic(w, r) diff --git a/pkg/api/resource_id_test.go b/pkg/api/resource_id_test.go index 5997f2b5d1..41ab1c3c61 100644 --- a/pkg/api/resource_id_test.go +++ b/pkg/api/resource_id_test.go @@ -11,7 +11,7 @@ func TestResourceIDGeneration(t *testing.T) { errors := validation.IsDNS1123Label(id) if len(errors) > 0 { for _, e := range errors { - t.Fatalf(e) + t.Fatalf("%s", e) } } } diff --git a/pkg/client/ocm/impl/client_impl.go b/pkg/client/ocm/impl/client_impl.go index ca4dd2996a..d8ab118965 100644 --- a/pkg/client/ocm/impl/client_impl.go +++ b/pkg/client/ocm/impl/client_impl.go @@ -123,7 +123,7 @@ func (c *client) CreateCluster(cluster *clustersmgmtv1.Cluster) (*clustersmgmtv1 clusterResource := c.connection.ClustersMgmt().V1().Clusters() response, err := clusterResource.Add().Body(cluster).Send() if err != nil { - return &clustersmgmtv1.Cluster{}, serviceErrors.New(serviceErrors.ErrorGeneral, err.Error()) + return &clustersmgmtv1.Cluster{}, serviceErrors.New(serviceErrors.ErrorGeneral, "%s", err.Error()) } createdCluster := response.Body() diff --git a/pkg/errors/errors.go b/pkg/errors/errors.go index dfc256a37c..6b42a5e876 100644 --- a/pkg/errors/errors.go +++ b/pkg/errors/errors.go @@ -314,7 +314,7 @@ func ToServiceError(err error) *ServiceError { case *ServiceError: return convertedErr default: - return GeneralError(convertedErr.Error()) + return GeneralError("%s", convertedErr.Error()) } } @@ -398,7 +398,7 @@ func (e *ServiceError) AsError() error { if e == nil { return nil } - return fmt.Errorf(e.Error()) + return fmt.Errorf("%s", e.Error()) } // Is404 ... @@ -693,5 +693,5 @@ func FailedClusterAuthorization(err error) *ServiceError { if svcErr.IsForbidden() { reason += " - please contact your administrator to ensure that your Red Hat account has the RedhatManagedCluster permission." } - return NewWithCause(svcErr.Code, svcErr, reason) + return NewWithCause(svcErr.Code, svcErr, "%s", reason) } diff --git a/probe/Dockerfile b/probe/Dockerfile index fa2d40a931..14f61fc235 100644 --- a/probe/Dockerfile +++ b/probe/Dockerfile @@ -1,10 +1,9 @@ -FROM --platform=$BUILDPLATFORM registry.access.redhat.com/ubi8/go-toolset:1.23.9-2.1749483526 AS build +FROM --platform=$BUILDPLATFORM registry.access.redhat.com/ubi8/go-toolset:1.24.6-1756315360 AS build USER root ENV GOFLAGS="-mod=mod" RUN mkdir /src WORKDIR /src -RUN CGO_ENABLED=0 go install -ldflags "-s -w -extldflags '-static'" github.com/go-delve/delve/cmd/dlv@v1.23.1 COPY go.* ./ RUN go mod download COPY . ./ diff --git a/scripts/ci/central_compatibility/run_compatibility_test.sh b/scripts/ci/central_compatibility/run_compatibility_test.sh index b74b089394..dc4f66bef1 100644 --- a/scripts/ci/central_compatibility/run_compatibility_test.sh +++ b/scripts/ci/central_compatibility/run_compatibility_test.sh @@ -66,7 +66,7 @@ if [ "$GITHUB_REPOSITORY" = "stackrox/stackrox" ]; then ACS_VERSION="$(make --no-print-directory -C "$STACKROX_DIR" tag)" else git -C "$STACKROX_DIR" fetch --tags - ACS_VERSION="$(git -C "$STACKROX_DIR" tag | grep nightly | tail -n 1)" + ACS_VERSION="$(git -C "$STACKROX_DIR" tag | grep -E '.*-nightly-[0-9]{8}$' | tail -n 1)" git -C "$STACKROX_DIR" checkout "$ACS_VERSION" fi @@ -100,7 +100,8 @@ helm upgrade --install -n $CENTRAL_NS stackrox-central-services ./central-chart -f "${SOURCE_DIR}/central-values.yaml" \ --set "central.adminPassword.values=$ADMIN_PW" \ --set "central.image.tag=$ACS_VERSION" \ - --set "central.db.image.tag=$ACS_VERSION" + --set "central.db.image.tag=$ACS_VERSION" \ + --set "scannerV4.db.image.tag=$ACS_VERSION" KUBECTL="$(which kubectl)" wait_for_container_to_become_ready "$CENTRAL_NS" "app=central" "central" diff --git a/test/helper.go b/test/helper.go index d3c5540d77..4dcbbb11c2 100644 --- a/test/helper.go +++ b/test/helper.go @@ -230,7 +230,7 @@ func (helper *Helper) NewAccountWithNameAndOrg(name string, orgID string) *amv1. func (helper *Helper) NewAccount(username, name, email string, orgID string) *amv1.Account { account, err := helper.AuthHelper.NewAccount(username, name, email, orgID) if err != nil { - helper.T.Errorf(fmt.Sprintf("Unable to create a new account: %s", err.Error())) + helper.T.Errorf("Unable to create a new account: %s", err.Error()) } return account } @@ -239,7 +239,7 @@ func (helper *Helper) NewAccount(username, name, email string, orgID string) *am func (helper *Helper) NewAuthenticatedContext(account *amv1.Account, claims jwt.MapClaims) context.Context { token, err := helper.AuthHelper.CreateSignedJWT(account, claims) if err != nil { - helper.T.Errorf(fmt.Sprintf("Unable to create a signed token: %s", err.Error())) + helper.T.Errorf("Unable to create a signed token: %s", err.Error()) } return context.WithValue(context.Background(), compat.ContextAccessToken, token) @@ -260,7 +260,7 @@ func (helper *Helper) NewAuthenticatedAdminContext(account *amv1.Account, claims token, err := helper.AuthHelper.CreateSignedJWT(account, claims) if err != nil { - helper.T.Errorf(fmt.Sprintf("Unable to create a signed token: %s", err.Error())) + helper.T.Errorf("Unable to create a signed token: %s", err.Error()) } return context.WithValue(context.Background(), adminprivate.ContextAccessToken, token) @@ -301,7 +301,7 @@ func (helper *Helper) ResetDB() { func (helper *Helper) CreateJWTString(account *amv1.Account) string { token, err := helper.AuthHelper.CreateSignedJWT(account, nil) if err != nil { - helper.T.Errorf(fmt.Sprintf("Unable to create a signed token: %s", err.Error())) + helper.T.Errorf("Unable to create a signed token: %s", err.Error()) } return token } @@ -310,7 +310,7 @@ func (helper *Helper) CreateJWTString(account *amv1.Account) string { func (helper *Helper) CreateJWTStringWithClaim(account *amv1.Account, jwtClaims jwt.MapClaims) string { token, err := helper.AuthHelper.CreateSignedJWT(account, jwtClaims) if err != nil { - helper.T.Errorf(fmt.Sprintf("Unable to create a signed token with the given claims: %s", err.Error())) + helper.T.Errorf("Unable to create a signed token with the given claims: %s", err.Error()) } return token } diff --git a/test/mocks/jwk_cert_server.go b/test/mocks/jwk_cert_server.go index af76829a29..3d5278ea0a 100644 --- a/test/mocks/jwk_cert_server.go +++ b/test/mocks/jwk_cert_server.go @@ -32,7 +32,7 @@ func NewJWKCertServerMock(t *testing.T, pubKey crypto.PublicKey, jwkKID string) t.Errorf("Unable to marshal public jwk: %s", err) return } - fmt.Fprintf(w, fmt.Sprintf(`{"keys":[%s]}`, string(jwkBytes))) //nolint:staticcheck + _, _ = fmt.Fprintf(w, `{"keys":[%s]}`, string(jwkBytes)) }, ) diff --git a/tools/go.mod b/tools/go.mod index e2469c86ab..7faefb7964 100644 --- a/tools/go.mod +++ b/tools/go.mod @@ -1,6 +1,6 @@ module github.com/stackrox/acs-fleet-manager/tools -go 1.23.0 +go 1.24.6 require ( github.com/matryer/moq v0.5.2