-
Notifications
You must be signed in to change notification settings - Fork 16
Rosaeng 61804 #149
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
Rosaeng 61804 #149
Changes from all commits
ef30544
3beacdc
f4c941b
2396173
98d360c
3515edc
e5edf77
90a83ec
9a8402b
7a58723
6571da7
ad63162
c18bb83
8784ad8
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,111 @@ | ||
| 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"` | ||
|
Comment on lines
+41
to
+45
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. 🎯 Functional Correctness | 🟠 Major | ⚡ Quick win Use a feature gate that represents tags.
🤖 Prompt for AI Agents |
||
|
|
||
| // CloudUrl is the CloudFront URL for accessing the cluster console (auto-populated by server) | ||
| // +k8s:openapi-gen=true | ||
| // +hyperfleet:write-mode=service-set | ||
| CloudUrl string `json:"cloudUrl,omitempty"` | ||
|
|
||
| // Placement is the management cluster name (auto-populated if not provided) | ||
| // +hyperfleet:write-mode=mutable | ||
| Placement string `json:"placement,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 | ||
| HostedCluster *HostedClusterSpecPassthrough `json:"hostedCluster,omitempty"` | ||
| } | ||
|
|
||
| // 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"` | ||
| } | ||
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.
📐 Maintainability & Code Quality | 🟡 Minor | ⚡ Quick win
Preserve the documented raw passthrough output.
The recipe deletes
zz_generated.passthrough.gowithout creatingzz_generated.passthrough.go.raw, so the documented reference artifact is lost.Proposed fix
📝 Committable suggestion
🤖 Prompt for AI Agents