-
Notifications
You must be signed in to change notification settings - Fork 17
Rosaeng 61805 #148
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Closed
Closed
Rosaeng 61805 #148
Changes from all commits
Commits
Show all changes
6 commits
Select commit
Hold shift + click to select a range
ef30544
ROSAENG-61801: Add codegen field validation for cluster and nodepool …
cdoan1 3beacdc
ROSAENG-61801: Internalize codegen runtime and add API types (Option C)
cdoan1 f4c941b
ROSAENG-61801: Replace hardcoded service-set injection with conversio…
cdoan1 2396173
ROSAENG-61805: Align OpenAPI spec with codegen-generated schemas (Pha…
cdoan1 98d360c
ROSAENG-61805: Add swagger-ui-serve and swagger-ui-open Makefile targets
cdoan1 3515edc
ROSAENG-61805: Add --keep-markers flag, standalone ClusterSpec schema…
cdoan1 File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,103 @@ | ||
| package v2alpha1 | ||
|
|
||
| import ( | ||
| metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" | ||
| ) | ||
|
|
||
| // Cluster represents a HyperFleet managed OpenShift cluster | ||
| // +kubebuilder:object:root=true | ||
| // +kubebuilder:subresource:status | ||
| // +kubebuilder:resource:scope=Namespaced | ||
| type Cluster struct { | ||
| metav1.TypeMeta `json:",inline"` | ||
| metav1.ObjectMeta `json:"metadata,omitempty"` | ||
|
|
||
| Spec ClusterSpec `json:"spec"` | ||
| Status ClusterStatus `json:"status,omitempty"` | ||
| } | ||
|
|
||
| // ClusterSpec defines the desired state of a Cluster | ||
| type ClusterSpec struct { | ||
| // === HyperFleet Envelope Fields === | ||
| // These are HyperFleet-specific fields that wrap the HyperShift cluster | ||
|
|
||
| // DisplayName is a human-readable name for the cluster | ||
| // +hyperfleet:write-mode=mutable | ||
| // +kubebuilder:validation:MaxLength=256 | ||
| DisplayName string `json:"displayName,omitempty"` | ||
|
|
||
| // DeleteProtection prevents accidental deletion when enabled | ||
| // +hyperfleet:write-mode=mutable | ||
| DeleteProtection *bool `json:"deleteProtection,omitempty"` | ||
|
|
||
| // ExpirationTimestamp marks when this cluster should be automatically deleted | ||
| // +hyperfleet:write-mode=mutable | ||
| ExpirationTimestamp *metav1.Time `json:"expirationTimestamp,omitempty"` | ||
|
|
||
| // Properties are arbitrary key-value pairs for customer metadata | ||
| // +hyperfleet:write-mode=mutable | ||
| Properties map[string]string `json:"properties,omitempty"` | ||
|
|
||
| // Tags are customer-defined labels for organizational purposes | ||
| // This is a TechPreview feature | ||
| // +hyperfleet:write-mode=mutable | ||
| // +openshift:enable:FeatureGate=HyperFleetAutoScaling | ||
| Tags map[string]string `json:"tags,omitempty"` | ||
|
|
||
| // AccountID identifies the customer account (platform-managed, hidden from API) | ||
| // +k8s:openapi-gen=false | ||
| // +hyperfleet:write-mode=service-set | ||
| AccountID string `json:"accountId,omitempty"` | ||
|
|
||
| // CreatorARN is the AWS ARN of the user who created this cluster (platform-managed, hidden) | ||
| // +k8s:openapi-gen=false | ||
| // +hyperfleet:write-mode=service-set | ||
| CreatorARN string `json:"creatorARN,omitempty"` | ||
|
|
||
| // InternalID is an internal platform identifier (platform-managed, hidden) | ||
| // +k8s:openapi-gen=false | ||
| // +hyperfleet:write-mode=service-set | ||
| InternalID string `json:"internalId,omitempty"` | ||
|
|
||
| // === HyperShift Passthrough === | ||
| // This embeds all upstream HyperShift HostedCluster fields | ||
|
|
||
| // HostedCluster contains the full HyperShift HostedCluster configuration | ||
| // All fields are generated from upstream and have safe defaults (hidden + service-set) | ||
| // until explicitly reviewed and exposed | ||
| // +kubebuilder:validation:Required | ||
| HostedCluster HostedClusterSpecPassthrough `json:"hostedCluster"` | ||
| } | ||
|
|
||
| // ClusterStatus defines the observed state of a Cluster | ||
| type ClusterStatus struct { | ||
| // State represents the high-level cluster state | ||
| // +kubebuilder:validation:Enum=pending;provisioning;ready;degraded;deleting;failed | ||
| State string `json:"state,omitempty"` | ||
|
|
||
| // Conditions represent detailed cluster status | ||
| Conditions []metav1.Condition `json:"conditions,omitempty"` | ||
|
|
||
| // Version is the observed OpenShift version | ||
| Version string `json:"version,omitempty"` | ||
|
|
||
| // APIEndpoint is the cluster API server endpoint | ||
| APIEndpoint string `json:"apiEndpoint,omitempty"` | ||
|
|
||
| // ConsoleURL is the web console URL | ||
| ConsoleURL string `json:"consoleUrl,omitempty"` | ||
|
|
||
| // ProvisionStartTime is when provisioning began | ||
| ProvisionStartTime *metav1.Time `json:"provisionStartTime,omitempty"` | ||
|
|
||
| // ReadyTime is when the cluster became ready | ||
| ReadyTime *metav1.Time `json:"readyTime,omitempty"` | ||
| } | ||
|
|
||
| // ClusterList contains a list of Clusters | ||
| // +kubebuilder:object:root=true | ||
| type ClusterList struct { | ||
| metav1.TypeMeta `json:",inline"` | ||
| metav1.ListMeta `json:"metadata,omitempty"` | ||
| Items []Cluster `json:"items"` | ||
| } |
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
🔒 Security & Privacy | 🟠 Major | ⚡ Quick win
🧩 Analysis chain
🏁 Script executed:
Repository: openshift-online/rosa-hyperfleet-api
Length of output: 238
🏁 Script executed:
Repository: openshift-online/rosa-hyperfleet-api
Length of output: 363
🏁 Script executed:
Repository: openshift-online/rosa-hyperfleet-api
Length of output: 1194
Bind the Swagger server to loopback and serve only
openapi/.python3 -m http.server 8080 --directory .exposes the whole repository on all interfaces; switch to--bind 127.0.0.1 --directory openapiand update the URLs to/swagger-ui/and/openapi.yaml.🤖 Prompt for AI Agents