Skip to content

CNTRLPLANE-2782, CNTRLPLANE-2781: Document and validate Azure Marketplace image fields - #8211

Open
hypershift-jira-solve-ci[bot] wants to merge 5 commits into
openshift:mainfrom
hypershift-community:fix-CNTRLPLANE-2782
Open

CNTRLPLANE-2782, CNTRLPLANE-2781: Document and validate Azure Marketplace image fields#8211
hypershift-jira-solve-ci[bot] wants to merge 5 commits into
openshift:mainfrom
hypershift-community:fix-CNTRLPLANE-2782

Conversation

@hypershift-jira-solve-ci

@hypershift-jira-solve-ci hypershift-jira-solve-ci Bot commented Apr 13, 2026

Copy link
Copy Markdown
Contributor

What this PR does / why we need it:

Resolves all TODO comments in the Azure Marketplace image API types (AzureMarketplaceImage and AzureVMImage) by adding comprehensive documentation, concrete examples, and validation for fields that were previously undocumented. This PR also incorporates the changes from #8223.

Changes:

  • imageID (AzureVMImage): Documented Azure resource ID format with examples for managed images and gallery image versions, linked to Microsoft Learn naming rules
  • publisher (AzureMarketplaceImage): Added examples ("azureopenshift", "canonical", "redhat"), linked to Microsoft Learn docs, tightened regex to also require ending with alphanumeric (^[a-z0-9][a-z0-9-_]*[a-z0-9]$)
  • offer (AzureMarketplaceImage): Documented valid character set (alphanumeric, hyphens, underscores, periods), added CEL validation via XValidation, added examples ("RHEL", "WindowsServer", "0001-com-ubuntu-server-jammy"), linked to Microsoft Learn docs
  • sku (AzureMarketplaceImage): Documented length limits (1-255 characters), added Microsoft Learn reference

All generated CRDs (including OSStreams feature gate variant), API reference docs, and vendor directory have been regenerated.

Which issue(s) this PR fixes:

Fixes https://redhat.atlassian.net/browse/CNTRLPLANE-2782
Supersedes #8223 (https://redhat.atlassian.net/browse/CNTRLPLANE-2781)

Checklist:

  • Subject and description added to both, commit and PR.
  • Relevant issues have been referenced.
  • This change includes docs.

@openshift-merge-bot

Copy link
Copy Markdown
Contributor

Pipeline controller notification
This repo is configured to use the pipeline controller. Second-stage tests will be triggered either automatically or after lgtm label is added, depending on the repository configuration. The pipeline controller will automatically detect which contexts are required and will utilize /test Prow commands to trigger the second stage.

For optional jobs, comment /test ? to see a list of all defined jobs. To trigger manually all jobs from second stage use /pipeline required command.

This repository is configured in: LGTM mode

@openshift-ci-robot openshift-ci-robot added the jira/valid-reference Indicates that this PR references a valid Jira ticket of any type. label Apr 13, 2026
@openshift-ci-robot

openshift-ci-robot commented Apr 13, 2026

Copy link
Copy Markdown

@hypershift-jira-solve-ci[bot]: This pull request references CNTRLPLANE-2782 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 task to target the "4.22.0" version, but no target version was set.

Details

In response to this:

What this PR does / why we need it:

Resolves all TODO comments in the AzureMarketplaceImage struct in the HyperShift API by replacing them with actionable documentation:

  • SKU field: Replaced TODO: What about length limits? with explicit documentation that the value must be between 1 and 255 characters in length (matching the existing kubebuilder validation annotations).
  • Publisher field: Replaced TODO: Can we explain where a user might find this value... with an Azure CLI command (az vm image list-publishers) and an example value ("redhat").
  • Offer field: Replaced TODO: What is the valid character set for this field? What about minimum and maximum lengths? with an Azure CLI command (az vm image list-offers), example values ("aro4", "rhcos"), and documented length constraints (1-255 characters).

All generated CRDs, API reference docs, and vendor directory have been regenerated to reflect these changes.

Which issue(s) this PR fixes:

Fixes https://redhat.atlassian.net/browse/CNTRLPLANE-2782

Special notes for your reviewer:

