Skip to content

Add SA1019 suppression for intentionally retained deprecated spec.Subnet field #22

Description

@coderabbitai

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

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

Labels

No labels
No labels

Type

No type

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions