Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 3 additions & 0 deletions api/v1alpha1/public/clusterspec_types.go

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

5 changes: 4 additions & 1 deletion api/v1alpha1/public/clusterstatus_types.go

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

27 changes: 27 additions & 0 deletions api/v1alpha1/public/constants.go

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

49 changes: 49 additions & 0 deletions api/v1alpha1/public/controlplaneupgradepolicyspec_types.go

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

15 changes: 15 additions & 0 deletions api/v1alpha1/public/controlplaneupgradepolicystatus_types.go

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

66 changes: 66 additions & 0 deletions api/v1alpha1/public/openapi.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -2262,6 +2262,72 @@ components:
metadata.Name is the human-readable cluster name; metadata.Namespace is the cluster UUID.
The owning AWS account is stored as the label hyperfleet.io/account-id.
properties:
controlPlaneUpgradePolicy:
description: ControlPlaneUpgradePolicy is the control plane upgrade policy defined by the user.
properties:
nextRun:
description: NextRun is the time the upgrade should run for "manual" upgrade policies
format: date-time
type: string
schedule:
description: |-
Schedule defines a cron expression that calculates the next automatic upgrade scheduling.
The cron expression must follow the standard 5-field format:
┌───────────── minute (0 - 59)
│ ┌───────────── hour (0 - 23)
│ │ ┌───────────── day of month (1 - 31)
│ │ │ ┌───────────── month (1 - 12)
│ │ │ │ ┌───────────── day of week (0 - 6) (Sunday to Saturday)
│ │ │ │ │
* * * * *
maxLength: 256
pattern: ^(\*|([0-9]|1[0-9]|2[0-9]|3[0-9]|4[0-9]|5[0-9])|([0-9]|1[0-9]|2[0-9]|3[0-9]|4[0-9]|5[0-9])-([0-9]|1[0-9]|2[0-9]|3[0-9]|4[0-9]|5[0-9])|\*/([0-9]|1[0-9]|2[0-9]|3[0-9]|4[0-9]|5[0-9])|([0-9]|1[0-9]|2[0-9]|3[0-9]|4[0-9]|5[0-9])(,([0-9]|1[0-9]|2[0-9]|3[0-9]|4[0-9]|5[0-9]))*) (\*|([0-9]|1[0-9]|2[0-3])|([0-9]|1[0-9]|2[0-3])-([0-9]|1[0-9]|2[0-3])|\*/([0-9]|1[0-9]|2[0-3])|([0-9]|1[0-9]|2[0-3])(,([0-9]|1[0-9]|2[0-3]))*) (\*|([1-9]|1[0-9]|2[0-9]|3[0-1])|([1-9]|1[0-9]|2[0-9]|3[0-1])-([1-9]|1[0-9]|2[0-9]|3[0-1])|\*/([1-9]|1[0-9]|2[0-9]|3[0-1])|([1-9]|1[0-9]|2[0-9]|3[0-1])(,([1-9]|1[0-9]|2[0-9]|3[0-1]))*) (\*|([1-9]|1[0-2])|([1-9]|1[0-2])-([1-9]|1[0-2])|\*/([1-9]|1[0-2])|([1-9]|1[0-2])(,([1-9]|1[0-2]))*) (\*|[0-6]|[0-6]-[0-6]|\*/[0-6]|[0-6](,[0-6])*)$
type: string
scheduleType:
description: |-
ScheduleType indicates if the control plane upgrade policy is "manual" and it's executed only one time or
whether it is "automatic" where an expression will calculate recurrent upgrades.
enum:
- Manual
- Automatic
type: string
updateType:
description: |-
UpdateType indicates if it is a control plane upgrade policy defined by the user or
triggered by Red Hat for addressing critical CVEs.
enum:
- UserInitiated
- ServiceInitiated
type: string
upgradeScope:
description: |-
UpgradeScope indicates if minor version upgrades are allowed for automatic upgrades.
Manual upgrades always allow it.
enum:
- PatchOnly
- PatchAndMinor
type: string
version:
description: Version is the desired upgrade version on "manual" upgrade policies.
maxLength: 64
type: string
required:
- scheduleType
- updateType
type: object
x-kubernetes-validations:
- message: version and nextRun are required when scheduleType is Manual
rule: self.scheduleType != 'Manual' || (has(self.version) && has(self.nextRun))
- message: schedule must not be set when scheduleType is Manual
rule: self.scheduleType != 'Manual' || !has(self.schedule)
- message: schedule is required when scheduleType is Automatic
rule: self.scheduleType != 'Automatic' || has(self.schedule)
- message: version and nextRun must not be set when scheduleType is Automatic
rule: self.scheduleType != 'Automatic' || (!has(self.version) && !has(self.nextRun))
- message: upgradeScope must not be set when scheduleType is Manual
rule: self.scheduleType != 'Manual' || !has(self.upgradeScope)
- message: upgradeScope is required when scheduleType is Automatic
rule: self.scheduleType != 'Automatic' || has(self.upgradeScope)
Comment on lines +2265 to +2330

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.

🗄️ Data Integrity & Integration | 🟠 Major | ⚡ Quick win

Add the policy status to the OpenAPI response schema.

The CRD exposes status.controlPlaneUpgradePolicy.nextRun, but ClusterStatusInfo does not declare this field. OpenAPI-generated clients cannot model the new policy status. Add the matching status object to ClusterStatusInfo.

🤖 Prompt for 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.

In `@api/v1alpha1/public/openapi.yaml` around lines 2265 - 2330, Add a
controlPlaneUpgradePolicy status object to the ClusterStatusInfo schema,
including the nextRun date-time field exposed by the CRD. Match the CRD’s
property name, type, and format so OpenAPI-generated clients can represent the
policy status.

deleteProtection:
description: DeleteProtection prevents accidental deletion when enabled.
type: boolean
Expand Down
58 changes: 58 additions & 0 deletions api/v1alpha1/public/zz_generated.deepcopy.go

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Loading