Skip to content

Commit

Permalink
Merge pull request #27 from mogenius/develop
Browse files Browse the repository at this point in the history
Feat: Merge Dev To Main.
  • Loading branch information
beneiltis authored Feb 28, 2024
2 parents 1139ea2 + de61301 commit 400e3f5
Show file tree
Hide file tree
Showing 20 changed files with 163 additions and 186 deletions.
4 changes: 2 additions & 2 deletions .github/workflows/develop.yml
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ env:

jobs:
prepare:
runs-on: [self-hosted, X64]
runs-on: [self-hosted, ubuntu-2204-arm64]
steps:
- name: Checkout repository
uses: actions/checkout@v4
Expand All @@ -29,7 +29,7 @@ jobs:
git config --global user.email "[email protected]"
git config --global user.name "punq"
git config --global credential.helper cache
semantic-release
npx semantic-release
VERSION=$(git describe --tags $(git rev-list --tags --max-count=1))
echo "VERSION=$VERSION" >> $GITHUB_ENV
COMMIT_HASH=$(git rev-parse --short HEAD)
Expand Down
4 changes: 2 additions & 2 deletions .github/workflows/main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ env:

jobs:
prepare:
runs-on: [self-hosted, X64]
runs-on: [self-hosted, ubuntu-2204-arm64]
steps:
- name: Checkout repository
uses: actions/checkout@v4
Expand All @@ -29,7 +29,7 @@ jobs:
git config --global user.email "[email protected]"
git config --global user.name "punq"
git config --global credential.helper cache
semantic-release
npx semantic-release
VERSION=$(git describe --tags $(git rev-list --tags --max-count=1))
echo "VERSION=$VERSION" >> $GITHUB_ENV
COMMIT_HASH=$(git rev-parse --short HEAD)
Expand Down
4 changes: 2 additions & 2 deletions Dockerfile-Operator
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
FROM golang:1.21-alpine AS builder
FROM golang:1.22-alpine AS builder

ARG GOOS
ARG GOARCH
Expand Down Expand Up @@ -33,7 +33,7 @@ FROM alpine:latest
ARG GOOS
ARG GOARCH

RUN apk add --no-cache curl bash
RUN apk add --no-cache curl

RUN echo "${GOOS} ${GOARCH}"

Expand Down
1 change: 1 addition & 0 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@ GO=go
GOBUILD=$(GO) build
GOCLEAN=$(GO) clean
GOGET=$(GO) get
CGO_ENABLED=0

# Ensure linker embeds versioning information
VERSION=${shell git describe --tags $(git rev-list --tags --max-count=1)}
Expand Down
1 change: 1 addition & 0 deletions Makefile-dev
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@ GOBUILD=$(GO) build
GOCLEAN=$(GO) clean
GOTEST=$(GO) test
GOGET=$(GO) get
CGO_ENABLED=0

# Ensure linker embeds versioning information
VERSION=${shell git describe --tags $(git rev-list --tags --max-count=1)}
Expand Down
1 change: 0 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,6 @@


# punq

Punq streamlines Kubernetes cluster management through an intuitive WebApp and a user-friendly CLI, designed to simplify the lives of DevOps professionals.

It offers unified team collaboration, comprehensive log access, and a sophisticated workload editor, facilitates seamless oversight and manipulation of clusters spanning various infrastructures.
Expand Down
12 changes: 6 additions & 6 deletions go.mod
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
module github.com/mogenius/punq

go 1.21
go 1.22

