Skip to content
Open
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
2 changes: 1 addition & 1 deletion .github/workflows/golangci-lint.yml
Original file line number Diff line number Diff line change
Expand Up @@ -33,6 +33,6 @@ jobs:
- name: golangci-lint-${{matrix.working-directory}}
uses: golangci/golangci-lint-action@1e7e51e771db61008b38414a730f564565cf7c20 # v9.2.0
with:
version: v2.6.2
version: v2.10.1
working-directory: ${{matrix.working-directory}}
args: --timeout=10m
2 changes: 1 addition & 1 deletion .golangci.yaml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
version: "2"
run:
go: "1.24"
go: "1.25"
linters:
default: none
enable:
Expand Down
2 changes: 1 addition & 1 deletion Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -231,7 +231,7 @@ GOLANGCI_LINT ?= $(LOCALBIN)/golangci-lint
## Tool Versions
KUSTOMIZE_VERSION ?= v5.4.2
CONTROLLER_TOOLS_VERSION ?= v0.17.0
GOLANGCI_LINT_VERSION ?= v2.6.2
GOLANGCI_LINT_VERSION ?= v2.10.1

KUSTOMIZE_INSTALL_SCRIPT ?= "https://raw.githubusercontent.com/kubernetes-sigs/kustomize/master/hack/install_kustomize.sh"
.PHONY: kustomize
Expand Down
2 changes: 1 addition & 1 deletion api/go.mod
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
module github.com/metal3-io/ironic-standalone-operator/api

go 1.24.0
go 1.25.0

