Skip to content
This repository was archived by the owner on Sep 9, 2026. It is now read-only.

OSAC-717: add is_windows field to ComputeInstanceSpec API - #734

Merged
openshift-merge-bot[bot] merged 1 commit into
osac-project:mainfrom
ygalblum:feat/compute-instance-is-windows
Jun 22, 2026
Merged

openshift-merge-bot[bot] merged 1 commit into
osac-project:mainfrom
ygalblum:feat/compute-instance-is-windows

Conversation

@ygalblum

@ygalblum ygalblum commented Jun 19, 2026 •

Copy link
Copy Markdown
Contributor

Add is_windows optional boolean proto field to ComputeInstanceSpec in both public and private APIs (field number 16). When true, the compute instance is configured for a Windows guest OS; when false or omitted, it defaults to Linux.

The reconciler maps this field to the CRD GuestOSFamily string field in addExplicitFields(), ensuring the CR always has an explicit value (windows or linux) for the AAP provisioning layer.

Changes:

  • Add optional bool is_windows = 16 to public and private proto schemas
  • Regenerate Go code with buf generate (HasIsWindows/GetIsWindows accessors)
  • Bump osac-operator/api dependency from v0.0.4 to v0.0.5
  • Implement is_windows to guestOSFamily mapping in reconciler
  • Add unit tests covering all three mapping scenarios (true/false/omitted)

Assisted-by: Claude Code noreply@anthropic.com

Summary by CodeRabbit

  • New Features
    • Added guest operating system configuration for compute instances. Users can now specify whether compute instances use Windows or Linux as the guest OS. This selection is immutable after provisioning.

@openshift-ci-robot

openshift-ci-robot commented Jun 19, 2026 •

Copy link
Copy Markdown

@ygalblum: This pull request references OSAC-717 which is a valid jira issue.

Warning: The referenced jira issue has an invalid target version for the target branch this PR targets: expected the story to target the "5.0.0" version, but no target version was set.

Details

In response to this:

Add is_windows optional boolean proto field to ComputeInstanceSpec in both public and private APIs (field number 16). When true, the compute instance is configured for a Windows guest OS; when false or omitted, it defaults to Linux.

The reconciler maps this field to the CRD GuestOSFamily string field in addExplicitFields(), ensuring the CR always has an explicit value (windows or linux) for the AAP provisioning layer.

Changes:

  • Add optional bool is_windows = 16 to public and private proto schemas
  • Regenerate Go code with buf generate (HasIsWindows/GetIsWindows accessors)
  • Bump osac-operator/api dependency from v0.0.4 to v0.0.5
  • Implement is_windows to guestOSFamily mapping in reconciler
  • Add unit tests covering all three mapping scenarios (true/false/omitted)

Assisted-by: Claude Code noreply@anthropic.com

Instructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the openshift-eng/jira-lifecycle-plugin repository.

@coderabbitai

coderabbitai Bot commented Jun 19, 2026 •

Copy link
Copy Markdown

Review Change Stack

No actionable comments were generated in the recent review. 🎉

ℹ️ Recent review info
⚙️ Run configuration

Configuration used: Repository: osac-project/coderabbit/.coderabbit.yaml

Review profile: ASSERTIVE

Plan: Enterprise

Run ID: 4f2bae20-b6b2-4d0e-a30f-e7e28d97dc84

📥 Commits

Reviewing files that changed from the base of the PR and between a70b337 and 2a14cf7.

⛔ Files ignored due to path filters (4)
  • internal/api/osac/private/v1/compute_instance_type.pb.go is excluded by !**/*.pb.go
  • internal/api/osac/private/v1/compute_instance_type_protoopaque.pb.go is excluded by !**/*.pb.go
  • internal/api/osac/public/v1/compute_instance_type.pb.go is excluded by !**/*.pb.go
  • internal/api/osac/public/v1/compute_instance_type_protoopaque.pb.go is excluded by !**/*.pb.go