require (
github.com/cert-manager/cert-manager v1.12.3
Expand Down Expand Up @@ -99,12 +99,12 @@ require (
github.com/xo/terminfo v0.0.0-20210125001918-ca9a967f8778 // indirect
go.mongodb.org/mongo-driver v1.11.3 // indirect
golang.org/x/arch v0.5.0 // indirect
golang.org/x/crypto v0.12.0
golang.org/x/net v0.14.0 // indirect
golang.org/x/crypto v0.20.0
golang.org/x/net v0.21.0 // indirect
golang.org/x/oauth2 v0.9.0 // indirect
golang.org/x/sys v0.12.0 // indirect
golang.org/x/term v0.11.0
golang.org/x/text v0.13.0 // indirect
golang.org/x/sys v0.17.0 // indirect
golang.org/x/term v0.17.0
golang.org/x/text v0.14.0 // indirect
golang.org/x/time v0.3.0 // indirect
google.golang.org/appengine v1.6.7 // indirect
google.golang.org/protobuf v1.31.0 // indirect
Expand Down
20 changes: 10 additions & 10 deletions go.sum
Original file line number Diff line number Diff line change
Expand Up @@ -284,8 +284,8 @@ golang.org/x/crypto v0.0.0-20200622213623-75b288015ac9/go.mod h1:LzIPMQfyMNhhGPh
golang.org/x/crypto v0.0.0-20210711020723-a769d52b0f97/go.mod h1:GvvjBRRGRdwPK5ydBHafDWAxML/pGHZbMvKqRZ5+Abc=
golang.org/x/crypto v0.0.0-20210921155107-089bfa567519/go.mod h1:GvvjBRRGRdwPK5ydBHafDWAxML/pGHZbMvKqRZ5+Abc=
golang.org/x/crypto v0.0.0-20220622213112-05595931fe9d/go.mod h1:IxCIyHEi3zRg3s0A5j5BB6A9Jmi73HwBIUl50j+osU4=
golang.org/x/crypto v0.12.0 h1:tFM/ta59kqch6LlvYnPa0yx5a83cL2nHflFhYKvv9Yk=
golang.org/x/crypto v0.12.0/go.mod h1:NF0Gs7EO5K4qLn+Ylc+fih8BSTeIjAP05siRnAh98yw=
golang.org/x/crypto v0.20.0 h1:jmAMJJZXr5KiCw05dfYK9QnqaqKLYXijU23lsEdcQqg=
golang.org/x/crypto v0.20.0/go.mod h1:Xwo95rrVNIoSMx9wa1JroENMToLWn3RNVrTBpLHgZPQ=
golang.org/x/mod v0.2.0/go.mod h1:s0Qsj1ACt9ePp/hMypM3fl4fZqREWJwdYDEqhRiZZUA=
golang.org/x/mod v0.3.0/go.mod h1:s0Qsj1ACt9ePp/hMypM3fl4fZqREWJwdYDEqhRiZZUA=
golang.org/x/mod v0.6.0-dev.0.20220419223038-86c51ed26bb4/go.mod h1:jJ57K6gSWd91VN4djpZkiMVwK6gcyfeH4XE8wZrZaV4=
Expand All @@ -301,8 +301,8 @@ golang.org/x/net v0.0.0-20211112202133-69e39bad7dc2/go.mod h1:9nx3DQGgdP8bBQD5qx
golang.org/x/net v0.0.0-20220722155237-a158d28d115b/go.mod h1:XRhObCWvk6IyKnWLug+ECip1KBveYUHfp+8e9klMJ9c=
golang.org/x/net v0.0.0-20221002022538-bcab6841153b/go.mod h1:YDH+HFinaLZZlnHAfSS6ZXJJ9M9t4Dl22yv3iI2vPwk=
golang.org/x/net v0.7.0/go.mod h1:2Tu9+aMcznHK/AK1HMvgo6xiTLG5rD5rZLDS+rp2Bjs=
golang.org/x/net v0.14.0 h1:BONx9s002vGdD9umnlX1Po8vOZmrgH34qlHcD1MfK14=
golang.org/x/net v0.14.0/go.mod h1:PpSgVXXLK0OxS0F31C1/tv6XNguvCrnXIDrFMspZIUI=
golang.org/x/net v0.21.0 h1:AQyQV4dYCvJ7vGmJyKki9+PBdyvhkSd8EIx/qb0AYv4=
golang.org/x/net v0.21.0/go.mod h1:bIjVDfnllIU7BJ2DNgfnXvpSvtn8VRwhlsaeUTyUS44=
golang.org/x/oauth2 v0.9.0 h1:BPpt2kU7oMRq3kCHAA1tbSEshXRw1LpG2ztgDwrzuAs=
golang.org/x/oauth2 v0.9.0/go.mod h1:qYgFZaFiu6Wg24azG8bdV52QJXJGbZzIIsRCdVKzbLw=
golang.org/x/sync v0.0.0-20190423024810-112230192c58/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM=
Expand All @@ -327,21 +327,21 @@ golang.org/x/sys v0.0.0-20220811171246-fbc7d0a398ab/go.mod h1:oPkhp1MJrh7nUepCBc
golang.org/x/sys v0.1.0/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg=
golang.org/x/sys v0.5.0/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg=
golang.org/x/sys v0.6.0/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg=
golang.org/x/sys v0.12.0 h1:CM0HF96J0hcLAwsHPJZjfdNzs0gftsLfgKt57wWHJ0o=
golang.org/x/sys v0.12.0/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg=
golang.org/x/sys v0.17.0 h1:25cE3gD+tdBA7lp7QfhuV+rJiE9YXTcS3VG1SqssI/Y=
golang.org/x/sys v0.17.0/go.mod h1:/VUhepiaJMQUp4+oa/7Zr1D23ma6VTLIYjOOTFZPUcA=
golang.org/x/term v0.0.0-20201126162022-7de9c90e9dd1/go.mod h1:bj7SfCRtBDWHUb9snDiAeCFNEtKQo2Wmx5Cou7ajbmo=
golang.org/x/term v0.0.0-20210927222741-03fcf44c2211/go.mod h1:jbD1KX2456YbFQfuXm/mYQcufACuNUgVhRMnK/tPxf8=
golang.org/x/term v0.5.0/go.mod h1:jMB1sMXY+tzblOD4FWmEbocvup2/aLOaQEp7JmGp78k=
golang.org/x/term v0.11.0 h1:F9tnn/DA/Im8nCwm+fX+1/eBwi4qFjRT++MhtVC4ZX0=
golang.org/x/term v0.11.0/go.mod h1:zC9APTIj3jG3FdV/Ons+XE1riIZXG4aZ4GTHiPZJPIU=
golang.org/x/term v0.17.0 h1:mkTF7LCd6WGJNL3K1Ad7kwxNfYAW6a8a8QqtMblp/4U=
golang.org/x/term v0.17.0/go.mod h1:lLRBjIVuehSbZlaOtGMbcMncT+aqLLLmKrsjNrUguwk=
golang.org/x/text v0.3.0/go.mod h1:NqM8EUOU14njkJ3fqMW+pc6Ldnwhi/IjpwHt7yyuwOQ=
golang.org/x/text v0.3.2/go.mod h1:bEr9sfX3Q8Zfm5fL9x+3itogRgK3+ptLWKqgva+5dAk=
golang.org/x/text v0.3.3/go.mod h1:5Zoc/QRtKVWzQhOtBMvqHzDpF6irO9z98xDceosuGiQ=
golang.org/x/text v0.3.6/go.mod h1:5Zoc/QRtKVWzQhOtBMvqHzDpF6irO9z98xDceosuGiQ=
golang.org/x/text v0.3.7/go.mod h1:u+2+/6zg+i71rQMx5EYifcz6MCKuco9NR6JIITiCfzQ=
golang.org/x/text v0.7.0/go.mod h1:mrYo+phRRbMaCq/xk9113O4dZlRixOauAjOtrjsXDZ8=
golang.org/x/text v0.13.0 h1:ablQoSUd0tRdKxZewP80B+BaqeKJuVhuRxj/dkrun3k=
golang.org/x/text v0.13.0/go.mod h1:TvPlkZtksWOMsz7fbANvkp4WM8x/WCo/om8BMLbz+aE=
golang.org/x/text v0.14.0 h1:ScX5w1eTa3QqT8oi6+ziP7dTV1S2+ALU0bI+0zXKWiQ=
golang.org/x/text v0.14.0/go.mod h1:18ZOQIKpY8NJVqYksKHtTdi31H5itFRjB5/qKTNYzSU=
golang.org/x/time v0.3.0 h1:rg5rLMjNzMS1RkNLzCG38eapWhnYLFYXDXj2gOlr8j4=
golang.org/x/time v0.3.0/go.mod h1:tRJNPiyCQ0inRvYxbN9jk5I+vvW/OXSQhTDSoE431IQ=
golang.org/x/tools v0.0.0-20180917221912-90fa682c2a6e/go.mod h1:n7NCudcB/nEzxVGmLbDWY5pfWTLqBcC2KZ6jyYvM4mQ=
Expand Down
4 changes: 4 additions & 0 deletions kubernetes/nodes.go
Original file line number Diff line number Diff line change
Expand Up @@ -36,6 +36,10 @@ func GetNodeStats(contextId *string) []dtos.NodeStat {
break
}
}
if nodeMetric == nil {
logger.Log.Errorf("Failed to find node metrics for node %s", node.Name)
continue
}

// CPU
cpuUsage, works := nodeMetric.Usage.Cpu().AsDec().Unscaled()
Expand Down
17 changes: 17 additions & 0 deletions kubernetes/persistent-volume.go
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,23 @@ import (
metav1 "k8s.io/apimachinery/pkg/apis/meta/v1"
)

func AllPersistentVolumesRaw(contextId *string) []core.PersistentVolume {
result := []core.PersistentVolume{}

provider, err := NewKubeProvider(contextId)
if err != nil {
return result
}
pvList, err := provider.ClientSet.CoreV1().PersistentVolumes().List(context.TODO(), metav1.ListOptions{})
if err != nil {
logger.Log.Errorf("AllPersistentVolumesRaw ERROR: %s", err.Error())
return result
}
result = append(result, pvList.Items...)

return result
}

func AllPersistentVolumes(contextId *string) utils.K8sWorkloadResult {
result := []core.PersistentVolume{}

Expand Down
90 changes: 65 additions & 25 deletions kubernetes/utils.go
Original file line number Diff line number Diff line change
Expand Up @@ -444,7 +444,13 @@ func IsDeploymentInstalled(namespaceName string, name string) (string, error) {
return "", err
}

return strings.Split(ownDeployment.Spec.Template.Spec.Containers[0].Image, ":")[1], nil
result := ""
split := strings.Split(ownDeployment.Spec.Template.Spec.Containers[0].Image, ":")
if len(split) > 1 {
result = split[1]
}

return result, nil
}

func IsDaemonSetInstalled(namespaceName string, name string) (string, error) {
Expand All @@ -453,7 +459,13 @@ func IsDaemonSetInstalled(namespaceName string, name string) (string, error) {
return "", err
}

return strings.Split(ownDaemonset.Spec.Template.Spec.Containers[0].Image, ":")[1], nil
result := ""
split := strings.Split(ownDaemonset.Spec.Template.Spec.Containers[0].Image, ":")
if len(split) > 1 {
result = split[1]
}

return result, nil
}

// TAKEN FROM Kubernetes apimachineryv0.25.1
Expand Down Expand Up @@ -643,7 +655,11 @@ func GuessClusterProvider(contextId *string) (dtos.KubernetesProvider, error) {
func GuessCluserProviderFromNodeList(nodes *v1.NodeList) (dtos.KubernetesProvider, error) {

for _, node := range nodes.Items {
labelsAndAnnotations := utils.MergeMaps(node.GetLabels(), node.GetAnnotations())
nodeInfo := map[string]string{}
nodeInfo["kubeProxyVersion"] = node.Status.NodeInfo.KubeProxyVersion
nodeInfo["kubeletVersion"] = node.Status.NodeInfo.KubeletVersion

labelsAndAnnotations := utils.MergeMaps(node.GetLabels(), node.GetAnnotations(), nodeInfo)

if LabelsContain(labelsAndAnnotations, "eks.amazonaws.com/") {
return dtos.EKS, nil
Expand Down Expand Up @@ -679,7 +695,7 @@ func GuessCluserProviderFromNodeList(nodes *v1.NodeList) (dtos.KubernetesProvide
return dtos.MINIKUBE, nil
} else if LabelsContain(labelsAndAnnotations, "io.k8s.sigs.kind/role") {
return dtos.KIND, nil
} else if LabelsContain(labelsAndAnnotations, "civo/") {
} else if LabelsContain(labelsAndAnnotations, "civo-node-pool") {
return dtos.CIVO, nil
} else if LabelsContain(labelsAndAnnotations, "giantswarm.io/") {
return dtos.GIANTSWARM, nil
Expand All @@ -691,6 +707,8 @@ func GuessCluserProviderFromNodeList(nodes *v1.NodeList) (dtos.KubernetesProvide
return dtos.HUAWEI, nil
} else if LabelsContain(labelsAndAnnotations, "nirmata.io") {
return dtos.NIRMATA, nil
} else if LabelsContain(labelsAndAnnotations, "-CCE") || ImagesContain(node.Status.Images, "cce-addons") {
return dtos.OTC, nil
} else if LabelsContain(labelsAndAnnotations, "platform9.com/role") {
return dtos.PF9, nil
} else if LabelsContain(labelsAndAnnotations, "nks.netapp.io") {
Expand All @@ -717,6 +735,17 @@ func GuessCluserProviderFromNodeList(nodes *v1.NodeList) (dtos.KubernetesProvide
return dtos.UNKNOWN, nil
}

func ImagesContain(images []v1.ContainerImage, str string) bool {
for _, image := range images {
for _, name := range image.Names {
if strings.Contains(name, str) {
return true
}
}
}
return false
}

func LabelsContain(labels map[string]string, str string) bool {
// Keys EQUAL
if _, ok := labels[strings.ToLower(str)]; ok {
Expand Down Expand Up @@ -842,26 +871,35 @@ const (
)

type SystemCheckEntry struct {
CheckName string `json:"checkName"`
Status SystemCheckStatus `json:"status"`
Message string `json:"message"`
InstallPattern string `json:"installPattern"`
UninstallPattern string `json:"uninstallPattern"`
IsRequired bool `json:"isRequired"`
CheckName string `json:"checkName"`
Status SystemCheckStatus `json:"status"`
Message string `json:"message"`
Description string `json:"description"`
InstallPattern string `json:"installPattern"`
UpgradePattern string `json:"upgradePattern"`
UninstallPattern string `json:"uninstallPattern"`
IsRequired bool `json:"isRequired"`
WantsToBeInstalled bool `json:"wantsToBeInstalled"`
VersionInstalled string `json:"versionInstalled"`
VersionAvailable string `json:"versionAvailable"`
}

func CreateSystemCheckEntry(checkName string, alreadyInstalled bool, message string, isRequired bool) SystemCheckEntry {
func CreateSystemCheckEntry(checkName string, alreadyInstalled bool, message string, description string, isRequired bool, wantsToBeInstalled bool, versionInstalled string, versionAvailable string) SystemCheckEntry {
status := UNKNOWN_STATUS
if alreadyInstalled {
status = INSTALLED
} else {
status = NOT_INSTALLED
}
return SystemCheckEntry{
CheckName: checkName,
Status: status,
Message: message,
IsRequired: isRequired,
CheckName: checkName,
Status: status,
Message: message,
Description: description,
IsRequired: isRequired,
WantsToBeInstalled: wantsToBeInstalled,
VersionInstalled: versionInstalled,
VersionAvailable: versionAvailable,
}
}

Expand Down Expand Up @@ -920,38 +958,40 @@ func SystemCheck() []SystemCheckEntry {
// check internet access
inetResult, inetErr := utils.CheckInternetAccess()
inetMsg := StatusMessage(inetErr, "Check your internet connection.", "Internet access works.")
result = append(result, CreateSystemCheckEntry("Internet Access", inetResult, inetMsg, true))
result = append(result, CreateSystemCheckEntry("Internet Access", inetResult, inetMsg, "", true, false, "", ""))

// check for kubectl
kubectlResult, kubectlOutput, kubectlErr := utils.IsKubectlInstalled()
kubeCtlMsg := StatusMessage(kubectlErr, "Plase install kubectl (https://kubernetes.io/docs/tasks/tools/) on your system to proceed.", kubectlOutput)
result = append(result, CreateSystemCheckEntry("kubectl", kubectlResult, kubeCtlMsg, true))
result = append(result, CreateSystemCheckEntry("kubectl", kubectlResult, kubeCtlMsg, "", true, false, "", ""))

// check kubernetes version
kubernetesVersion := KubernetesVersion(nil)
kubernetesVersionResult := kubernetesVersion != nil
kubernetesVersionMsg := StatusMessage(kubectlErr, "Cannot determin version of kubernetes.", fmt.Sprintf("Version: %s\nPlatform: %s", kubernetesVersion.String(), kubernetesVersion.Platform))
result = append(result, CreateSystemCheckEntry("Kubernetes Version", kubernetesVersionResult, kubernetesVersionMsg, true))
result = append(result, CreateSystemCheckEntry("Kubernetes Version", kubernetesVersionResult, kubernetesVersionMsg, "", true, false, kubernetesVersion.String(), ""))

// check for ingresscontroller
ingressType, ingressTypeErr := DetermineIngressControllerType(nil)
ingressMsg := StatusMessage(ingressTypeErr, "Cannot determin ingress controller type.", ingressType.String())
result = append(result, CreateSystemCheckEntry("Ingress Controller", ingressTypeErr == nil, ingressMsg, false))
ingressDescription := "Installs a traefik ingress controller to handle traffic from outside the cluster and more."
result = append(result, CreateSystemCheckEntry("Ingress Controller", ingressTypeErr == nil, ingressMsg, ingressDescription, false, true, "", ""))

// check for metrics server
metricsResult, metricsVersion, metricsErr := IsMetricsServerAvailable(nil)
metricsMsg := StatusMessage(metricsErr, "kubectl apply -f https://github.com/kubernetes-sigs/metrics-server/releases/latest/download/components.yaml\nNote: Running docker-desktop? Please add '- --kubelet-insecure-tls' to the args sction in the deployment of metrics-server.", metricsVersion)
result = append(result, CreateSystemCheckEntry("Metrics Server", metricsResult, metricsMsg, true))
metricsDescription := "Maintained by Kubernetes-SIGs, handles metrics for built-in autoscaling pipelines."
result = append(result, CreateSystemCheckEntry("Metrics Server", metricsResult, metricsMsg, metricsDescription, true, true, metricsVersion, ""))

// check for helm
helmResult, helmOutput, helmErr := utils.IsHelmInstalled()
helmMsg := StatusMessage(helmErr, "Plase install helm (https://helm.sh/docs/intro/install/) on your system to proceed.", helmOutput)
result = append(result, CreateSystemCheckEntry("Helm", helmResult, helmMsg, true))
result = append(result, CreateSystemCheckEntry("Helm", helmResult, helmMsg, "", true, false, helmOutput, ""))

// check cluster provider
clusterProvOutput, clusterProvErr := GuessClusterProvider(nil)
clusterProviderMsg := StatusMessage(clusterProvErr, "We could not determine the provider of this cluster.", string(clusterProvOutput))
result = append(result, CreateSystemCheckEntry("Cluster Provider", clusterProvErr == nil, clusterProviderMsg, false))
result = append(result, CreateSystemCheckEntry("Cluster Provider", clusterProvErr == nil, clusterProviderMsg, "", false, false, "", ""))

// API Versions
apiVerResult, apiVerErr := ApiVersions(nil)
Expand All @@ -961,7 +1001,7 @@ func SystemCheck() []SystemCheckEntry {
}
apiVersStr = strings.TrimRight(apiVersStr, "\n\r")
apiVersMsg := StatusMessage(apiVerErr, "Metrics Server might be missing. Install the metrics server and try again.", apiVersStr)
result = append(result, CreateSystemCheckEntry("API Versions", len(apiVerResult) > 0, apiVersMsg, true))
result = append(result, CreateSystemCheckEntry("API Versions", len(apiVerResult) > 0, apiVersMsg, "", true, false, "", ""))

// check cluster provider
countryResult, countryErr := utils.GuessClusterCountry()
Expand All @@ -970,15 +1010,15 @@ func SystemCheck() []SystemCheckEntry {
countryName = countryResult.Name
}
countryMsg := StatusMessage(countryErr, "We could not determine the location of the cluster.", countryName)
result = append(result, CreateSystemCheckEntry("Cluster Country", countryErr == nil, countryMsg, false))
result = append(result, CreateSystemCheckEntry("Cluster Country", countryErr == nil, countryMsg, "", false, false, "", ""))

lbName := "LoadBalancer IPs/Hosts"
loadbalancerIps := GetClusterExternalIps(nil)
lbIpsMsg := strings.Join(loadbalancerIps, ", ")
if len(loadbalancerIps) == 0 {
lbIpsMsg = "No external IPs/Hosts.\nMaybe you don't have TREAFIK or NGINX ingress controller installed."
}
result = append(result, CreateSystemCheckEntry(lbName, len(loadbalancerIps) > 0, lbIpsMsg, false))
result = append(result, CreateSystemCheckEntry(lbName, len(loadbalancerIps) > 0, lbIpsMsg, "", false, false, "", ""))

return result
}
Expand Down
Loading

0 comments on commit 400e3f5

Please sign in to comment.