Summary
The --subnet CLI flag in internal/cmd/cli/create/computeinstance/create_compute_instance_cmd.go intentionally writes to the deprecated protobuf field spec.Subnet for backward compatibility. This causes staticcheck to emit SA1019 at line 769, which can block lint gates.
Severity: Medium — lint gate breakage risk if SA1019 is enforced in CI.
Impact: CI pipelines running staticcheck or golangci-lint with SA1019 enabled will fail until a targeted suppression is added.
Background
Proposed fix
Add a targeted lint suppression directly above the assignment with a rationale comment, for example:
if c.args.subnet != "" {
//nolint:staticcheck // Intentionally retained for backward compatibility with deprecated --subnet flag.
spec.Subnet = new(c.args.subnet)
}
References
Summary
The
--subnetCLI flag ininternal/cmd/cli/create/computeinstance/create_compute_instance_cmd.gointentionally writes to the deprecated protobuf fieldspec.Subnetfor backward compatibility. This causesstaticcheckto emitSA1019at line 769, which can block lint gates.Severity: Medium — lint gate breakage risk if SA1019 is enforced in CI.
Impact: CI pipelines running
staticcheckorgolangci-lintwithSA1019enabled will fail until a targeted suppression is added.Background
--subnetflag is deprecated in favour of--network-attachment, but is intentionally retained for backward compatibility.new(expression)syntax from Go 1.26 fulfillment-service#610 (mechanicalgo fix -newexprrefactor) changedproto.String(c.args.subnet)→new(c.args.subnet)at line 769; the SA1019 concern is a pre-existing issue separate from that refactor and was deferred out of scope.new(expression)syntax from Go 1.26 fulfillment-service#610 (comment)Proposed fix
Add a targeted lint suppression directly above the assignment with a rationale comment, for example:
References
new(expression)syntax from Go 1.26 fulfillment-service#610