📒 Files selected for processing (4)
  • internal/controllers/computeinstance/computeinstance_reconciler_function.go
  • internal/controllers/computeinstance/computeinstance_reconciler_function_test.go
  • proto/private/osac/private/v1/compute_instance_type.proto
  • proto/public/osac/public/v1/compute_instance_type.proto

Walkthrough

Adds an is_windows optional boolean field (tag 16) to ComputeInstanceSpec in both public and private proto definitions. The reconciler's addExplicitFields reads this field to set spec.GuestOSFamily to "windows" or "linux". Three new test cases verify all mapping paths.

Changes

is_windows Guest OS Field

Layer / File(s) Summary
Proto schema: is_windows field
proto/public/osac/public/v1/compute_instance_type.proto, proto/private/osac/private/v1/compute_instance_type.proto
Adds optional bool is_windows = 16 to ComputeInstanceSpec in both schemas; public proto includes immutability docs and JSON semantics.
Reconciler mapping and tests
internal/controllers/computeinstance/computeinstance_reconciler_function.go, internal/controllers/computeinstance/computeinstance_reconciler_function_test.go
addExplicitFields derives spec.GuestOSFamily from ciSpec.is_windows ("windows" if true, "linux" otherwise); three test cases cover true, false, and omitted values.

Estimated code review effort

🎯 2 (Simple) | ⏱️ ~10 minutes

Poem

A boolean flag, so small yet so grand,
is_windows arrives with a wave of its hand.
"linux" by default, or "windows" if true,
The guest OS family gets its clear cue.
Three tests stand guard at the mapping gate —
Correctness confirmed, ship it, it's great! 🪟🐧