require (
github.com/stretchr/testify v1.11.1
Expand Down
8 changes: 4 additions & 4 deletions cmd/run-local-ironic/main.go
Original file line number Diff line number Diff line change
Expand Up @@ -106,7 +106,7 @@ func runLocalIronic(inputFile, outputFile string, versionInfo ironic.VersionInfo
}

outputDir := filepath.Dir(outputFile)
if err = os.MkdirAll(outputDir, 0o755); err != nil {
if err = os.MkdirAll(outputDir, 0o755); err != nil { //nolint:gosec // outputDir is derived from a controlled output file path, not user input
return fmt.Errorf("failed to create output directory: %w", err)
}

Expand Down Expand Up @@ -144,7 +144,7 @@ func runLocalIronic(inputFile, outputFile string, versionInfo ironic.VersionInfo
}

func writeManifestsToYAML(manifests []runtime.Object, filename string, scheme *runtime.Scheme) error {
file, err := os.Create(filename)
file, err := os.Create(filename) //nolint:gosec // filename is a controlled output path, not user input
if err != nil {
return err
}
Expand Down Expand Up @@ -184,9 +184,9 @@ func writeManifestsToYAML(manifests []runtime.Object, filename string, scheme *r
func runPodmanKubePlay(manifestFile string, tearDown bool) error {
var cmd *exec.Cmd
if tearDown {
cmd = exec.CommandContext(context.TODO(), "podman", "kube", "play", "--down", manifestFile)
cmd = exec.CommandContext(context.TODO(), "podman", "kube", "play", "--down", manifestFile) //nolint:gosec // manifestFile is a controlled output path, not user input
} else {
cmd = exec.CommandContext(context.TODO(), "podman", "kube", "play", "--network=host", manifestFile)
cmd = exec.CommandContext(context.TODO(), "podman", "kube", "play", "--network=host", manifestFile) //nolint:gosec // manifestFile is a controlled output path, not user input
}
cmd.Stdout = os.Stdout
cmd.Stderr = os.Stderr
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/metal3-io/ironic-standalone-operator

go 1.24.0
go 1.25.0

require (
github.com/go-logr/logr v1.4.3
Expand Down
2 changes: 1 addition & 1 deletion hack/ensure-go.sh
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@ EOF
local go_version
IFS=" " read -ra go_version <<< "$(go version)"
local minimum_go_version
minimum_go_version=go1.24
minimum_go_version=go1.25
if [[ "${minimum_go_version}" != $(echo -e "${minimum_go_version}\n${go_version[2]}" | sort -s -t. -k 1,1 -k 2,2n -k 3,3n | head -n1) ]] && [[ "${go_version[2]}" != "devel" ]]; then
cat << EOF
Detected go version: ${go_version[*]}.
Expand Down
2 changes: 1 addition & 1 deletion hack/gomod.sh
Original file line number Diff line number Diff line change
Expand Up @@ -39,6 +39,6 @@ else
--volume "${PWD}:/workdir:ro,z" \
--entrypoint sh \
--workdir /workdir \
docker.io/golang:1.24 \
docker.io/golang:1.25 \
/workdir/hack/gomod.sh "$@"
fi
4 changes: 2 additions & 2 deletions pkg/ironic/secrets_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -57,7 +57,7 @@ func TestGenerateHtpasswd(t *testing.T) {
Scenario string

User string
Password string
Password string //nolint:gosec // test struct field, not a real secret
}{
{
User: "admin",
Expand Down Expand Up @@ -86,7 +86,7 @@ func TestSecretNeedsUpdating(t *testing.T) {
Scenario string

User string
Password string
Password string //nolint:gosec // test struct field, not a real secret
CurrentHtpasswd string

ExpectedChanged bool
Expand Down
2 changes: 1 addition & 1 deletion test/go.mod
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
module github.com/metal3-io/ironic-standalone-operator/test

go 1.24.2
go 1.25.0

require (
github.com/gophercloud/gophercloud/v2 v2.10.0
Expand Down
6 changes: 3 additions & 3 deletions test/helpers/clients.go
Original file line number Diff line number Diff line change
Expand Up @@ -23,9 +23,9 @@ var (

func LoadIronicCert() {
var err error
ironicCertPEM, err = os.ReadFile(os.Getenv("IRONIC_CERT_FILE"))
ironicCertPEM, err = os.ReadFile(os.Getenv("IRONIC_CERT_FILE")) //nolint:gosec // path comes from trusted test environment variable
Expect(err).NotTo(HaveOccurred())
ironicKeyPEM, err = os.ReadFile(os.Getenv("IRONIC_KEY_FILE"))
ironicKeyPEM, err = os.ReadFile(os.Getenv("IRONIC_KEY_FILE")) //nolint:gosec // path comes from trusted test environment variable
Expect(err).NotTo(HaveOccurred())
}

Expand All @@ -50,7 +50,7 @@ func GetStatusCode(ctx context.Context, httpClient *http.Client, url string) int
req, err := http.NewRequestWithContext(ctx, http.MethodHead, url, http.NoBody)
Expect(err).NotTo(HaveOccurred())

resp, err := httpClient.Do(req)
resp, err := httpClient.Do(req) //nolint:gosec // URL is controlled by test infrastructure
Expect(err).NotTo(HaveOccurred())
defer resp.Body.Close()

Expand Down
14 changes: 7 additions & 7 deletions test/suite_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -303,13 +303,13 @@ func WaitForIronicFailure(name types.NamespacedName, message string, tolerateRea

func writeYAML(obj interface{}, namespace, name, typ string) {
fileDir := fmt.Sprintf("%s/%s", os.Getenv("LOGDIR"), namespace)
err := os.MkdirAll(fileDir, 0o755)
err := os.MkdirAll(fileDir, 0o755) //nolint:gosec // path derived from trusted LOGDIR env var
Expect(err).NotTo(HaveOccurred())

fileName := fmt.Sprintf("%s/%s_%s.yaml", fileDir, typ, name)
yamlData, err := yaml.Marshal(obj)
Expect(err).NotTo(HaveOccurred())
err = os.WriteFile(fileName, yamlData, 0o600)
err = os.WriteFile(fileName, yamlData, 0o600) //nolint:gosec // path derived from trusted LOGDIR env var
Expect(err).NotTo(HaveOccurred())
}

Expand Down Expand Up @@ -596,7 +596,7 @@ func writeContainerLogs(pod *corev1.Pod, containerName, logDir string) {
defer podLogs.Close()

targetFileName := fmt.Sprintf("%s/%s.log", logDir, containerName)
logFile, err := os.Create(targetFileName)
logFile, err := os.Create(targetFileName) //nolint:gosec // path derived from trusted LOGDIR env var
Expect(err).NotTo(HaveOccurred())
defer logFile.Close()

Expand Down Expand Up @@ -638,7 +638,7 @@ func CollectLogs(namespace string) {

for _, pod := range pods.Items {
logDir := fmt.Sprintf("%s/%s/pod_%s", os.Getenv("LOGDIR"), namespace, pod.Name)
err = os.MkdirAll(logDir, 0o755)
err = os.MkdirAll(logDir, 0o755) //nolint:gosec // path derived from trusted LOGDIR env var
Expect(err).NotTo(HaveOccurred())

writeYAML(&pod, namespace, pod.Name, "pod")
Expand All @@ -656,7 +656,7 @@ func CollectLogs(namespace string) {

for _, rset := range rsets.Items {
logDir := fmt.Sprintf("%s/%s/replicaset_%s", os.Getenv("LOGDIR"), namespace, rset.Name)
err = os.MkdirAll(logDir, 0o755)
err = os.MkdirAll(logDir, 0o755) //nolint:gosec // path derived from trusted LOGDIR env var
Expect(err).NotTo(HaveOccurred())

writeYAML(&rset, namespace, rset.Name, "replicaset")
Expand All @@ -667,7 +667,7 @@ func CollectLogs(namespace string) {

for _, job := range jobs.Items {
logDir := fmt.Sprintf("%s/%s/job_%s", os.Getenv("LOGDIR"), namespace, job.Name)
err = os.MkdirAll(logDir, 0o755)
err = os.MkdirAll(logDir, 0o755) //nolint:gosec // path derived from trusted LOGDIR env var
Expect(err).NotTo(HaveOccurred())

writeYAML(&job, namespace, job.Name, "job")
Expand Down Expand Up @@ -713,7 +713,7 @@ func saveEvents(namespace string) {
Expect(err).NotTo(HaveOccurred())

targetFileName := fmt.Sprintf("%s/%s/events.yaml", os.Getenv("LOGDIR"), namespace)
logFile, err := os.Create(targetFileName)
logFile, err := os.Create(targetFileName) //nolint:gosec // path derived from trusted LOGDIR env var
Expect(err).NotTo(HaveOccurred())
defer logFile.Close()

Expand Down
Loading