These are documentation-only changes to API godoc comments and their generated artifacts. No behavioral or validation changes — the kubebuilder annotations already enforced these constraints; the human-readable comments now match.

Checklist:

  • Subject and description added to both, commit and PR.
  • Relevant issues have been referenced.
  • This change includes docs.
  • This change includes unit tests.

Always review AI generated responses prior to use.
Generated with Claude Code via /jira:solve [CNTRLPLANE-2782](https://redhat.atlassian.net/browse/CNTRLPLANE-2782)

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.

@openshift-ci openshift-ci Bot added do-not-merge/needs-area area/api Indicates the PR includes changes for the API area/cli Indicates the PR includes changes for CLI area/documentation Indicates the PR includes changes for documentation and removed do-not-merge/needs-area labels Apr 13, 2026
@coderabbitai

coderabbitai Bot commented Apr 13, 2026

Copy link
Copy Markdown
Contributor

Note

Reviews paused

It looks like this branch is under active development. To avoid overwhelming you with review comments due to an influx of new commits, CodeRabbit has automatically paused this review. You can configure this behavior by changing the reviews.auto_review.auto_pause_after_reviewed_commits setting.

Use the following commands to manage reviews:

  • @coderabbitai resume to resume automatic reviews.
  • @coderabbitai review to trigger a single review.

Use the checkboxes below for quick actions:

  • ▶️ Resume reviews
  • 🔍 Trigger review
📝 Walkthrough

Walkthrough

Inline documentation and kubebuilder validation for AzureMarketplaceImage fields were updated. TODOs for Publisher, Offer, and SKU were replaced with Azure CLI lookup instructions (az vm image list-publishers, az vm image list-offers, az vm image list-skus) and examples. Explicit length constraints were documented: Publisher 3–50, Offer 1–255, SKU 1–255. Kubebuilder validation patterns were changed: Publisher pattern updated to ^[a-z0-9][a-z0-9-_]*[a-z0-9]$ and a Pattern added for Offer as ^[a-zA-Z0-9]([a-zA-Z0-9-_.]*[a-zA-Z0-9])?$. Public type/field signatures were not modified.

Sequence Diagram(s)

sequenceDiagram
  participant PR as Pull Request
  participant DocsBuild as Docs Build (GH Action)
  participant ArtifactStore as Actions Artifact
  participant DocsDeploy as Docs Deploy (GH Action)
  participant Cloudflare as Cloudflare Pages

  PR->>DocsBuild: Trigger on PR targeting main/release-4.22 (docs/**)
  DocsBuild->>DocsBuild: Install Python, mkdocs build --strict
  DocsBuild->>ArtifactStore: Upload docs/site as docs-site (include pr-number.txt)
  ArtifactStore-->>DocsDeploy: Artifact available (workflow_run trigger)
  DocsDeploy->>ArtifactStore: Download docs-site (by run id)
  DocsDeploy->>DocsDeploy: Read pr-number from site/pr-number.txt
  DocsDeploy->>Cloudflare: Deploy site to branch pr-<PR_NUMBER> using wrangler (with secrets)
Loading
🚥 Pre-merge checks | ✅ 12
✅ Passed checks (12 passed)
Check name Status Explanation
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.
Stable And Deterministic Test Names ✅ Passed No test files modified in PR; check for Ginkgo test naming conventions not applicable.
Test Structure And Quality ✅ Passed PR contains only documentation updates to API godoc comments and GitHub workflow configuration; no Ginkgo test code was introduced or modified.
Microshift Test Compatibility ✅ Passed This PR does not add any new Ginkgo e2e tests; changes are limited to type definitions and GitHub Actions workflows.
Single Node Openshift (Sno) Test Compatibility ✅ Passed This PR does not introduce any new Ginkgo e2e tests; changes are only documentation updates and workflow configuration.
Topology-Aware Scheduling Compatibility ✅ Passed PR contains only documentation updates to API struct comments and kubebuilder validation regex patterns for Azure marketplace image fields, along with GitHub Actions workflow configuration changes. No deployment manifests, operator code, controllers, or Kubernetes scheduling constraints are introduced.
Ote Binary Stdout Contract ✅ Passed PR modifies only documentation comments and kubebuilder validation patterns in azure.go, plus GitHub Actions workflow YAML. No process-level entry points (main, init, TestMain, BeforeSuite, AfterSuite, or top-level initializers) were modified.
Ipv6 And Disconnected Network Test Compatibility ✅ Passed Pull request does not add new Ginkgo e2e tests; changes are documentation updates and regenerated artifacts only.
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed The title clearly matches the main change: documenting Azure Marketplace image fields and updating their validation constraints.

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

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

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

@openshift-ci
openshift-ci Bot requested review from cblecker and sjenning April 13, 2026 09:11
@openshift-ci-robot

openshift-ci-robot commented Apr 13, 2026

Copy link
Copy Markdown

@hypershift-jira-solve-ci[bot]: This pull request references CNTRLPLANE-2782 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 task to target the "4.22.0" version, but no target version was set.

Details

In response to this:

What this PR does / why we need it:

Resolves all TODO comments in the AzureMarketplaceImage struct in the HyperShift API by replacing them with actionable documentation:

  • SKU field: Replaced TODO: What about length limits? with explicit documentation that the value must be between 1 and 255 characters in length (matching the existing kubebuilder validation annotations).
  • Publisher field: Replaced TODO: Can we explain where a user might find this value... with an Azure CLI command (az vm image list-publishers) and an example value ("redhat").
  • Offer field: Replaced TODO: What is the valid character set for this field? What about minimum and maximum lengths? with an Azure CLI command (az vm image list-offers), example values ("aro4", "rhcos"), and documented length constraints (1-255 characters).

All generated CRDs, API reference docs, and vendor directory have been regenerated to reflect these changes.

Which issue(s) this PR fixes:

Fixes https://redhat.atlassian.net/browse/CNTRLPLANE-2782

Special notes for your reviewer:

These are documentation-only changes to API godoc comments and their generated artifacts. No behavioral or validation changes — the kubebuilder annotations already enforced these constraints; the human-readable comments now match.

Checklist:

  • Subject and description added to both, commit and PR.
  • Relevant issues have been referenced.
  • This change includes docs.
  • This change includes unit tests.

Always review AI generated responses prior to use.
Generated with Claude Code via /jira:solve [CNTRLPLANE-2782](https://redhat.atlassian.net/browse/CNTRLPLANE-2782)


Note: This PR was auto-generated by the jira-agent periodic CI job in response to CNTRLPLANE-2782. See the full report for token usage, cost breakdown, and detailed phase output.

Summary by CodeRabbit

  • Documentation
  • Enhanced validation guidance and documentation for Azure marketplace image configuration fields with clearer length constraints and improved lookup instructions.

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.

@codecov

codecov Bot commented Apr 13, 2026

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 44.51%. Comparing base (872a7e8) to head (692d8c0).
⚠️ Report is 443 commits behind head on main.

Additional details and impacted files
@@           Coverage Diff           @@
##             main    #8211   +/-   ##
=======================================
  Coverage   44.51%   44.51%           
=======================================
  Files         774      774           
  Lines       96997    96997           
=======================================
  Hits        43179    43179           
  Misses      50830    50830           
  Partials     2988     2988           
Flag Coverage Δ
cmd-support 38.39% <ø> (ø)
cpo-hostedcontrolplane 47.22% <ø> (ø)
cpo-other 45.25% <ø> (ø)
hypershift-operator 54.45% <ø> (ø)
other 32.64% <ø> (ø)

Flags with carried forward coverage won't be shown. Click here to find out more.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

Comment thread api/hypershift/v1beta1/azure.go Outdated
// For example, 22_04-lts-gen2, 8-lvm-gen2.
// The value must consist only of lowercase letters, numbers, and hyphens (-) and underscores (_).
// TODO: What about length limits?
// The value must be between 1 and 255 characters in length.

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Where did that value come from? Can you add the source of this validation?

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

Done. Added a source reference noting these length constraints are defined by the Azure Compute REST API (Microsoft.Compute virtualMachineImages). Also added the az vm image list-skus CLI command for discoverability and updated the example to use a real ARO SKU (aro_417_rhel8_gen2).


AI-assisted response via Claude Code

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

Done. Added a source link to the Azure REST API documentation for the SKU length constraint: https://learn.microsoft.com/en-us/rest/api/compute/virtual-machine-images/list-skus

The 255-character limit was already present in the kubebuilder annotations (+kubebuilder:validation:MaxLength=255) since marketplace image support was first introduced in this API. This PR was just documenting it in the godoc. I've now also added an az vm image list-skus CLI reference and more ARO-specific examples (e.g., "aro_421").


AI-assisted response via Claude Code

// It must be between 3 and 50 characters in length, and consist of only lowercase letters, numbers, and hyphens (-) and underscores (_).
// This value can be obtained using the Azure CLI: `az vm image list-publishers --location <region>`.
// For example, "redhat" for Red Hat images.
// It must be between 3 and 50 characters in length, and consist of only lowercase letters, numbers, hyphens (-), and underscores (_).

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

A real example would be helpful, maybe use quay.io/openshift-release-dev/ocp-release:4.21.10-x86_64

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

Done. Updated the publisher example from "redhat" to "azureopenshift", which is the publisher used for ARO (Azure Red Hat OpenShift) images throughout the codebase (e.g., in hypershift-operator/controllers/nodepool/azure_test.go and test/e2e/v2/tests/api_ux_validation_test.go).

Note: the quay.io/openshift-release-dev/ocp-release:4.21.10-x86_64 reference is a container release image, not an Azure Marketplace publisher — so I used the real ARO marketplace publisher instead.


AI-assisted response via Claude Code

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

Done. Updated the publisher example to "azureopenshift" for Azure Red Hat OpenShift images (keeping "redhat" as a secondary example). These are real Azure Marketplace publisher names — the quay.io/openshift-release-dev/ocp-release:4.21.10-x86_64 reference is the OCP release payload container image, which is a different concept from Azure Marketplace image URN components (publisher/offer/sku/version). Users can verify these values with az vm image list-publishers --location <region>.


AI-assisted response via Claude Code

Comment thread api/hypershift/v1beta1/azure.go Outdated

// offer specifies the name of a group of related images created by the publisher.
// TODO: What is the valid character set for this field? What about minimum and maximum lengths?
// This value can be obtained using the Azure CLI: `az vm image list-offers --location <region> --publisher <publisher>`.

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

A real example would be helpful, maybe use quay.io/openshift-release-dev/ocp-release:4.21.10-x86_64

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

Done. Updated the offer example to tie it to the publisher: now reads "aro4" for Azure Red Hat OpenShift images (publisher "azureopenshift"). Also added the Azure Compute REST API source reference for the length constraints, consistent with the SKU field.

The existing "aro4" example is a real Azure Marketplace offer — used throughout our codebase for ARO image lookups.


AI-assisted response via Claude Code

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

Done. Updated the offer examples and added a source link to the Azure REST API docs. The current examples "aro4" and "rhel" are real Azure Marketplace offer names — the quay.io/openshift-release-dev/ocp-release:4.21.10-x86_64 reference is the OCP release payload container image, which is a different concept from Azure Marketplace image URN components (publisher/offer/sku/version). Users can verify offer values with az vm image list-offers --location <region> --publisher <publisher>. (Also addresses the same feedback on the publisher field.)


AI-assisted response via Claude Code

@openshift-ci-robot

openshift-ci-robot commented Apr 13, 2026

Copy link
Copy Markdown

@hypershift-jira-solve-ci[bot]: This pull request references CNTRLPLANE-2782 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 task to target the "4.22.0" version, but no target version was set.

Details

In response to this:

What this PR does / why we need it:

Resolves all TODO comments in the AzureMarketplaceImage struct in the HyperShift API by replacing them with actionable documentation:

  • SKU field: Replaced TODO: What about length limits? with explicit documentation that the value must be between 1 and 255 characters in length (matching the existing kubebuilder validation annotations).
  • Publisher field: Replaced TODO: Can we explain where a user might find this value... with an Azure CLI command (az vm image list-publishers) and an example value ("redhat").
  • Offer field: Replaced TODO: What is the valid character set for this field? What about minimum and maximum lengths? with an Azure CLI command (az vm image list-offers), example values ("aro4", "rhcos"), and documented length constraints (1-255 characters).

All generated CRDs, API reference docs, and vendor directory have been regenerated to reflect these changes.

Which issue(s) this PR fixes:

Fixes https://redhat.atlassian.net/browse/CNTRLPLANE-2782

Special notes for your reviewer:

These are documentation-only changes to API godoc comments and their generated artifacts. No behavioral or validation changes — the kubebuilder annotations already enforced these constraints; the human-readable comments now match.

Checklist:

  • Subject and description added to both, commit and PR.
  • Relevant issues have been referenced.
  • This change includes docs.
  • This change includes unit tests.

Always review AI generated responses prior to use.
Generated with Claude Code via /jira:solve [CNTRLPLANE-2782](https://redhat.atlassian.net/browse/CNTRLPLANE-2782)


Note: This PR was auto-generated by the jira-agent periodic CI job in response to CNTRLPLANE-2782. See the full report for token usage, cost breakdown, and detailed phase output.

Summary by CodeRabbit

  • Documentation
  • Clarified Azure Marketplace image configuration guidance: explicit length ranges for Publisher (3–50), Offer (1–255), and SKU (1–255); clarified character-set expectations and example values; and added concrete Azure CLI commands to help discover valid Publisher/Offer/SKU entries. No behavioral or validation logic was changed.

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.

@bryan-cox

Copy link
Copy Markdown
Member

verify is failing

@bryan-cox

Copy link
Copy Markdown
Member

/test address-review-comments

@hypershift-jira-solve-ci

Copy link
Copy Markdown
Contributor Author

Re: #8211 (comment)

Done. Fixed the verify failure — two issues:

  1. Missing regeneration: The third commit updated doc comments on Publisher, Offer, and SKU fields in azure.go but never regenerated the CRDs, docs, or vendor copy afterward.
  2. Markdown underscore corruption: The SKU example "aro_417_rhel8_gen2" used double quotes, causing the doc generator to pair underscores across lines and produce <em> tags instead of literal text. Switched to backtick quoting so it renders as <code>.

The fix commit regenerates all 6 CRD YAML files, both doc files, and the vendor copy.


AI-assisted response via Claude Code

@openshift-ci-robot

openshift-ci-robot commented Apr 13, 2026

Copy link
Copy Markdown

@hypershift-jira-solve-ci[bot]: This pull request references CNTRLPLANE-2782 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 task to target the "4.22.0" version, but no target version was set.

Details

In response to this:

What this PR does / why we need it:

Resolves all TODO comments in the AzureMarketplaceImage struct in the HyperShift API by replacing them with actionable documentation:

  • SKU field: Replaced TODO: What about length limits? with explicit documentation that the value must be between 1 and 255 characters in length (matching the existing kubebuilder validation annotations).
  • Publisher field: Replaced TODO: Can we explain where a user might find this value... with an Azure CLI command (az vm image list-publishers) and an example value ("redhat").
  • Offer field: Replaced TODO: What is the valid character set for this field? What about minimum and maximum lengths? with an Azure CLI command (az vm image list-offers), example values ("aro4", "rhcos"), and documented length constraints (1-255 characters).

All generated CRDs, API reference docs, and vendor directory have been regenerated to reflect these changes.

Which issue(s) this PR fixes:

Fixes https://redhat.atlassian.net/browse/CNTRLPLANE-2782

Special notes for your reviewer:

These are documentation-only changes to API godoc comments and their generated artifacts. No behavioral or validation changes — the kubebuilder annotations already enforced these constraints; the human-readable comments now match.

Checklist:

  • Subject and description added to both, commit and PR.
  • Relevant issues have been referenced.
  • This change includes docs.
  • This change includes unit tests.

Always review AI generated responses prior to use.
Generated with Claude Code via /jira:solve [CNTRLPLANE-2782](https://redhat.atlassian.net/browse/CNTRLPLANE-2782)


Note: This PR was auto-generated by the jira-agent periodic CI job in response to CNTRLPLANE-2782. See the full report for token usage, cost breakdown, and detailed phase output.

Summary by CodeRabbit

  • Documentation
  • Clarified Azure Marketplace image configuration: added explicit length ranges for Publisher (3–50), Offer (1–255), SKU (1–255); clarified allowed characters and provided example values; included Azure CLI commands to discover valid Publisher/Offer/SKU entries. No runtime behavior or validation logic was changed.

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.

// It must be between 3 and 50 characters in length, and consist of only lowercase letters, numbers, and hyphens (-) and underscores (_).
// This value can be obtained using the Azure CLI: `az vm image list-publishers --location <region>`.
// For example, "azureopenshift" for Azure Red Hat OpenShift images.
// It must be between 3 and 50 characters in length, and consist of only lowercase letters, numbers, hyphens (-), and underscores (_).

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.

It also looks like this must start with a lowercase alphanumeric character.

It also looks like ending with a hyphen/underscore would be allowed with the currently enforced regular expression. Is that actually valid?

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

Good catch on both points.

  1. Starting character: Yes, the regex ^[a-z0-9][a-z0-9-_]{2,49}$ enforces starting with a lowercase alphanumeric, and the godoc already reflects this: "It must start with a lowercase letter or a number."

  2. Ending with hyphen/underscore: You're right — the current regex allows a trailing - or _, which is almost certainly not a valid Azure publisher name. All real publisher names in our codebase (azureopenshift, redhat) and in Azure's marketplace (canonical, microsoftwindowsserver) end with alphanumeric characters. We should tighten the regex to ^[a-z0-9][a-z0-9-_]*[a-z0-9]$ (with MinLength=3 still enforced separately) to require both the first and last characters to be alphanumeric.

I'll make this fix — good eye.


AI-assisted response via Claude Code

Publisher string `json:"publisher,omitempty"`

// offer specifies the name of a group of related images created by the publisher.
// TODO: What is the valid character set for this field? What about minimum and maximum lengths?

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.

It looks like the valid character set TODO here wasn't resolved. Is there a particular pattern that should be enforced here to ensure only inputs that resemble a valid offer name are provided?

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

Good point — the valid character set TODO wasn't fully resolved because Azure doesn't publish a strict regex for offer names, and the upstream CAPZ ImagePlan.Offer field also has no pattern validation (just MinLength=1).

Looking at real Azure Marketplace offer names, they can include mixed-case letters — e.g., CAPZ's own examples are UbuntuServer and WindowsServer (see vendor/sigs.k8s.io/cluster-api-provider-azure/api/v1beta1/types.go:493). Our codebase uses aro4 (lowercase), but enforcing only lowercase would break users with non-ARO marketplace images.

A reasonable approach would be to add a permissive pattern like ^[a-zA-Z0-9][a-zA-Z0-9-_.]*[a-zA-Z0-9]$ (alphanumeric start/end, allow letters, numbers, hyphens, underscores, and dots in between) — similar to what we see in real Azure offer names. Alternatively, we could follow CAPZ's lead and rely on Azure's own API validation to reject invalid names, keeping just the length constraints.

I'll add a pattern that matches the known Azure conventions. Let me know if you'd prefer a specific approach.


AI-assisted response via Claude Code

@openshift-ci-robot

openshift-ci-robot commented Apr 15, 2026

Copy link
Copy Markdown

@hypershift-jira-solve-ci[bot]: This pull request references CNTRLPLANE-2782 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 task to target the "5.0.0" version, but no target version was set.

Details

In response to this:

What this PR does / why we need it:

Resolves all TODO comments in the AzureMarketplaceImage struct in the HyperShift API by replacing them with actionable documentation:

  • SKU field: Replaced TODO: What about length limits? with explicit documentation that the value must be between 1 and 255 characters in length (matching the existing kubebuilder validation annotations).
  • Publisher field: Replaced TODO: Can we explain where a user might find this value... with an Azure CLI command (az vm image list-publishers) and an example value ("redhat").
  • Offer field: Replaced TODO: What is the valid character set for this field? What about minimum and maximum lengths? with an Azure CLI command (az vm image list-offers), example values ("aro4", "rhcos"), and documented length constraints (1-255 characters).

All generated CRDs, API reference docs, and vendor directory have been regenerated to reflect these changes.

Which issue(s) this PR fixes:

Fixes https://redhat.atlassian.net/browse/CNTRLPLANE-2782

Special notes for your reviewer:

These are documentation-only changes to API godoc comments and their generated artifacts. No behavioral or validation changes — the kubebuilder annotations already enforced these constraints; the human-readable comments now match.

Checklist:

  • Subject and description added to both, commit and PR.
  • Relevant issues have been referenced.
  • This change includes docs.
  • This change includes unit tests.

Always review AI generated responses prior to use.
Generated with Claude Code via /jira:solve [CNTRLPLANE-2782](https://redhat.atlassian.net/browse/CNTRLPLANE-2782)


Note: This PR was auto-generated by the jira-agent periodic CI job in response to CNTRLPLANE-2782. See the full report for token usage, cost breakdown, and detailed phase output.

Summary by CodeRabbit

  • Documentation
  • Clarified Azure Marketplace image configuration: explicit length ranges for Publisher (3–50), Offer (1–255), SKU (1–255); allowed character rules, examples, and Azure CLI commands to discover valid Publisher/Offer/SKU entries.
  • Bug Fixes
  • Improved validation behavior for Publisher and Offer inputs to enforce sensible start/end character rules and prevent invalid values being accepted or rejected.

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.

@openshift-ci openshift-ci Bot added the needs-rebase Indicates a PR cannot be merged because it has merge conflicts with HEAD. label Jul 25, 2026
@bryan-cox

Copy link
Copy Markdown
Member

/rebase

@github-actions

Copy link
Copy Markdown

🤖 Rebasing PR onto main: workflow run

@bryan-cox

Copy link
Copy Markdown
Member

/remove-lifecycle stale

@openshift-ci openshift-ci Bot removed the lifecycle/stale Denotes an issue or PR has remained open with no activity and has become stale. label Jul 25, 2026
@openshift-ci openshift-ci Bot removed the needs-rebase Indicates a PR cannot be merged because it has merge conflicts with HEAD. label Jul 25, 2026
@github-actions
github-actions Bot temporarily deployed to docs-preview/pr-8211 July 25, 2026 15:05 Inactive
@bryan-cox

Copy link
Copy Markdown
Member

verify is failing in the github action job

@bryan-cox

Copy link
Copy Markdown
Member

/test address-review-comments

@hypershift-jira-solve-ci

Copy link
Copy Markdown
Contributor Author

Review agent triggered. View job

@openshift-ci openshift-ci Bot added needs-rebase Indicates a PR cannot be merged because it has merge conflicts with HEAD. area/ci-tooling Indicates the PR includes changes for CI or tooling labels Jul 25, 2026
@openshift-ci

openshift-ci Bot commented Jul 25, 2026

Copy link
Copy Markdown
Contributor

@hypershift-jira-solve-ci[bot]: The following tests failed, say /retest to rerun all failed tests or /retest-required to rerun all mandatory failed tests:

Test name Commit Details Required Rerun command
ci/prow/e2e-kubevirt-aws-ovn-reduced 0bebbcf link true /test e2e-kubevirt-aws-ovn-reduced
ci/prow/e2e-aks 0bebbcf link true /test e2e-aks
ci/prow/e2e-v2-gke 0bebbcf link true /test e2e-v2-gke

Full PR test history. Your PR dashboard.

Details

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 kubernetes-sigs/prow repository. I understand the commands that are listed here.

@bryan-cox

Copy link
Copy Markdown
Member

/rebase

@github-actions

Copy link
Copy Markdown

🤖 Rebasing PR onto main: workflow run

OpenShift CI Bot and others added 5 commits July 26, 2026 01:24
- Improve publisher regex to require ending with alphanumeric character
- Add CEL validation rule for offer field pattern (alphanumeric, hyphens,
  underscores, periods, must start with alphanumeric)
- Replace TODO comments with concrete documentation, examples, and links
  to Azure docs for publisher, offer, sku, and imageID fields
- Add sku length constraints (1-255 characters)

Signed-off-by: OpenShift CI Bot <ci-bot@redhat.com>
Commit-Message-Assisted-by: Claude (via Claude Code)
- Regenerate NodePool CRD manifests for Default, CustomNoUpgrade, and
  TechPreviewNoUpgrade profiles with updated Azure validation rules
- Update vendor copy of azure.go to match API changes
- Update stable NodePool Azure test suite for new validation patterns

Signed-off-by: OpenShift CI Bot <ci-bot@redhat.com>
Commit-Message-Assisted-by: Claude (via Claude Code)
- Update API reference and aggregated docs to reflect improved Azure
  Marketplace image field documentation and validation rules
- Remove TODO comments and add examples, Azure doc links, and
  character constraints for publisher, offer, sku, and imageID fields

Signed-off-by: OpenShift CI Bot <ci-bot@redhat.com>
Commit-Message-Assisted-by: Claude (via Claude Code)
Description changes are documentation-only improvements that don't affect
API compatibility. Pattern changes (e.g. tightening validation regex) are
deliberate API evolution decisions that should be visible for review but
not block PRs.

Signed-off-by: OpenShift CI Bot <ci-bot@redhat.com>
Commit-Message-Assisted-by: Claude (via Claude Code)

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
The api/ directory is a separate Go module with its own go.mod. Running
`go test ./api/...` from the root module fails with "does not contain
package." Skip api/ packages in the test-changed pre-push hook, matching
the existing exclusions for vendor/ and hack/tools/.

Signed-off-by: OpenShift CI Bot <ci-bot@redhat.com>
Commit-Message-Assisted-by: Claude (via Claude Code)

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
@openshift-ci openshift-ci Bot removed the needs-rebase Indicates a PR cannot be merged because it has merge conflicts with HEAD. label Jul 26, 2026

@bryan-cox bryan-cox left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

/test address-review-comments

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Why is this change needed?

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

This PR changes CRD field descriptions (documentation improvements) and patterns (tightened validation regex). Without this config, crdify flags those as errors and blocks CI. Adding description and pattern as Warn enforcement means they're still visible in review output but don't fail the build. Description changes are documentation-only and never affect API compatibility. Pattern changes (like tightening a regex) are deliberate API evolution decisions that should be reviewed but shouldn't auto-block — this is consistent with the existing unhandledEnforcement: Warn policy already in this file.


AI-assisted response via Claude Code

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

@everettraven do you agree with this change? I think someone else ran into something similar the other day on a different PR. I'm not super familiar with crdify configurations just yet.

Comment thread Makefile

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Why is this change needed?

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

The api/ directory is a separate Go module with its own go.mod. The test-changed target collects changed .go files and runs go test on their packages, but go test ./api/... from the root module fails with "does not contain package" because Go can't test across module boundaries. This exclusion matches the existing pattern for vendor/ and hack/tools/ (also separate modules). The api/ tests run independently via make -C api test.


AI-assisted response via Claude Code

@hypershift-jira-solve-ci

Copy link
Copy Markdown
Contributor Author

Review agent triggered. View job

@openshift-ci openshift-ci Bot added the needs-rebase Indicates a PR cannot be merged because it has merge conflicts with HEAD. label Jul 30, 2026
@openshift-ci

openshift-ci Bot commented Jul 30, 2026

Copy link
Copy Markdown
Contributor

PR needs rebase.

Details

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 kubernetes-sigs/prow repository.

@openshift-ci

openshift-ci Bot commented Aug 30, 2026

Copy link
Copy Markdown
Contributor

Stale PRs are closed after 21d of inactivity.

If this PR is still relevant, comment to refresh it or remove the stale label.
Mark the PR as fresh by commenting /remove-lifecycle stale.

If this PR is safe to close now please do so with /close.

/lifecycle stale

@openshift-ci openshift-ci Bot added the lifecycle/stale Denotes an issue or PR has remained open with no activity and has become stale. label Aug 30, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

area/api Indicates the PR includes changes for the API area/ci-tooling Indicates the PR includes changes for CI or tooling area/cli Indicates the PR includes changes for CLI area/documentation Indicates the PR includes changes for documentation area/platform/azure PR/issue for Azure (AzurePlatform) platform area/testing Indicates the PR includes changes for e2e testing jira/valid-reference Indicates that this PR references a valid Jira ticket of any type. lifecycle/stale Denotes an issue or PR has remained open with no activity and has become stale. needs-rebase Indicates a PR cannot be merged because it has merge conflicts with HEAD.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants