Skip to content

feat(k8s/cluster): add provider status normalization#9

Open
rafeegnash wants to merge 1 commit intok8-gcp-supportfrom
issue-69-provider-status-normalization
Open

feat(k8s/cluster): add provider status normalization#9
rafeegnash wants to merge 1 commit intok8-gcp-supportfrom
issue-69-provider-status-normalization

Conversation

@rafeegnash
Copy link
Copy Markdown

Summary

Add normalized ClusterStatus type to provide consistent status representation across all cloud providers (EKS, GKE, AKS).

Changes

New Types

  • ClusterStatus enum with values:
    • ready - cluster is operational
    • creating - cluster is being created
    • updating - cluster is being updated
    • deleting - cluster is being deleted
    • error - cluster is in an error state
    • unknown - status could not be determined

New Fields

  • Added NormalizedStatus field to ClusterInfo struct
  • Original Status field preserved for backwards compatibility

New Functions

  • NormalizeEKSStatus(status string) ClusterStatus
  • NormalizeGKEStatus(status string) ClusterStatus
  • NormalizeAKSStatus(provisioningState string) ClusterStatus

Helper Methods

  • ClusterStatus.IsReady() bool
  • ClusterStatus.IsTransitioning() bool
  • ClusterStatus.IsError() bool

Provider Updates

  • EKS provider populates NormalizedStatus in GetCluster and ListClusters
  • GKE provider populates NormalizedStatus in GetCluster and ListClusters

Status Mapping

Provider Provider Status Normalized Status
EKS ACTIVE ready
EKS CREATING, PENDING creating
EKS UPDATING updating
EKS DELETING deleting
EKS FAILED error
GKE RUNNING ready
GKE PROVISIONING creating
GKE RECONCILING updating
GKE STOPPING deleting
GKE ERROR, DEGRADED error
AKS Succeeded ready
AKS Creating creating
AKS Updating updating
AKS Deleting deleting
AKS Failed, Canceled error

Test plan

  • All tests pass locally
  • Added comprehensive status normalization tests
  • Code formatted with go fmt

Closes bgdnvk#69

Add normalized ClusterStatus type to provide consistent status
representation across all cloud providers (EKS, GKE, AKS).

Changes:
- Add ClusterStatus enum with values: ready, creating, updating,
  deleting, error, unknown
- Add NormalizedStatus field to ClusterInfo struct
- Add NormalizeEKSStatus, NormalizeGKEStatus, NormalizeAKSStatus
  functions to convert provider-specific statuses
- Add IsReady, IsTransitioning, IsError helper methods
- Update EKS and GKE providers to populate NormalizedStatus
- Add comprehensive tests for status normalization

The original provider-specific Status field is preserved for
backwards compatibility, while NormalizedStatus enables consistent
status handling across providers.

Closes bgdnvk#69
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant