We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent ece6404 commit 70df53cCopy full SHA for 70df53c
internal/utils/kubernetes.go
@@ -2,6 +2,7 @@ package utils
2
3
import (
4
"log"
5
+ "net/url"
6
"os"
7
"path/filepath"
8
"strings"
@@ -46,8 +47,13 @@ func K8sClient() *kubernetes.Clientset {
46
47
return k8sClient
48
}
49
50
+// IsEKS determines if the cluster in the current context does appear to be an EKS cluster
51
func IsEKS() bool {
- return strings.Contains(getConfig().Host, ".eks.amazonaws.com")
52
+ parsedUrl, err := url.Parse(getConfig().Host)
53
+ if err != nil {
54
+ return false
55
+ }
56
+ return strings.HasSuffix(parsedUrl.Host, ".eks.amazonaws.com")
57
58
59
func GetEKSClusterName() string {
0 commit comments