Skip to content

Linter error resolution#1532

Draft
roopakparikh wants to merge 2 commits intomainfrom
cursor/linter-error-resolution-777a
Draft

Linter error resolution#1532
roopakparikh wants to merge 2 commits intomainfrom
cursor/linter-error-resolution-777a

Conversation

@roopakparikh
Copy link
Contributor

What this PR does / why we need it

This PR resolves goconst linter warnings by introducing constants for script OS types (ScriptOSTypeWindows, ScriptOSTypeLinux, ScriptOSTypeUnknown).

Additionally, it integrates script OS compatibility detection and validation logic. This ensures firstboot scripts are compatible with the target VM's OS, replacing incompatible ones with safe no-op scripts and adding relevant logging.

Which issue(s) this PR fixes

(optional, in fixes #<issue number>(, fixes #<issue_number>, ...) format, will close the issue(s) when PR gets merged)

fixes #

Special notes for your reviewer

The core changes, including the introduction of constants and the script OS compatibility logic, were cherry-picked from PR #1529 "Script OS compatibility" to address the reported linter errors and enhance script handling.

Testing done

please add testing details (logs, screenshots, etc.)

  • Linter: 0 issues reported.
  • Unit tests for script OS detection: All passing.

Open in Cursor Open in Web

cursoragent and others added 2 commits February 19, 2026 08:53
- Add script OS type detection based on shebang, syntax, and commands
- Modify CreateFirstbootConfigMap to filter scripts by VM OS compatibility
- Prevent Windows scripts from running on Linux VMs and vice versa
- Add comprehensive unit tests for script detection logic
- Log warnings when incompatible scripts are skipped

This ensures Windows-specific scripts (e.g., .bat files) only run on
Windows VMs and Linux scripts only run on Linux VMs, preventing
migration failures when mixed VM types are selected.

Co-authored-by: Roopak Parikh <roopakparikh@users.noreply.github.com>
- Define ScriptOSTypeWindows, ScriptOSTypeLinux, ScriptOSTypeUnknown
- Replace hardcoded strings with constants throughout codebase
- Update tests to use constants
- Addresses goconst linter warnings

Co-authored-by: Roopak Parikh <roopakparikh@users.noreply.github.com>
@cursor
Copy link

cursor bot commented Feb 19, 2026

Cursor Agent can help with this pull request. Just @cursor in comments and I'll start working on changes in this branch.
Learn more about Cursor Agents

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

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants