Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
9 changes: 5 additions & 4 deletions .github/workflows/code-quality.yml
Original file line number Diff line number Diff line change
Expand Up @@ -16,14 +16,15 @@ jobs:
uses: actions/checkout@v4

- name: Set up Go
uses: actions/setup-go@v5
uses: actions/setup-go@v6
with:
go-version-file: 'go.mod'
cache: true

- name: Install golangci-lint
run: |
curl -sSfL https://raw.githubusercontent.com/golangci/golangci-lint/master/install.sh | sh -s -- -b $(go env GOPATH)/bin v2.5.0
- name: golangci-lint
uses: golangci/golangci-lint-action@v9
with:
version: v2.12.2

- name: Check formatting
run: |
Expand Down
16 changes: 8 additions & 8 deletions .golangci.yml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
# golangci-lint configuration for roxie

version: 2
version: "2"

run:
timeout: 5m
Expand All @@ -15,23 +15,23 @@ linters:
- ineffassign # Detect ineffectual assignments
- misspell # Find commonly misspelled words

settings:
staticcheck:
checks: ["all", "-SA4009", "-ST1000", "-ST1003", "-ST1020"]

# Disable noisy linters
disable:
- errcheck # Too many false positives for cleanup code
- gosec # Security linter is too strict for dev tooling
- revive # Style linter is too opinionated
- unparam # Often flags valid parameter flexibility

linters-settings:
staticcheck:
checks: ["all", "-SA4009"] # Disable "argument is overwritten" check

issues:
# Don't limit the number of issues
max-issues-per-linter: 0
max-same-issues: 0

output:
print-issued-lines: true
print-linter-name: true
sort-results: true
formats:
text:
path: stdout
1 change: 1 addition & 0 deletions Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@ ARG TARGETARCH

WORKDIR /build
USER root
ENV GOTOOLCHAIN=auto

# Copy go mod files first for better layer caching
COPY go.mod go.sum ./
Expand Down
17 changes: 11 additions & 6 deletions cmd/deploy.go
Original file line number Diff line number Diff line change
Expand Up @@ -347,11 +347,15 @@ func runDeploy(cmd *cobra.Command, args []string) error {
}