🚥 Pre-merge checks | ✅ 11
✅ Passed checks (11 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed The title accurately summarizes the main change: adding an is_windows field to the ComputeInstanceSpec API, which is the core purpose of the PR.
Docstring Coverage ✅ Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check.
Linked Issues check ✅ Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check ✅ Passed Check skipped because no linked issues were found for this pull request.
No-Hardcoded-Secrets ✅ Passed No hardcoded secrets found. Changes only add boolean field mapping to strings ("windows"/"linux") and test fixtures using safe test data.
No-Weak-Crypto ✅ Passed PR contains no cryptographic operations: it adds a simple boolean field and maps it to a string with basic if-else logic. No weak crypto patterns, custom crypto, or secret comparisons detected.
No-Injection-Vectors ✅ Passed No injection vectors found. The is_windows mapping uses only hardcoded string literals ("windows"/"linux"), not user input. Proto field is a primitive boolean type. No SQL, shell, eval, pickle, YAM...
Container-Privileges ✅ Passed PR contains no container privilege escalation issues. No privileged: true, hostPID, hostNetwork, hostIPC, SYS_ADMIN, or allowPrivilegeEscalation: true found in Kubernetes manifests.
No-Sensitive-Data-In-Logs ✅ Passed No sensitive data exposure in logs. The PR adds an is_windows boolean field and maps it to GuestOSFamily in the reconciler with no logging statements. Existing logging only captures namespace,...
Ai-Attribution ✅ Passed AI tool (Claude from Anthropic) use is properly attributed with "Assisted-by" trailer in both PR description and commit message, following Red Hat policy correctly.

✏️ Tip: You can configure your own custom pre-merge checks in the settings.

✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands and usage tips.

@coderabbitai coderabbitai Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Actionable comments posted: 2

🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

Inline comments:
In
`@internal/controllers/computeinstance/computeinstance_reconciler_function_test.go`:
- Line 193: Replace the human-readable string fixture IDs with UUIDv7-formatted
IDs in the computeinstance_reconciler_function_test.go test file. Specifically,
update the assignments for variables like subnetID and any other
ComputeInstance/Subnet fixture ID strings (found at lines 193, 214, 238, 259,
283, and 303) to use valid UUIDv7-formatted strings instead of descriptive names
like "test-subnet". This ensures test fixtures follow the repository convention
for resource ID formatting.

In `@proto/public/osac/public/v1/compute_instance_type.proto`:
- Around line 173-179: In the JSON example within the documentation comment for
the compute instance type proto, the template field value is currently set to a
hardcoded string "123". Replace this with a valid UUIDv7-formatted string to
align with the repository's convention for resource IDs in proto documentation
examples and test fixtures. The change affects only the example value on the
line containing "template": "123".
🪄 Autofix (Beta)

Fix all unresolved CodeRabbit comments on this PR:

  • Push a commit to this branch (recommended)
  • Create a new PR with the fixes

ℹ️ Review info
⚙️ Run configuration

Configuration used: Repository: osac-project/coderabbit/.coderabbit.yaml

Review profile: ASSERTIVE

Plan: Enterprise

Run ID: cb73f0d2-2d7e-4c86-a5f0-a1e12ff486c3

📥 Commits

Reviewing files that changed from the base of the PR and between a553eee and a70b337.

⛔ Files ignored due to path filters (5)
  • go.sum is excluded by !**/*.sum
  • internal/api/osac/private/v1/compute_instance_type.pb.go is excluded by !**/*.pb.go
  • internal/api/osac/private/v1/compute_instance_type_protoopaque.pb.go is excluded by !**/*.pb.go
  • internal/api/osac/public/v1/compute_instance_type.pb.go is excluded by !**/*.pb.go
  • internal/api/osac/public/v1/compute_instance_type_protoopaque.pb.go is excluded by !**/*.pb.go
📒 Files selected for processing (5)
  • go.mod
  • internal/controllers/computeinstance/computeinstance_reconciler_function.go
  • internal/controllers/computeinstance/computeinstance_reconciler_function_test.go
  • proto/private/osac/private/v1/compute_instance_type.proto
  • proto/public/osac/public/v1/compute_instance_type.proto

Comment thread proto/public/osac/public/v1/compute_instance_type.proto
@rgolangh

Copy link
Copy Markdown
Contributor

/rebase

Add is_windows optional boolean proto field to ComputeInstanceSpec in
both public and private APIs (field number 16). When true, the compute
instance is configured for a Windows guest OS; when false or omitted, it
defaults to Linux.

The reconciler maps this field to the CRD GuestOSFamily string field
in addExplicitFields(), ensuring the CR always has an explicit value
(windows or linux) for the AAP provisioning layer.

Changes:
- Add optional bool is_windows = 16 to public and private proto schemas
- Regenerate Go code with buf generate (HasIsWindows/GetIsWindows accessors)
- Bump osac-operator/api dependency from v0.0.4 to v0.0.5
- Implement is_windows to guestOSFamily mapping in reconciler
- Add unit tests covering all three mapping scenarios (true/false/omitted)

Assisted-by: Claude Code <noreply@anthropic.com>
Signed-off-by: Ygal Blum <ygal.blum@gmail.com>
@ygalblum
ygalblum force-pushed the feat/compute-instance-is-windows branch from 106114a to 2a14cf7 Compare June 22, 2026 19:54

@oourfali oourfali left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Approved based on previous approval before rebase.

@openshift-ci

openshift-ci Bot commented Jun 22, 2026

Copy link
Copy Markdown

[APPROVALNOTIFIER] This PR is APPROVED

This pull-request has been approved by: jhernand, oourfali, ygalblum

The full list of commands accepted by this bot can be found here.

The pull request process is described here

Details Needs approval from an approver in each of these files:

Approvers can indicate their approval by writing /approve in a comment
Approvers can cancel approval by writing /approve cancel in a comment

@openshift-merge-bot
openshift-merge-bot Bot merged commit 82eca3f into osac-project:main Jun 22, 2026
14 checks passed
@ygalblum
ygalblum deleted the feat/compute-instance-is-windows branch June 22, 2026 21:57
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

5 participants