mirror of
https://github.com/projectcapsule/capsule.git
synced 2026-08-25 16:07:24 +00:00
Add tenant node status collection and node watchers
Agent-Logs-Url: https://github.com/projectcapsule/capsule/sessions/35d75f80-a2f5-4f3f-a0f8-db8fcf20edce Co-authored-by: oliverbaehler <26610571+oliverbaehler@users.noreply.github.com>
This commit is contained in:
co-authored by
oliverbaehler
parent
96d06c715b
commit
95e8a8c312
@@ -13,6 +13,8 @@ const (
|
||||
|
||||
// Returns the observed state of the Tenant.
|
||||
type TenantStatus struct {
|
||||
// List of nodes assigned to the Tenant.
|
||||
Nodes []string `json:"nodes,omitempty"`
|
||||
// +kubebuilder:default=Active
|
||||
// The operational state of the Tenant. Possible values are "Active", "Cordoned".
|
||||
State tenantState `json:"state"`
|
||||
|
||||
@@ -158,6 +158,7 @@ func (in *Tenant) ConvertFrom(raw conversion.Hub) error {
|
||||
in.SetAnnotations(annotations)
|
||||
|
||||
in.Status.Namespaces = src.Status.Namespaces
|
||||
in.Status.Nodes = src.Status.Nodes
|
||||
in.Status.Size = src.Status.Size
|
||||
|
||||
switch src.Status.State {
|
||||
@@ -280,6 +281,7 @@ func (in *Tenant) ConvertTo(raw conversion.Hub) error {
|
||||
|
||||
dst.Status.Size = in.Status.Size
|
||||
dst.Status.Namespaces = in.Status.Namespaces
|
||||
dst.Status.Nodes = in.Status.Nodes
|
||||
|
||||
switch in.Status.State {
|
||||
case TenantStateActive:
|
||||
|
||||
@@ -65,6 +65,9 @@ type TenantStatusNamespaceMetadata struct {
|
||||
}
|
||||
|
||||
type TenantAvailableStatus struct {
|
||||
// Available Nodes within Tenant
|
||||
// +optional
|
||||
Nodes []string `json:"nodes,omitempty"`
|
||||
// Available Class Types within Tenant
|
||||
// +optional
|
||||
Classes TenantAvailableClassesStatus `json:"classes,omitzero"`
|
||||
|
||||
Reference in New Issue
Block a user