func configureConfig(log *logger.Logger, components component.Component, deploySettings *deployer.Config) error {
clusterType := env.GetCurrentClusterType()
log.Dimf("Detected cluster type: %v", clusterType)
defaults, err := clusterdefaults.ApplyClusterDefaults(clusterType, deploySettings)
if deploySettings.Roxie.ClusterType == types.ClusterTypeUnknown {
clusterType := env.GetCurrentClusterType()
log.Dimf("Detected cluster type: %v", clusterType)
deploySettings.Roxie.ClusterType = clusterType
}
clusterType := deploySettings.Roxie.ClusterType
defaults, err := clusterdefaults.ApplyClusterDefaults(deploySettings)
if err != nil {
return fmt.Errorf("applying defaults for cluster type %v: %w", clusterType, err)
return err
}
if verbose {
log.Dimf("Applying the following defaults based on detected cluster type %v:", clusterType)
Expand Down Expand Up @@ -409,6 +413,8 @@ func deployValidate(components component.Component, deploySettings *deployer.Con
return errors.New("running without a controlling terminal requires --envrc to be set")
}

clusterType := deploySettings.Roxie.ClusterType

if env.RunningInRoxieContainer {
// For running containerized we have specific requirements.
if deploySettings.Central.PortForwardingEnabled() {
Expand All @@ -419,7 +425,7 @@ func deployValidate(components component.Component, deploySettings *deployer.Con
}

// On infra OpenShift we already get image pull secrets for Quay automatically.
if clusterType := env.GetCurrentClusterType(); clusterType != types.ClusterTypeInfraOpenShift4 {
if clusterType != types.ClusterTypeInfraOpenShift4 {
if os.Getenv("REGISTRY_USERNAME") == "" || os.Getenv("REGISTRY_PASSWORD") == "" {
return fmt.Errorf("containerized mode requires REGISTRY_USERNAME and REGISTRY_PASSWORD environment variables for clusters of type %s", clusterType)
}
Expand All @@ -437,7 +443,6 @@ func deployValidate(components component.Component, deploySettings *deployer.Con
if deploySettings.Operator.DeployViaOlm {
return errors.New("using Konflux images while deploying operator via OLM is not supported")
}
clusterType := env.GetCurrentClusterType()
if !clusterType.IsOpenShift() {
return fmt.Errorf("--konflux flag is only supported on OpenShift 4 clusters (current cluster type: %s)", clusterType.String())
}
Expand Down
40 changes: 30 additions & 10 deletions go.mod
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
module github.com/stackrox/roxie

go 1.25.6
go 1.26.0

require (
dario.cat/mergo v1.0.2
Expand All @@ -9,16 +9,36 @@ require (
github.com/spf13/cobra v1.10.2
github.com/spf13/pflag v1.0.10
github.com/stretchr/testify v1.11.1
golang.org/x/term v0.38.0
golang.org/x/term v0.39.0
gopkg.in/yaml.v3 v3.0.1
k8s.io/apimachinery v0.35.3
k8s.io/utils v0.0.0-20251002143259-bc988d571ff4
k8s.io/api v0.36.1
k8s.io/apimachinery v0.36.1
k8s.io/client-go v0.36.1
k8s.io/utils v0.0.0-20260210185600-b8788abfbbc2
)

require (
github.com/emicklei/go-restful/v3 v3.13.0 // indirect
github.com/go-openapi/jsonpointer v0.21.0 // indirect
github.com/go-openapi/jsonreference v0.20.2 // indirect
github.com/go-openapi/swag v0.23.0 // indirect
github.com/google/gnostic-models v0.7.0 // indirect
github.com/google/uuid v1.6.0 // indirect
github.com/josharian/intern v1.0.0 // indirect
github.com/mailru/easyjson v0.7.7 // indirect
github.com/munnerz/goautoneg v0.0.0-20191010083416-a7dc8b61c822 // indirect
go.yaml.in/yaml/v3 v3.0.4 // indirect
golang.org/x/oauth2 v0.36.0 // indirect
golang.org/x/time v0.14.0 // indirect
google.golang.org/protobuf v1.36.12-0.20260120151049-f2248ac996af // indirect
gopkg.in/evanphx/json-patch.v4 v4.13.0 // indirect
sigs.k8s.io/yaml v1.6.0 // indirect
)

require (
github.com/Masterminds/semver/v3 v3.4.0
github.com/containerd/stargz-snapshotter/estargz v0.18.2 // indirect
github.com/davecgh/go-spew v1.1.1 // indirect
github.com/davecgh/go-spew v1.1.2-0.20180830191138-d8f796af33cc // indirect
github.com/docker/cli v29.4.0+incompatible // indirect
github.com/docker/docker-credential-helpers v0.9.3 // indirect
github.com/fxamacker/cbor/v2 v2.9.0 // indirect
Expand All @@ -33,20 +53,20 @@ require (
github.com/modern-go/reflect2 v1.0.3-0.20250322232337-35a7c28c31ee // indirect
github.com/opencontainers/go-digest v1.0.0 // indirect
github.com/opencontainers/image-spec v1.1.1 // indirect
github.com/pmezard/go-difflib v1.0.0 // indirect
github.com/pmezard/go-difflib v1.0.1-0.20181226105442-5d4384ee4fb2 // indirect
github.com/sirupsen/logrus v1.9.4 // indirect
github.com/vbatts/tar-split v0.12.2 // indirect
github.com/x448/float16 v0.8.4 // indirect
go.yaml.in/yaml/v2 v2.4.3 // indirect
golang.org/x/net v0.48.0 // indirect
golang.org/x/net v0.49.0 // indirect
golang.org/x/sync v0.20.0 // indirect
golang.org/x/sys v0.43.0 // indirect
golang.org/x/text v0.35.0 // indirect
gopkg.in/inf.v0 v0.9.1 // indirect
gotest.tools/v3 v3.5.2 // indirect
k8s.io/klog/v2 v2.130.1 // indirect
k8s.io/kube-openapi v0.0.0-20250910181357-589584f1c912 // indirect
k8s.io/klog/v2 v2.140.0 // indirect
k8s.io/kube-openapi v0.0.0-20260317180543-43fb72c5454a // indirect
sigs.k8s.io/json v0.0.0-20250730193827-2d320260d730 // indirect
sigs.k8s.io/randfill v1.0.0 // indirect
sigs.k8s.io/structured-merge-diff/v6 v6.3.0 // indirect
sigs.k8s.io/structured-merge-diff/v6 v6.3.2 // indirect
)
Loading
Loading