From a32f7d24deb955eaa62e78a3065f493177f898aa Mon Sep 17 00:00:00 2001 From: Tamal Saha Date: Mon, 7 Oct 2024 23:11:51 -0800 Subject: [PATCH] Update provider constants (#596) Signed-off-by: Tamal Saha --- api/v1/cluster.go | 13 ++++++------- cluster/detector.go | 6 +++--- 2 files changed, 9 insertions(+), 10 deletions(-) diff --git a/api/v1/cluster.go b/api/v1/cluster.go index c8998881f..8d80b0d1c 100644 --- a/api/v1/cluster.go +++ b/api/v1/cluster.go @@ -24,22 +24,21 @@ import ( "strings" ) -// +kubebuilder:validation:Enum=Aws;Azure;DigitalOcean;GoogleCloud;Linode;Packet;Scaleway;Vultr;BareMetal;KIND;Generic +// +kubebuilder:validation:Enum=AKS;DigitalOcean;EKS;Exoscale;Generic;GKE;Linode;Packet;Rancher;Scaleway;Vultr type HostingProvider string const ( - HostingProviderAWS HostingProvider = "Aws" - HostingProviderAzure HostingProvider = "Azure" + HostingProviderAKS HostingProvider = "AKS" HostingProviderDigitalOcean HostingProvider = "DigitalOcean" - HostingProviderGoogleCloud HostingProvider = "GoogleCloud" + HostingProviderEKS HostingProvider = "EKS" HostingProviderExoscale HostingProvider = "Exoscale" + HostingProviderGeneric HostingProvider = "Generic" + HostingProviderGKE HostingProvider = "GKE" HostingProviderLinode HostingProvider = "Linode" HostingProviderPacket HostingProvider = "Packet" + HostingProviderRancher HostingProvider = "Rancher" HostingProviderScaleway HostingProvider = "Scaleway" HostingProviderVultr HostingProvider = "Vultr" - HostingProviderBareMetal HostingProvider = "BareMetal" - HostingProviderKIND HostingProvider = "KIND" - HostingProviderGeneric HostingProvider = "Generic" ) const ( diff --git a/cluster/detector.go b/cluster/detector.go index b7ca72310..dbea6499d 100644 --- a/cluster/detector.go +++ b/cluster/detector.go @@ -87,9 +87,9 @@ func DetectProvider(cfg *rest.Config, mapper meta.RESTMapper) (kmapi.HostingProv for _, host := range crt.DNSNames { if strings.HasSuffix(host, eksDomain) { - return kmapi.HostingProviderAWS, nil + return kmapi.HostingProviderEKS, nil } else if strings.HasSuffix(host, aksDomain) { - return kmapi.HostingProviderAzure, nil + return kmapi.HostingProviderAKS, nil } else if strings.HasSuffix(host, doDomain) { return kmapi.HostingProviderDigitalOcean, nil } else if strings.HasSuffix(host, exoscaleDomain) { @@ -108,7 +108,7 @@ func DetectProvider(cfg *rest.Config, mapper meta.RESTMapper) (kmapi.HostingProv Group: "networking.gke.io", Kind: "Network", }); err == nil { - return kmapi.HostingProviderGoogleCloud, nil + return kmapi.HostingProviderGKE, nil } return "", nil