-
Notifications
You must be signed in to change notification settings - Fork 41
interface: add status object for managed namespace placement #1164
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
Changes from all commits
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 |
|---|---|---|
|
|
@@ -1495,6 +1495,40 @@ func (rpl *ResourcePlacementList) GetPlacementObjs() []PlacementObj { | |
| return objs | ||
| } | ||
|
|
||
| // +genclient | ||
| // +genclient:Namespaced | ||
| // +kubebuilder:object:root=true | ||
| // +kubebuilder:resource:scope="Namespaced" | ||
| // +kubebuilder:subresource:status | ||
| // +kubebuilder:storageversion | ||
| // +k8s:deepcopy-gen:interfaces=k8s.io/apimachinery/pkg/runtime.Object | ||
|
|
||
| // ManagedNamespacePlacement is used to represent which clusters the namespace has been placed on to. | ||
| type ManagedNamespacePlacement struct { | ||
|
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. Why do you use managednamespace as a prefix? Should this object exist for namespaces placed by a CRP?
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. How do you know which CRP this status is for? Can one namespace selected/placed by N CRPs?
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. If this object won't exist when there are N CRPs, provide a comment. |
||
| metav1.TypeMeta `json:",inline"` | ||
| metav1.ObjectMeta `json:"metadata,omitempty"` | ||
|
|
||
| // The observed status of the ManagedNamespacePlacement. | ||
| // +kubebuilder:validation:Optional | ||
| Status ManagedNamespacePlacementStatus `json:"status,omitempty"` | ||
| } | ||
|
|
||
| // ManagedNamespacePlacementStatus represents the status of a ManagedNamespacePlacement. | ||
| type ManagedNamespacePlacementStatus struct { | ||
| // ResourcePlacements contains the placement statuses for the namespace. | ||
| // +kubebuilder:validation:Optional | ||
| ResourcePlacements []ResourcePlacementStatus `json:"resourcePlacements,omitempty"` | ||
|
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. What does the status represent? Only the status of the namespace or namespace+resources as selected by the CRP?
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. I assume this is a copy of the ResourcePlacementStatus list from CRP. If so, I would recommend to copy the whole status as SelectedResources and ObservedResourceIndex are also critical information to understand the conditions. |
||
| } | ||
|
|
||
| // ManagedNamespacePlacementList contains a list of ManagedNamespacePlacement. | ||
| // +kubebuilder:resource:scope="Namespaced" | ||
| // +k8s:deepcopy-gen:interfaces=k8s.io/apimachinery/pkg/runtime.Object | ||
| type ManagedNamespacePlacementList struct { | ||
| metav1.TypeMeta `json:",inline"` | ||
| metav1.ListMeta `json:"metadata,omitempty"` | ||
| Items []ManagedNamespacePlacement `json:"items"` | ||
| } | ||
|
|
||
| func init() { | ||
| SchemeBuilder.Register(&ClusterResourcePlacement{}, &ClusterResourcePlacementList{}, &ResourcePlacement{}, &ResourcePlacementList{}) | ||
| SchemeBuilder.Register(&ClusterResourcePlacement{}, &ClusterResourcePlacementList{}, &ResourcePlacement{}, &ResourcePlacementList{}, &ManagedNamespacePlacement{}, &ManagedNamespacePlacementList{}) | ||
| } | ||
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Uh oh!
There was an error while loading. Please reload this page.