Skip to content

Commit

Permalink
Update ClusterInfoStatus api
Browse files Browse the repository at this point in the history
Signed-off-by: Tamal Saha <tamal@appscode.com>
  • Loading branch information
tamalsaha committed Oct 9, 2023
1 parent 12d58f8 commit 4b4bcb4
Show file tree
Hide file tree
Showing 5 changed files with 22 additions and 8 deletions.
12 changes: 12 additions & 0 deletions crds/cluster.bytebuilders.dev_clusterinfos.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -109,10 +109,22 @@ spec:
type: string
phase:
description: Phase represents current status of the cluster
enum:
- Active
- Inactive
- NotReady
- NotConnected
- Registered
- NotImported
type: string
reason:
description: Reason explains the reason behind the cluster current
phase
enum:
- Unknown
- ClusterNotFound
- AuthIssue
- MissingComponent
type: string
type: object
type: object
Expand Down
2 changes: 1 addition & 1 deletion go.mod
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ require (
k8s.io/klog/v2 v2.80.1
kmodules.xyz/client-go v0.25.38
kmodules.xyz/crd-schema-fuzz v0.25.0
kmodules.xyz/resource-metadata v0.17.26-0.20231009075914-70d9638b6217
kmodules.xyz/resource-metadata v0.17.26-0.20231009112556-f90c55e7954d
sigs.k8s.io/yaml v1.3.0
)

Expand Down
4 changes: 2 additions & 2 deletions go.sum
Original file line number Diff line number Diff line change
Expand Up @@ -707,8 +707,8 @@ kmodules.xyz/crd-schema-fuzz v0.25.0 h1:c5ZxNRqJak1bkGhECmyrKpzKGThFMB4088Kynyvn
kmodules.xyz/crd-schema-fuzz v0.25.0/go.mod h1:VigFz19GwCxMGhb3YjCtlSXmfXb0J/g9du1So6rvqsk=
kmodules.xyz/offshoot-api v0.25.0 h1:Svq9da/+sg5afOjpgo9vx2J/Lu90Mo0aFxkdQmgKnGI=
kmodules.xyz/offshoot-api v0.25.0/go.mod h1:ysEBn7LJuT3+s8ynAQA/OG0BSsJugXa6KGtDLMRjlKo=
kmodules.xyz/resource-metadata v0.17.26-0.20231009075914-70d9638b6217 h1:CFfhJCxurqlOaBlmzRWZAeCYQ6sOihDmIaSx0FWNcLg=
kmodules.xyz/resource-metadata v0.17.26-0.20231009075914-70d9638b6217/go.mod h1:tyLxzAVkhlL3/jFdcQcX1RZ8i8h9bs+AJur5RcuaW40=
kmodules.xyz/resource-metadata v0.17.26-0.20231009112556-f90c55e7954d h1:E0SkGh/coySTCdes4ZLw9kBT+RaVMjNhzm6mycxhK7g=
kmodules.xyz/resource-metadata v0.17.26-0.20231009112556-f90c55e7954d/go.mod h1:tyLxzAVkhlL3/jFdcQcX1RZ8i8h9bs+AJur5RcuaW40=
kmodules.xyz/resource-metrics v0.25.3 h1:g9EjNfYRrUSnbA4r+bUQefQ5Ban6I6rpKjnB3ER+Yew=
kmodules.xyz/resource-metrics v0.25.3/go.mod h1:H7YLdUQJXUSzf5cNI4IYWU4Wsmrua/jpw7gqDnE3BwM=
moul.io/anonuuid v1.3.2 h1:0iPzohbBNJvqVKv2VsqeN8YsDJhJymW/HiytSK2Rf0g=
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -57,6 +57,7 @@ type ClusterStatusResponse struct {
ClusterAPI *kmapi.CAPIClusterInfo `json:"clusterAPI,omitempty"`
}

// +kubebuilder:validation:Enum=Active;Inactive;NotReady;NotConnected;Registered;NotImported
type ClusterPhase string

const (
Expand All @@ -68,11 +69,12 @@ const (
ClusterPhaseNotImported ClusterPhase = "NotImported"
)

// +kubebuilder:validation:Enum=Unknown;ClusterNotFound;AuthIssue;MissingComponent
type ClusterPhaseReason string

const (
ClusterNotFound ClusterPhaseReason = "ClusterNotFound"
AuthIssue ClusterPhaseReason = "AuthIssue"
MissingComponent ClusterPhaseReason = "MissingComponent"
ReasonUnknown ClusterPhaseReason = "Unknown"
ClusterPhaseReasonReasonUnknown ClusterPhaseReason = "Unknown"
ClusterPhaseReasonClusterNotFound ClusterPhaseReason = "ClusterNotFound"
ClusterPhaseReasonAuthIssue ClusterPhaseReason = "AuthIssue"
ClusterPhaseReasonMissingComponent ClusterPhaseReason = "MissingComponent"
)
2 changes: 1 addition & 1 deletion vendor/modules.txt
Original file line number Diff line number Diff line change
Expand Up @@ -849,7 +849,7 @@ kmodules.xyz/crd-schema-fuzz
# kmodules.xyz/offshoot-api v0.25.0
## explicit; go 1.18
kmodules.xyz/offshoot-api/api/v1
# kmodules.xyz/resource-metadata v0.17.26-0.20231009075914-70d9638b6217
# kmodules.xyz/resource-metadata v0.17.26-0.20231009112556-f90c55e7954d
## explicit; go 1.18
kmodules.xyz/resource-metadata/apis/meta
kmodules.xyz/resource-metadata/apis/meta/v1alpha1
Expand Down

0 comments on commit 4b4bcb4

Please sign in to comment.