feat(k8s/cluster): add provider status normalization#9
Open
rafeegnash wants to merge 1 commit intok8-gcp-supportfrom
Open
feat(k8s/cluster): add provider status normalization#9rafeegnash wants to merge 1 commit intok8-gcp-supportfrom
rafeegnash wants to merge 1 commit intok8-gcp-supportfrom
Conversation
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
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Add normalized
ClusterStatustype to provide consistent status representation across all cloud providers (EKS, GKE, AKS).Changes
New Types
ClusterStatusenum with values:ready- cluster is operationalcreating- cluster is being createdupdating- cluster is being updateddeleting- cluster is being deletederror- cluster is in an error stateunknown- status could not be determinedNew Fields
NormalizedStatusfield toClusterInfostructStatusfield preserved for backwards compatibilityNew Functions
NormalizeEKSStatus(status string) ClusterStatusNormalizeGKEStatus(status string) ClusterStatusNormalizeAKSStatus(provisioningState string) ClusterStatusHelper Methods
ClusterStatus.IsReady() boolClusterStatus.IsTransitioning() boolClusterStatus.IsError() boolProvider Updates
NormalizedStatusinGetClusterandListClustersNormalizedStatusinGetClusterandListClustersStatus Mapping
Test plan
go fmtCloses bgdnvk#69