From da89e9c0b435e79e545117a72305c9152404dbb5 Mon Sep 17 00:00:00 2001 From: punq Date: Wed, 15 Nov 2023 12:54:31 +0000 Subject: [PATCH 01/57] [skip ci] scoop v1.5.0-develop.29 --- punq-dev.json | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/punq-dev.json b/punq-dev.json index fcd5413..1861bb2 100644 --- a/punq-dev.json +++ b/punq-dev.json @@ -1,14 +1,14 @@ { - "version": "1.5.0-develop.28", + "version": "1.5.0-develop.29", "license": "MIT", "homepage": "https://punq.dev", "bin": "punq-dev.exe", - "pre_install": "Rename-Item \"$dir\\punq-dev-v1.5.0-develop.28-windows-amd64\" punq-dev.exe", + "pre_install": "Rename-Item \"$dir\\punq-dev-v1.5.0-develop.29-windows-amd64\" punq-dev.exe", "description": "A slim open-source workload manager for Kubernetes with team collaboration, WebApp, and CLI.", "architecture": { "64bit": { - "url": "https://github.com/mogenius/punq/releases/download/v1.5.0-develop.28/punq-v1.5.0-develop.28-windows-amd64", - "hash": "04e92d80bdf24f0edd4b1e1f1df863617883a5d2e0c3b0b8611aada9c70b8e16" + "url": "https://github.com/mogenius/punq/releases/download/v1.5.0-develop.29/punq-v1.5.0-develop.29-windows-amd64", + "hash": "229f8b1c49eb30c2685bbfea33f80ed6a2fdd5d2084816acc8ddb5f145fa73ae" } } } From ac5e7dfd7bb4f3dfe8d377edf4b5c2eec6f91861 Mon Sep 17 00:00:00 2001 From: Benedikt Iltisberger Date: Mon, 27 Nov 2023 14:32:12 +0100 Subject: [PATCH 02/57] fix: added buildid to command. --- structs/command.go | 1 + 1 file changed, 1 insertion(+) diff --git a/structs/command.go b/structs/command.go index 329ab32..e082c6a 100644 --- a/structs/command.go +++ b/structs/command.go @@ -23,6 +23,7 @@ type Command struct { MustSucceed bool `json:"mustSucceed"` ReportToNotificationSvc bool `json:"reportToNotificationService"` IgnoreError bool `json:"ignoreError"` + BuildId int `json:"buildId,omitempty"` Started time.Time } From 28b9e6f6826763766a3de85b18f504d2cf7945fe Mon Sep 17 00:00:00 2001 From: punq Date: Mon, 27 Nov 2023 13:42:57 +0000 Subject: [PATCH 03/57] [skip ci] scoop v1.5.0-develop.30 --- punq-dev.json | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/punq-dev.json b/punq-dev.json index 1861bb2..3cedfa0 100644 --- a/punq-dev.json +++ b/punq-dev.json @@ -1,14 +1,14 @@ { - "version": "1.5.0-develop.29", + "version": "1.5.0-develop.30", "license": "MIT", "homepage": "https://punq.dev", "bin": "punq-dev.exe", - "pre_install": "Rename-Item \"$dir\\punq-dev-v1.5.0-develop.29-windows-amd64\" punq-dev.exe", + "pre_install": "Rename-Item \"$dir\\punq-dev-v1.5.0-develop.30-windows-amd64\" punq-dev.exe", "description": "A slim open-source workload manager for Kubernetes with team collaboration, WebApp, and CLI.", "architecture": { "64bit": { - "url": "https://github.com/mogenius/punq/releases/download/v1.5.0-develop.29/punq-v1.5.0-develop.29-windows-amd64", - "hash": "229f8b1c49eb30c2685bbfea33f80ed6a2fdd5d2084816acc8ddb5f145fa73ae" + "url": "https://github.com/mogenius/punq/releases/download/v1.5.0-develop.30/punq-v1.5.0-develop.30-windows-amd64", + "hash": "44de8ca89ea3c719489a87b66a4899e472468fb2235ac64e0f981cf0349806c6" } } } From 487fc8268c479b9b37e8437a5ab6685b279c8c62 Mon Sep 17 00:00:00 2001 From: Benedikt Iltisberger Date: Mon, 4 Dec 2023 14:17:12 +0100 Subject: [PATCH 04/57] fix: minor fix. --- structs/command.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/structs/command.go b/structs/command.go index e082c6a..b5c8138 100644 --- a/structs/command.go +++ b/structs/command.go @@ -47,7 +47,7 @@ func ExecuteBashCommandSilent(title string, shellCmd string) { func ExecuteBashCommandWithResponse(title string, shellCmd string) string { var err error var returnStr []byte - _, err = utils.RunOnLocalShell(shellCmd).Output() + returnStr, err = utils.RunOnLocalShell(shellCmd).Output() if exitErr, ok := err.(*exec.ExitError); ok { exitCode := exitErr.ExitCode() errorMsg := string(exitErr.Stderr) From 54ec519c0e0bc00489d16ae2e600d0bf1f35d154 Mon Sep 17 00:00:00 2001 From: punq Date: Mon, 4 Dec 2023 13:23:45 +0000 Subject: [PATCH 05/57] [skip ci] scoop v1.5.0-develop.31 --- punq-dev.json | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/punq-dev.json b/punq-dev.json index 3cedfa0..97a4427 100644 --- a/punq-dev.json +++ b/punq-dev.json @@ -1,14 +1,14 @@ { - "version": "1.5.0-develop.30", + "version": "1.5.0-develop.31", "license": "MIT", "homepage": "https://punq.dev", "bin": "punq-dev.exe", - "pre_install": "Rename-Item \"$dir\\punq-dev-v1.5.0-develop.30-windows-amd64\" punq-dev.exe", + "pre_install": "Rename-Item \"$dir\\punq-dev-v1.5.0-develop.31-windows-amd64\" punq-dev.exe", "description": "A slim open-source workload manager for Kubernetes with team collaboration, WebApp, and CLI.", "architecture": { "64bit": { - "url": "https://github.com/mogenius/punq/releases/download/v1.5.0-develop.30/punq-v1.5.0-develop.30-windows-amd64", - "hash": "44de8ca89ea3c719489a87b66a4899e472468fb2235ac64e0f981cf0349806c6" + "url": "https://github.com/mogenius/punq/releases/download/v1.5.0-develop.31/punq-v1.5.0-develop.31-windows-amd64", + "hash": "076c3fca515efa1eb2b85ea822b178147d264d82e30e41c4bd09a4002ddb4ba2" } } } From d9cef10b17b7fed5cd5d8c2c848aea73c88bce63 Mon Sep 17 00:00:00 2001 From: Benedikt Iltisberger Date: Mon, 11 Dec 2023 11:13:36 +0100 Subject: [PATCH 06/57] fix: minor fixes for OTC detection. --- kubernetes/utils.go | 8 +++++++- utils/format.go | 17 +++++++---------- 2 files changed, 14 insertions(+), 11 deletions(-) diff --git a/kubernetes/utils.go b/kubernetes/utils.go index 9e459c4..bc07754 100644 --- a/kubernetes/utils.go +++ b/kubernetes/utils.go @@ -643,7 +643,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 @@ -691,6 +695,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") { + return dtos.OTC, nil } else if LabelsContain(labelsAndAnnotations, "platform9.com/role") { return dtos.PF9, nil } else if LabelsContain(labelsAndAnnotations, "nks.netapp.io") { diff --git a/utils/format.go b/utils/format.go index 0da6799..009bcd2 100644 --- a/utils/format.go +++ b/utils/format.go @@ -230,19 +230,16 @@ func HumanDuration(d time.Duration) string { return fmt.Sprintf("%dy", int(hours/24/365)) } -func MergeMaps(map1, map2 map[string]string) map[string]string { +func MergeMaps(maps ...map[string]string) map[string]string { resultMap := make(map[string]string) - for key, value := range map1 { - resultMap[key] = value - } - - // Add all elements from the second map, this could potentially overwrite - // values from the first map if there are matching keys. - for key, value := range map2 { - resultMap[key] = value + // Iterate over the slice of maps + for _, m := range maps { + // Add all elements from each map, potentially overwriting + for key, value := range m { + resultMap[key] = value + } } - return resultMap } From 6d578c0effc2c19f8f18101f7d51f00bab34c762 Mon Sep 17 00:00:00 2001 From: punq Date: Mon, 11 Dec 2023 10:24:40 +0000 Subject: [PATCH 07/57] [skip ci] scoop v1.5.0-develop.32 --- punq-dev.json | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/punq-dev.json b/punq-dev.json index 97a4427..15b6b43 100644 --- a/punq-dev.json +++ b/punq-dev.json @@ -1,14 +1,14 @@ { - "version": "1.5.0-develop.31", + "version": "1.5.0-develop.32", "license": "MIT", "homepage": "https://punq.dev", "bin": "punq-dev.exe", - "pre_install": "Rename-Item \"$dir\\punq-dev-v1.5.0-develop.31-windows-amd64\" punq-dev.exe", + "pre_install": "Rename-Item \"$dir\\punq-dev-v1.5.0-develop.32-windows-amd64\" punq-dev.exe", "description": "A slim open-source workload manager for Kubernetes with team collaboration, WebApp, and CLI.", "architecture": { "64bit": { - "url": "https://github.com/mogenius/punq/releases/download/v1.5.0-develop.31/punq-v1.5.0-develop.31-windows-amd64", - "hash": "076c3fca515efa1eb2b85ea822b178147d264d82e30e41c4bd09a4002ddb4ba2" + "url": "https://github.com/mogenius/punq/releases/download/v1.5.0-develop.32/punq-v1.5.0-develop.32-windows-amd64", + "hash": "0c03bf1503fa82718666d36d170b9a777f8fbd18e8c1394086d6e5060117a29e" } } } From 1af378b09686680a549456c9e27bed49ef51d58d Mon Sep 17 00:00:00 2001 From: Benedikt Iltisberger Date: Mon, 11 Dec 2023 12:26:08 +0100 Subject: [PATCH 08/57] fix: minor fixes for OTC detection. --- README.md | 1 - 1 file changed, 1 deletion(-) diff --git a/README.md b/README.md index 73e2fe8..302f4e8 100644 --- a/README.md +++ b/README.md @@ -26,7 +26,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. From c6a57d986d2d3c022642ccdc8f777753b674e691 Mon Sep 17 00:00:00 2001 From: punq Date: Mon, 11 Dec 2023 11:28:06 +0000 Subject: [PATCH 09/57] [skip ci] scoop v1.5.0-develop.33 --- punq-dev.json | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/punq-dev.json b/punq-dev.json index 15b6b43..778e4ab 100644 --- a/punq-dev.json +++ b/punq-dev.json @@ -1,14 +1,14 @@ { - "version": "1.5.0-develop.32", + "version": "1.5.0-develop.33", "license": "MIT", "homepage": "https://punq.dev", "bin": "punq-dev.exe", - "pre_install": "Rename-Item \"$dir\\punq-dev-v1.5.0-develop.32-windows-amd64\" punq-dev.exe", + "pre_install": "Rename-Item \"$dir\\punq-dev-v1.5.0-develop.33-windows-amd64\" punq-dev.exe", "description": "A slim open-source workload manager for Kubernetes with team collaboration, WebApp, and CLI.", "architecture": { "64bit": { - "url": "https://github.com/mogenius/punq/releases/download/v1.5.0-develop.32/punq-v1.5.0-develop.32-windows-amd64", - "hash": "0c03bf1503fa82718666d36d170b9a777f8fbd18e8c1394086d6e5060117a29e" + "url": "https://github.com/mogenius/punq/releases/download/v1.5.0-develop.33/punq-v1.5.0-develop.33-windows-amd64", + "hash": "4c32572d3130d59ddd938fbd17bf3e7229ffe809eb2bc9a95963cd1c013b8295" } } } From c1ec2351c898a140bf9263a6ad20431b464d7f0a Mon Sep 17 00:00:00 2001 From: Benedikt Iltisberger Date: Mon, 18 Dec 2023 13:47:43 +0100 Subject: [PATCH 10/57] fix: added needed function. --- kubernetes/persistent-volume.go | 17 +++++++++++++++++ 1 file changed, 17 insertions(+) diff --git a/kubernetes/persistent-volume.go b/kubernetes/persistent-volume.go index 65a6723..8205762 100644 --- a/kubernetes/persistent-volume.go +++ b/kubernetes/persistent-volume.go @@ -12,6 +12,23 @@ import ( metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" ) +func AllPersistentVolumesRaw(namespaceName string, 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{} From 3e436dfb2b0f5fc0e5f9d873780e4eb57d6e4c80 Mon Sep 17 00:00:00 2001 From: punq Date: Mon, 18 Dec 2023 12:58:44 +0000 Subject: [PATCH 11/57] [skip ci] scoop v1.5.0-develop.34 --- punq-dev.json | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/punq-dev.json b/punq-dev.json index 778e4ab..eacf8b4 100644 --- a/punq-dev.json +++ b/punq-dev.json @@ -1,14 +1,14 @@ { - "version": "1.5.0-develop.33", + "version": "1.5.0-develop.34", "license": "MIT", "homepage": "https://punq.dev", "bin": "punq-dev.exe", - "pre_install": "Rename-Item \"$dir\\punq-dev-v1.5.0-develop.33-windows-amd64\" punq-dev.exe", + "pre_install": "Rename-Item \"$dir\\punq-dev-v1.5.0-develop.34-windows-amd64\" punq-dev.exe", "description": "A slim open-source workload manager for Kubernetes with team collaboration, WebApp, and CLI.", "architecture": { "64bit": { - "url": "https://github.com/mogenius/punq/releases/download/v1.5.0-develop.33/punq-v1.5.0-develop.33-windows-amd64", - "hash": "4c32572d3130d59ddd938fbd17bf3e7229ffe809eb2bc9a95963cd1c013b8295" + "url": "https://github.com/mogenius/punq/releases/download/v1.5.0-develop.34/punq-v1.5.0-develop.34-windows-amd64", + "hash": "7316ad799b3f1b9b1f68090b2aa417706c2f2328be965a72aebf9f9dbad0f624" } } } From 39a3b6a46af72ce0b70a041be8e0b3e201c3ea77 Mon Sep 17 00:00:00 2001 From: Benedikt Iltisberger Date: Thu, 4 Jan 2024 21:51:50 +0100 Subject: [PATCH 12/57] fix: minor updates. --- kubernetes/persistent-volume.go | 2 +- kubernetes/utils.go | 44 +++++++++++++++++---------------- 2 files changed, 24 insertions(+), 22 deletions(-) diff --git a/kubernetes/persistent-volume.go b/kubernetes/persistent-volume.go index 8205762..396a3bc 100644 --- a/kubernetes/persistent-volume.go +++ b/kubernetes/persistent-volume.go @@ -12,7 +12,7 @@ import ( metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" ) -func AllPersistentVolumesRaw(namespaceName string, contextId *string) []core.PersistentVolume { +func AllPersistentVolumesRaw(contextId *string) []core.PersistentVolume { result := []core.PersistentVolume{} provider, err := NewKubeProvider(contextId) diff --git a/kubernetes/utils.go b/kubernetes/utils.go index bc07754..e3f7152 100644 --- a/kubernetes/utils.go +++ b/kubernetes/utils.go @@ -848,15 +848,16 @@ 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"` + InstallPattern string `json:"installPattern"` + UninstallPattern string `json:"uninstallPattern"` + IsRequired bool `json:"isRequired"` + WantsToBeInstalled bool `json:"wantsToBeInstalled"` } -func CreateSystemCheckEntry(checkName string, alreadyInstalled bool, message string, isRequired bool) SystemCheckEntry { +func CreateSystemCheckEntry(checkName string, alreadyInstalled bool, message string, isRequired bool, wantsToBeInstalled bool) SystemCheckEntry { status := UNKNOWN_STATUS if alreadyInstalled { status = INSTALLED @@ -864,10 +865,11 @@ func CreateSystemCheckEntry(checkName string, alreadyInstalled bool, message str status = NOT_INSTALLED } return SystemCheckEntry{ - CheckName: checkName, - Status: status, - Message: message, - IsRequired: isRequired, + CheckName: checkName, + Status: status, + Message: message, + IsRequired: isRequired, + WantsToBeInstalled: wantsToBeInstalled, } } @@ -926,38 +928,38 @@ 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)) // 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)) + result = append(result, CreateSystemCheckEntry("Ingress Controller", ingressTypeErr == nil, ingressMsg, 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)) + result = append(result, CreateSystemCheckEntry("Metrics Server", metricsResult, metricsMsg, true, true)) // 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)) // 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) @@ -967,7 +969,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() @@ -976,7 +978,7 @@ 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) @@ -984,7 +986,7 @@ func SystemCheck() []SystemCheckEntry { 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 } From e5bbbfa606b009ffba698c1b1bff3d8052e52285 Mon Sep 17 00:00:00 2001 From: punq Date: Thu, 4 Jan 2024 20:58:18 +0000 Subject: [PATCH 13/57] [skip ci] scoop v1.5.0-develop.35 --- punq-dev.json | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/punq-dev.json b/punq-dev.json index eacf8b4..4f6d256 100644 --- a/punq-dev.json +++ b/punq-dev.json @@ -1,14 +1,14 @@ { - "version": "1.5.0-develop.34", + "version": "1.5.0-develop.35", "license": "MIT", "homepage": "https://punq.dev", "bin": "punq-dev.exe", - "pre_install": "Rename-Item \"$dir\\punq-dev-v1.5.0-develop.34-windows-amd64\" punq-dev.exe", + "pre_install": "Rename-Item \"$dir\\punq-dev-v1.5.0-develop.35-windows-amd64\" punq-dev.exe", "description": "A slim open-source workload manager for Kubernetes with team collaboration, WebApp, and CLI.", "architecture": { "64bit": { - "url": "https://github.com/mogenius/punq/releases/download/v1.5.0-develop.34/punq-v1.5.0-develop.34-windows-amd64", - "hash": "7316ad799b3f1b9b1f68090b2aa417706c2f2328be965a72aebf9f9dbad0f624" + "url": "https://github.com/mogenius/punq/releases/download/v1.5.0-develop.35/punq-v1.5.0-develop.35-windows-amd64", + "hash": "8539e82009fb0e6c75656bc79b47138e9410377d950355b412c3efee8c0ca45a" } } } From f655e21345a379c80b97b12db7cf318d00fa068a Mon Sep 17 00:00:00 2001 From: Benedikt Iltisberger Date: Wed, 10 Jan 2024 12:42:54 +0100 Subject: [PATCH 14/57] fix: fixed civo detection. --- kubernetes/utils.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/kubernetes/utils.go b/kubernetes/utils.go index e3f7152..140b7c2 100644 --- a/kubernetes/utils.go +++ b/kubernetes/utils.go @@ -683,7 +683,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 From a245c002c6e9b3dd0355385dbfd4e7cacfbc2c38 Mon Sep 17 00:00:00 2001 From: punq Date: Wed, 10 Jan 2024 11:49:32 +0000 Subject: [PATCH 15/57] [skip ci] scoop v1.5.0-develop.36 --- punq-dev.json | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/punq-dev.json b/punq-dev.json index 4f6d256..3124f20 100644 --- a/punq-dev.json +++ b/punq-dev.json @@ -1,14 +1,14 @@ { - "version": "1.5.0-develop.35", + "version": "1.5.0-develop.36", "license": "MIT", "homepage": "https://punq.dev", "bin": "punq-dev.exe", - "pre_install": "Rename-Item \"$dir\\punq-dev-v1.5.0-develop.35-windows-amd64\" punq-dev.exe", + "pre_install": "Rename-Item \"$dir\\punq-dev-v1.5.0-develop.36-windows-amd64\" punq-dev.exe", "description": "A slim open-source workload manager for Kubernetes with team collaboration, WebApp, and CLI.", "architecture": { "64bit": { - "url": "https://github.com/mogenius/punq/releases/download/v1.5.0-develop.35/punq-v1.5.0-develop.35-windows-amd64", - "hash": "8539e82009fb0e6c75656bc79b47138e9410377d950355b412c3efee8c0ca45a" + "url": "https://github.com/mogenius/punq/releases/download/v1.5.0-develop.36/punq-v1.5.0-develop.36-windows-amd64", + "hash": "d8795b2b68d8b8a1d9c16e9ff650d62685cb0568c66f4ee69f43e7b189816406" } } } From 7dd186b4880c7909e6eb9498df592713d5ce1b75 Mon Sep 17 00:00:00 2001 From: Benedikt Iltisberger Date: Wed, 10 Jan 2024 14:49:42 +0100 Subject: [PATCH 16/57] fix: added description to SystemCheckEntry. --- kubernetes/utils.go | 26 +++++++++++++++----------- 1 file changed, 15 insertions(+), 11 deletions(-) diff --git a/kubernetes/utils.go b/kubernetes/utils.go index 140b7c2..8aac637 100644 --- a/kubernetes/utils.go +++ b/kubernetes/utils.go @@ -851,13 +851,14 @@ type SystemCheckEntry struct { CheckName string `json:"checkName"` Status SystemCheckStatus `json:"status"` Message string `json:"message"` + Description string `json:"description"` InstallPattern string `json:"installPattern"` UninstallPattern string `json:"uninstallPattern"` IsRequired bool `json:"isRequired"` WantsToBeInstalled bool `json:"wantsToBeInstalled"` } -func CreateSystemCheckEntry(checkName string, alreadyInstalled bool, message string, isRequired bool, wantsToBeInstalled bool) SystemCheckEntry { +func CreateSystemCheckEntry(checkName string, alreadyInstalled bool, message string, description string, isRequired bool, wantsToBeInstalled bool) SystemCheckEntry { status := UNKNOWN_STATUS if alreadyInstalled { status = INSTALLED @@ -868,6 +869,7 @@ func CreateSystemCheckEntry(checkName string, alreadyInstalled bool, message str CheckName: checkName, Status: status, Message: message, + Description: description, IsRequired: isRequired, WantsToBeInstalled: wantsToBeInstalled, } @@ -928,38 +930,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, false)) + 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, false)) + 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, false)) + result = append(result, CreateSystemCheckEntry("Kubernetes Version", kubernetesVersionResult, kubernetesVersionMsg, "", true, false)) // 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, true)) + 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, true)) + metricsDescription := "Maintained by Kubernetes-SIGs, handles metrics for built-in autoscaling pipelines." + result = append(result, CreateSystemCheckEntry("Metrics Server", metricsResult, metricsMsg, metricsDescription, true, true)) // 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, false)) + result = append(result, CreateSystemCheckEntry("Helm", helmResult, helmMsg, "", true, false)) // 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, false)) + result = append(result, CreateSystemCheckEntry("Cluster Provider", clusterProvErr == nil, clusterProviderMsg, "", false, false)) // API Versions apiVerResult, apiVerErr := ApiVersions(nil) @@ -969,7 +973,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, false)) + result = append(result, CreateSystemCheckEntry("API Versions", len(apiVerResult) > 0, apiVersMsg, "", true, false)) // check cluster provider countryResult, countryErr := utils.GuessClusterCountry() @@ -978,7 +982,7 @@ 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, false)) + result = append(result, CreateSystemCheckEntry("Cluster Country", countryErr == nil, countryMsg, "", false, false)) lbName := "LoadBalancer IPs/Hosts" loadbalancerIps := GetClusterExternalIps(nil) @@ -986,7 +990,7 @@ func SystemCheck() []SystemCheckEntry { 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, false)) + result = append(result, CreateSystemCheckEntry(lbName, len(loadbalancerIps) > 0, lbIpsMsg, "", false, false)) return result } From de18682603850550f8f091d9b824fef13cdffad2 Mon Sep 17 00:00:00 2001 From: punq Date: Wed, 10 Jan 2024 13:52:15 +0000 Subject: [PATCH 17/57] [skip ci] scoop v1.5.0-develop.37 --- punq-dev.json | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/punq-dev.json b/punq-dev.json index 3124f20..daafcd0 100644 --- a/punq-dev.json +++ b/punq-dev.json @@ -1,14 +1,14 @@ { - "version": "1.5.0-develop.36", + "version": "1.5.0-develop.37", "license": "MIT", "homepage": "https://punq.dev", "bin": "punq-dev.exe", - "pre_install": "Rename-Item \"$dir\\punq-dev-v1.5.0-develop.36-windows-amd64\" punq-dev.exe", + "pre_install": "Rename-Item \"$dir\\punq-dev-v1.5.0-develop.37-windows-amd64\" punq-dev.exe", "description": "A slim open-source workload manager for Kubernetes with team collaboration, WebApp, and CLI.", "architecture": { "64bit": { - "url": "https://github.com/mogenius/punq/releases/download/v1.5.0-develop.36/punq-v1.5.0-develop.36-windows-amd64", - "hash": "d8795b2b68d8b8a1d9c16e9ff650d62685cb0568c66f4ee69f43e7b189816406" + "url": "https://github.com/mogenius/punq/releases/download/v1.5.0-develop.37/punq-v1.5.0-develop.37-windows-amd64", + "hash": "6cdb2648c14152989a31ba0319a02366746211cb8740ad5b86ae79c8afe9073c" } } } From 8beabf3f24f52cb41f0ccdeda1347423842c238b Mon Sep 17 00:00:00 2001 From: Benedikt Iltisberger Date: Wed, 10 Jan 2024 15:11:27 +0100 Subject: [PATCH 18/57] fix: added helper func. --- utils/format.go | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/utils/format.go b/utils/format.go index 009bcd2..16b9e43 100644 --- a/utils/format.go +++ b/utils/format.go @@ -123,6 +123,14 @@ func NanoId() string { return id() } +func NanoIdSmallLowerCase() string { + id, err := nanoid.Custom("abcdefghijklmnopqrstuvwxyz1234567890", 10) + if err != nil { + logger.Log.Error(err) + } + return id() +} + func NanoIdExtraLong() string { id, err := nanoid.Custom("abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ1234567890", 21) if err != nil { From 6d0e192d7bcc00a143045d2edc432ffde0c7c6a3 Mon Sep 17 00:00:00 2001 From: punq Date: Wed, 10 Jan 2024 14:13:52 +0000 Subject: [PATCH 19/57] [skip ci] scoop v1.5.0-develop.38 --- punq-dev.json | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/punq-dev.json b/punq-dev.json index daafcd0..2e4675e 100644 --- a/punq-dev.json +++ b/punq-dev.json @@ -1,14 +1,14 @@ { - "version": "1.5.0-develop.37", + "version": "1.5.0-develop.38", "license": "MIT", "homepage": "https://punq.dev", "bin": "punq-dev.exe", - "pre_install": "Rename-Item \"$dir\\punq-dev-v1.5.0-develop.37-windows-amd64\" punq-dev.exe", + "pre_install": "Rename-Item \"$dir\\punq-dev-v1.5.0-develop.38-windows-amd64\" punq-dev.exe", "description": "A slim open-source workload manager for Kubernetes with team collaboration, WebApp, and CLI.", "architecture": { "64bit": { - "url": "https://github.com/mogenius/punq/releases/download/v1.5.0-develop.37/punq-v1.5.0-develop.37-windows-amd64", - "hash": "6cdb2648c14152989a31ba0319a02366746211cb8740ad5b86ae79c8afe9073c" + "url": "https://github.com/mogenius/punq/releases/download/v1.5.0-develop.38/punq-v1.5.0-develop.38-windows-amd64", + "hash": "a87ddd1f22f9c7470f327fc51878ae027c9f0ca1dbc08d44a5046fa1fef951f6" } } } From c9d65b8a003a3195ae8dbfa9af1ab2f3b2c48218 Mon Sep 17 00:00:00 2001 From: Benedikt Iltisberger Date: Thu, 11 Jan 2024 17:06:44 +0100 Subject: [PATCH 20/57] fix: minor fix. --- kubernetes/utils.go | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/kubernetes/utils.go b/kubernetes/utils.go index 8aac637..a0943f0 100644 --- a/kubernetes/utils.go +++ b/kubernetes/utils.go @@ -453,7 +453,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 From b7da2bd58d2205ed19c95b92fcd25dd55b4aa373 Mon Sep 17 00:00:00 2001 From: punq Date: Thu, 11 Jan 2024 16:09:27 +0000 Subject: [PATCH 21/57] [skip ci] scoop v1.5.0-develop.39 --- punq-dev.json | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/punq-dev.json b/punq-dev.json index 2e4675e..bee0824 100644 --- a/punq-dev.json +++ b/punq-dev.json @@ -1,14 +1,14 @@ { - "version": "1.5.0-develop.38", + "version": "1.5.0-develop.39", "license": "MIT", "homepage": "https://punq.dev", "bin": "punq-dev.exe", - "pre_install": "Rename-Item \"$dir\\punq-dev-v1.5.0-develop.38-windows-amd64\" punq-dev.exe", + "pre_install": "Rename-Item \"$dir\\punq-dev-v1.5.0-develop.39-windows-amd64\" punq-dev.exe", "description": "A slim open-source workload manager for Kubernetes with team collaboration, WebApp, and CLI.", "architecture": { "64bit": { - "url": "https://github.com/mogenius/punq/releases/download/v1.5.0-develop.38/punq-v1.5.0-develop.38-windows-amd64", - "hash": "a87ddd1f22f9c7470f327fc51878ae027c9f0ca1dbc08d44a5046fa1fef951f6" + "url": "https://github.com/mogenius/punq/releases/download/v1.5.0-develop.39/punq-v1.5.0-develop.39-windows-amd64", + "hash": "24583691d7b3d1462cfd8b3b5c0d4bc24417858f2eae4122cc3364eb00c249d4" } } } From 69bc0ef5391d35b02210b8b17eff62082aa8dff4 Mon Sep 17 00:00:00 2001 From: Benedikt Iltisberger Date: Thu, 11 Jan 2024 19:49:51 +0100 Subject: [PATCH 22/57] fix: minor fix. --- kubernetes/utils.go | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/kubernetes/utils.go b/kubernetes/utils.go index a0943f0..39d599d 100644 --- a/kubernetes/utils.go +++ b/kubernetes/utils.go @@ -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) { From d49b07579e4b38e24a0a407bc55e9cbdecc4ad32 Mon Sep 17 00:00:00 2001 From: punq Date: Thu, 11 Jan 2024 18:52:18 +0000 Subject: [PATCH 23/57] [skip ci] scoop v1.5.0-develop.40 --- punq-dev.json | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/punq-dev.json b/punq-dev.json index bee0824..08d4829 100644 --- a/punq-dev.json +++ b/punq-dev.json @@ -1,14 +1,14 @@ { - "version": "1.5.0-develop.39", + "version": "1.5.0-develop.40", "license": "MIT", "homepage": "https://punq.dev", "bin": "punq-dev.exe", - "pre_install": "Rename-Item \"$dir\\punq-dev-v1.5.0-develop.39-windows-amd64\" punq-dev.exe", + "pre_install": "Rename-Item \"$dir\\punq-dev-v1.5.0-develop.40-windows-amd64\" punq-dev.exe", "description": "A slim open-source workload manager for Kubernetes with team collaboration, WebApp, and CLI.", "architecture": { "64bit": { - "url": "https://github.com/mogenius/punq/releases/download/v1.5.0-develop.39/punq-v1.5.0-develop.39-windows-amd64", - "hash": "24583691d7b3d1462cfd8b3b5c0d4bc24417858f2eae4122cc3364eb00c249d4" + "url": "https://github.com/mogenius/punq/releases/download/v1.5.0-develop.40/punq-v1.5.0-develop.40-windows-amd64", + "hash": "054dbbc3adac1f3d2d86d4c402b046e2fa63666921ab1e8aa848b93adfad175c" } } } From 579ea3a340d16b637d16ac3f79473dd797d25283 Mon Sep 17 00:00:00 2001 From: Benedikt Iltisberger Date: Fri, 12 Jan 2024 13:52:04 +0100 Subject: [PATCH 24/57] fix: minor fix. --- utils/yaml-templates/deployment.yaml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/utils/yaml-templates/deployment.yaml b/utils/yaml-templates/deployment.yaml index e87d212..f50d572 100644 --- a/utils/yaml-templates/deployment.yaml +++ b/utils/yaml-templates/deployment.yaml @@ -26,7 +26,7 @@ spec: # topologyKey: kubernetes.io/hostname containers: - name: mo-default-gateway - image: ghcr.io/mogenius/mo-build-backend:latest + image: ports: - containerPort: 1337 resources: From b00be43c91e08383f32906751cb5d335187378fe Mon Sep 17 00:00:00 2001 From: punq Date: Fri, 12 Jan 2024 12:54:48 +0000 Subject: [PATCH 25/57] [skip ci] scoop v1.5.0-develop.41 --- punq-dev.json | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/punq-dev.json b/punq-dev.json index 08d4829..5b3d760 100644 --- a/punq-dev.json +++ b/punq-dev.json @@ -1,14 +1,14 @@ { - "version": "1.5.0-develop.40", + "version": "1.5.0-develop.41", "license": "MIT", "homepage": "https://punq.dev", "bin": "punq-dev.exe", - "pre_install": "Rename-Item \"$dir\\punq-dev-v1.5.0-develop.40-windows-amd64\" punq-dev.exe", + "pre_install": "Rename-Item \"$dir\\punq-dev-v1.5.0-develop.41-windows-amd64\" punq-dev.exe", "description": "A slim open-source workload manager for Kubernetes with team collaboration, WebApp, and CLI.", "architecture": { "64bit": { - "url": "https://github.com/mogenius/punq/releases/download/v1.5.0-develop.40/punq-v1.5.0-develop.40-windows-amd64", - "hash": "054dbbc3adac1f3d2d86d4c402b046e2fa63666921ab1e8aa848b93adfad175c" + "url": "https://github.com/mogenius/punq/releases/download/v1.5.0-develop.41/punq-v1.5.0-develop.41-windows-amd64", + "hash": "f0753d28811a15bf01244152a06a9f2b1ef261df75826f1a337b2bc01333e873" } } } From 38ce0467adfc1240b82c3b03c59206943b04655d Mon Sep 17 00:00:00 2001 From: Benedikt Iltisberger Date: Fri, 12 Jan 2024 13:55:16 +0100 Subject: [PATCH 26/57] fix: minor fix. --- structs/command.go | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/structs/command.go b/structs/command.go index b5c8138..08c43bd 100644 --- a/structs/command.go +++ b/structs/command.go @@ -29,12 +29,12 @@ type Command struct { func ExecuteBashCommandSilent(title string, shellCmd string) { var err error - _, err = utils.RunOnLocalShell(shellCmd).Output() + output, err := utils.RunOnLocalShell(shellCmd).Output() if exitErr, ok := err.(*exec.ExitError); ok { exitCode := exitErr.ExitCode() errorMsg := string(exitErr.Stderr) logger.Log.Error(shellCmd) - logger.Log.Errorf("%d: %s", exitCode, errorMsg) + logger.Log.Errorf("ExitCode: %d - Error: '%s' -> Output: '%s'", exitCode, errorMsg, string(output)) } else if err != nil { logger.Log.Errorf("ERROR: '%s': %s\n", title, err.Error()) } else { From de2d5d810545c80c86ab48c5b7215cf074b03bc1 Mon Sep 17 00:00:00 2001 From: punq Date: Fri, 12 Jan 2024 12:58:21 +0000 Subject: [PATCH 27/57] [skip ci] scoop v1.5.0-develop.42 --- punq-dev.json | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/punq-dev.json b/punq-dev.json index 5b3d760..b1a557b 100644 --- a/punq-dev.json +++ b/punq-dev.json @@ -1,14 +1,14 @@ { - "version": "1.5.0-develop.41", + "version": "1.5.0-develop.42", "license": "MIT", "homepage": "https://punq.dev", "bin": "punq-dev.exe", - "pre_install": "Rename-Item \"$dir\\punq-dev-v1.5.0-develop.41-windows-amd64\" punq-dev.exe", + "pre_install": "Rename-Item \"$dir\\punq-dev-v1.5.0-develop.42-windows-amd64\" punq-dev.exe", "description": "A slim open-source workload manager for Kubernetes with team collaboration, WebApp, and CLI.", "architecture": { "64bit": { - "url": "https://github.com/mogenius/punq/releases/download/v1.5.0-develop.41/punq-v1.5.0-develop.41-windows-amd64", - "hash": "f0753d28811a15bf01244152a06a9f2b1ef261df75826f1a337b2bc01333e873" + "url": "https://github.com/mogenius/punq/releases/download/v1.5.0-develop.42/punq-v1.5.0-develop.42-windows-amd64", + "hash": "7dc73556e68099595610ffa00cf8f5dee6639e23641e2c8a7228c56d8e5e9bc3" } } } From 0b82c9034f41ec946fe5cc5eef350ab1b9d33817 Mon Sep 17 00:00:00 2001 From: Benedikt Iltisberger Date: Fri, 12 Jan 2024 15:37:07 +0100 Subject: [PATCH 28/57] fix: minor fix. --- structs/enums.go | 12 ++++++++++++ 1 file changed, 12 insertions(+) create mode 100644 structs/enums.go diff --git a/structs/enums.go b/structs/enums.go new file mode 100644 index 0000000..3c872a4 --- /dev/null +++ b/structs/enums.go @@ -0,0 +1,12 @@ +package structs + +type JobStateEnum string + +const ( + JobStateFailed JobStateEnum = "FAILED" + JobStateSucceeded JobStateEnum = "SUCCEEDED" + JobStateStarted JobStateEnum = "STARTED" + JobStatePending JobStateEnum = "PENDING" + JobStateCanceled JobStateEnum = "CANCELED" + JobStateTimeout JobStateEnum = "TIMEOUT" +) From a4f1d692c0a6728e98feeda37aa0d8b9fe47878e Mon Sep 17 00:00:00 2001 From: punq Date: Fri, 12 Jan 2024 14:39:19 +0000 Subject: [PATCH 29/57] [skip ci] scoop v1.5.0-develop.43 --- punq-dev.json | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/punq-dev.json b/punq-dev.json index b1a557b..d720fa6 100644 --- a/punq-dev.json +++ b/punq-dev.json @@ -1,14 +1,14 @@ { - "version": "1.5.0-develop.42", + "version": "1.5.0-develop.43", "license": "MIT", "homepage": "https://punq.dev", "bin": "punq-dev.exe", - "pre_install": "Rename-Item \"$dir\\punq-dev-v1.5.0-develop.42-windows-amd64\" punq-dev.exe", + "pre_install": "Rename-Item \"$dir\\punq-dev-v1.5.0-develop.43-windows-amd64\" punq-dev.exe", "description": "A slim open-source workload manager for Kubernetes with team collaboration, WebApp, and CLI.", "architecture": { "64bit": { - "url": "https://github.com/mogenius/punq/releases/download/v1.5.0-develop.42/punq-v1.5.0-develop.42-windows-amd64", - "hash": "7dc73556e68099595610ffa00cf8f5dee6639e23641e2c8a7228c56d8e5e9bc3" + "url": "https://github.com/mogenius/punq/releases/download/v1.5.0-develop.43/punq-v1.5.0-develop.43-windows-amd64", + "hash": "d468d7ae7f41ff398b5b015f14c46c9335df3d8720a241391451ec8e05372445" } } } From b6bc58abb92337ac86b4ef5182e6ebad8769305e Mon Sep 17 00:00:00 2001 From: Benedikt Iltisberger Date: Fri, 12 Jan 2024 15:47:41 +0100 Subject: [PATCH 30/57] fix: minor fix. --- structs/command.go | 28 ++++++++++++++-------------- 1 file changed, 14 insertions(+), 14 deletions(-) diff --git a/structs/command.go b/structs/command.go index 08c43bd..31396a4 100644 --- a/structs/command.go +++ b/structs/command.go @@ -10,20 +10,20 @@ import ( ) type Command struct { - Id string `json:"id"` - JobId string `json:"jobId"` - ProjectId string `json:"projectId"` - NamespaceId *string `json:"namespaceId,omitempty"` - ServiceId *string `json:"serviceId,omitempty"` - Title string `json:"title"` - Message string `json:"message,omitempty"` - StartedAt string `json:"startedAt"` - State string `json:"state"` - DurationMs int64 `json:"durationMs"` - MustSucceed bool `json:"mustSucceed"` - ReportToNotificationSvc bool `json:"reportToNotificationService"` - IgnoreError bool `json:"ignoreError"` - BuildId int `json:"buildId,omitempty"` + Id string `json:"id"` + JobId string `json:"jobId"` + ProjectId string `json:"projectId"` + NamespaceId *string `json:"namespaceId,omitempty"` + ServiceId *string `json:"serviceId,omitempty"` + Title string `json:"title"` + Message string `json:"message,omitempty"` + StartedAt string `json:"startedAt"` + State JobStateEnum `json:"state"` + DurationMs int64 `json:"durationMs"` + MustSucceed bool `json:"mustSucceed"` + ReportToNotificationSvc bool `json:"reportToNotificationService"` + IgnoreError bool `json:"ignoreError"` + BuildId int `json:"buildId,omitempty"` Started time.Time } From 451d4fe00c06c0f0eac0fd6ff80d0c714494bff7 Mon Sep 17 00:00:00 2001 From: punq Date: Fri, 12 Jan 2024 14:50:44 +0000 Subject: [PATCH 31/57] [skip ci] scoop v1.5.0-develop.44 --- punq-dev.json | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/punq-dev.json b/punq-dev.json index d720fa6..5637758 100644 --- a/punq-dev.json +++ b/punq-dev.json @@ -1,14 +1,14 @@ { - "version": "1.5.0-develop.43", + "version": "1.5.0-develop.44", "license": "MIT", "homepage": "https://punq.dev", "bin": "punq-dev.exe", - "pre_install": "Rename-Item \"$dir\\punq-dev-v1.5.0-develop.43-windows-amd64\" punq-dev.exe", + "pre_install": "Rename-Item \"$dir\\punq-dev-v1.5.0-develop.44-windows-amd64\" punq-dev.exe", "description": "A slim open-source workload manager for Kubernetes with team collaboration, WebApp, and CLI.", "architecture": { "64bit": { - "url": "https://github.com/mogenius/punq/releases/download/v1.5.0-develop.43/punq-v1.5.0-develop.43-windows-amd64", - "hash": "d468d7ae7f41ff398b5b015f14c46c9335df3d8720a241391451ec8e05372445" + "url": "https://github.com/mogenius/punq/releases/download/v1.5.0-develop.44/punq-v1.5.0-develop.44-windows-amd64", + "hash": "dc7f43997fdf595e7d7c675df3e9075dff57c56892267f9d2f53d4df169dc162" } } } From f42e2708c28cc8090d6ca2edd634a2e7e246b195 Mon Sep 17 00:00:00 2001 From: Benedikt Iltisberger Date: Fri, 19 Jan 2024 10:09:07 +0100 Subject: [PATCH 32/57] fix: remove bash and replace with sh to reduce image size. --- Dockerfile-Operator | 2 +- structs/command.go | 4 ++-- utils/utils.go | 4 ++-- 3 files changed, 5 insertions(+), 5 deletions(-) diff --git a/Dockerfile-Operator b/Dockerfile-Operator index 9931146..cc055b0 100644 --- a/Dockerfile-Operator +++ b/Dockerfile-Operator @@ -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}" diff --git a/structs/command.go b/structs/command.go index 31396a4..83cda87 100644 --- a/structs/command.go +++ b/structs/command.go @@ -27,7 +27,7 @@ type Command struct { Started time.Time } -func ExecuteBashCommandSilent(title string, shellCmd string) { +func ExecuteShellCommandSilent(title string, shellCmd string) { var err error output, err := utils.RunOnLocalShell(shellCmd).Output() if exitErr, ok := err.(*exec.ExitError); ok { @@ -44,7 +44,7 @@ func ExecuteBashCommandSilent(title string, shellCmd string) { } } -func ExecuteBashCommandWithResponse(title string, shellCmd string) string { +func ExecuteShellCommandWithResponse(title string, shellCmd string) string { var err error var returnStr []byte returnStr, err = utils.RunOnLocalShell(shellCmd).Output() diff --git a/utils/utils.go b/utils/utils.go index fcafcd5..994a413 100644 --- a/utils/utils.go +++ b/utils/utils.go @@ -265,13 +265,13 @@ func OpenBrowser(url string) { func RunOnLocalShell(cmd string) *exec.Cmd { switch runtime.GOOS { case "linux": - return exec.Command("/bin/bash", "-c", cmd) + return exec.Command("/bin/sh", "-c", cmd) case "windows": return exec.Command("cmd", "/C", cmd) case "darwin": return exec.Command("/bin/zsh", "-c", cmd) default: - return exec.Command("/bin/bash", "-c", cmd) + return exec.Command("/bin/sh", "-c", cmd) } } From 3d1a286cf475f2de0795e97796fb2aa830926696 Mon Sep 17 00:00:00 2001 From: punq Date: Fri, 19 Jan 2024 09:16:15 +0000 Subject: [PATCH 33/57] [skip ci] scoop v1.5.0-develop.45 --- punq-dev.json | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/punq-dev.json b/punq-dev.json index 5637758..247faf0 100644 --- a/punq-dev.json +++ b/punq-dev.json @@ -1,14 +1,14 @@ { - "version": "1.5.0-develop.44", + "version": "1.5.0-develop.45", "license": "MIT", "homepage": "https://punq.dev", "bin": "punq-dev.exe", - "pre_install": "Rename-Item \"$dir\\punq-dev-v1.5.0-develop.44-windows-amd64\" punq-dev.exe", + "pre_install": "Rename-Item \"$dir\\punq-dev-v1.5.0-develop.45-windows-amd64\" punq-dev.exe", "description": "A slim open-source workload manager for Kubernetes with team collaboration, WebApp, and CLI.", "architecture": { "64bit": { - "url": "https://github.com/mogenius/punq/releases/download/v1.5.0-develop.44/punq-v1.5.0-develop.44-windows-amd64", - "hash": "dc7f43997fdf595e7d7c675df3e9075dff57c56892267f9d2f53d4df169dc162" + "url": "https://github.com/mogenius/punq/releases/download/v1.5.0-develop.45/punq-v1.5.0-develop.45-windows-amd64", + "hash": "096cafdbb83c38ed470fa77488d0760061a5b3335ab0c57f7dd3f7b3e874584d" } } } From a6bcd570edce0aa096c5659affa85afee4931c9b Mon Sep 17 00:00:00 2001 From: Benedikt Iltisberger Date: Thu, 25 Jan 2024 16:43:27 +0100 Subject: [PATCH 34/57] fix: improved OTC detection. --- kubernetes/utils.go | 13 ++++++++++++- 1 file changed, 12 insertions(+), 1 deletion(-) diff --git a/kubernetes/utils.go b/kubernetes/utils.go index 39d599d..956dd66 100644 --- a/kubernetes/utils.go +++ b/kubernetes/utils.go @@ -707,7 +707,7 @@ 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") { + } 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 @@ -735,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 { From 26c1b03a295f6c5959061e009ba3c7aaf92b917b Mon Sep 17 00:00:00 2001 From: punq Date: Thu, 25 Jan 2024 15:49:59 +0000 Subject: [PATCH 35/57] [skip ci] scoop v1.5.0-develop.46 --- punq-dev.json | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/punq-dev.json b/punq-dev.json index 247faf0..ab51a15 100644 --- a/punq-dev.json +++ b/punq-dev.json @@ -1,14 +1,14 @@ { - "version": "1.5.0-develop.45", + "version": "1.5.0-develop.46", "license": "MIT", "homepage": "https://punq.dev", "bin": "punq-dev.exe", - "pre_install": "Rename-Item \"$dir\\punq-dev-v1.5.0-develop.45-windows-amd64\" punq-dev.exe", + "pre_install": "Rename-Item \"$dir\\punq-dev-v1.5.0-develop.46-windows-amd64\" punq-dev.exe", "description": "A slim open-source workload manager for Kubernetes with team collaboration, WebApp, and CLI.", "architecture": { "64bit": { - "url": "https://github.com/mogenius/punq/releases/download/v1.5.0-develop.45/punq-v1.5.0-develop.45-windows-amd64", - "hash": "096cafdbb83c38ed470fa77488d0760061a5b3335ab0c57f7dd3f7b3e874584d" + "url": "https://github.com/mogenius/punq/releases/download/v1.5.0-develop.46/punq-v1.5.0-develop.46-windows-amd64", + "hash": "5d5db5967884cd0b9d7975052f318e9c423606d73a851e22268dcf7ec9ddecce" } } } From d8e86fd72ff8535e8b53272dd4da7984cef8afea Mon Sep 17 00:00:00 2001 From: Benedikt Iltisberger Date: Thu, 25 Jan 2024 19:48:50 +0100 Subject: [PATCH 36/57] fix: removed unused code. --- utils/parse-yaml.go | 32 --------------- utils/yaml-templates/upgrade-configmap.yaml | 27 ------------- utils/yaml-templates/upgrade-job.yaml | 44 --------------------- 3 files changed, 103 deletions(-) delete mode 100644 utils/yaml-templates/upgrade-configmap.yaml delete mode 100644 utils/yaml-templates/upgrade-job.yaml diff --git a/utils/parse-yaml.go b/utils/parse-yaml.go index 2bba9bc..79ccd35 100644 --- a/utils/parse-yaml.go +++ b/utils/parse-yaml.go @@ -322,38 +322,6 @@ func InitPunqService() core.Service { return app } -func InitUpgradeConfigMap() core.ConfigMap { - yaml, err := YamlTemplatesFolder.ReadFile("yaml-templates/upgrade-configmap.yaml") - if err != nil { - panic(err.Error()) - } - - s := json.NewYAMLSerializer(json.DefaultMetaFactory, scheme.Scheme, scheme.Scheme) - - var app core.ConfigMap - _, _, err = s.Decode(yaml, nil, &app) - if err != nil { - panic(err) - } - return app -} - -func InitUpgradeJob() v1job.Job { - yaml, err := YamlTemplatesFolder.ReadFile("yaml-templates/upgrade-job.yaml") - if err != nil { - panic(err.Error()) - } - - s := json.NewYAMLSerializer(json.DefaultMetaFactory, scheme.Scheme, scheme.Scheme) - - var app v1job.Job - _, _, err = s.Decode(yaml, nil, &app) - if err != nil { - panic(err) - } - return app -} - func InitVolumeAttachmentYaml() string { yaml, err := YamlTemplatesFolder.ReadFile("yaml-templates/volumeattachment.yaml") if err != nil { diff --git a/utils/yaml-templates/upgrade-configmap.yaml b/utils/yaml-templates/upgrade-configmap.yaml deleted file mode 100644 index 0b6ab65..0000000 --- a/utils/yaml-templates/upgrade-configmap.yaml +++ /dev/null @@ -1,27 +0,0 @@ -apiVersion: v1 -kind: ConfigMap -metadata: - labels: - app.kubernetes.io/managed-by: Helm - name: updater-cm -data: - values.command: | - # helm repo add mogenius https://helm.mogenius.com/public - # helm repo update - # helm upgrade mogenius mogenius/mogenius-platform -n default --set global.cluster_name="gcp1" \ - # --set global.api_key="mo_5a7c89c8-2386-4216-8643-e1cbc4b3f48b_osrhrjjvsq6qelkrdqaw" \ - # --set global.namespace="mogenius" \ - # --set k8smanager.enabled=true \ - # --set metrics.enabled=false \ - # --set traffic-collector.enabled=true \ - # --set pod-stats-collector.enabled=true \ - # --set ingress-nginx.enabled=true \ - # --set ingress-nginx.defaultBackend.image.registry=cinaq \ - # --set ingress-nginx.defaultBackend.image.image=default-backend \ - # --set ingress-nginx.defaultBackend.image.tag=1.2 \ - # --set ingress-nginx.defaultBackend.enabled=true \ - # --set certmanager.enabled=true \ - # --set cert-manager.startupapicheck.enabled=false \ - # --set certmanager.namespace="cert-manager" \ - # --set cert-manager.namespace=cert-manager \ - # --set cert-manager.installCRDs=true \ No newline at end of file diff --git a/utils/yaml-templates/upgrade-job.yaml b/utils/yaml-templates/upgrade-job.yaml deleted file mode 100644 index d9a5b42..0000000 --- a/utils/yaml-templates/upgrade-job.yaml +++ /dev/null @@ -1,44 +0,0 @@ -apiVersion: batch/v1 -kind: Job -metadata: - name: mo-updater -spec: - backoffLimit: 4 - completionMode: NonIndexed - completions: 1 - parallelism: 1 - template: - spec: - volumes: - - name: updater-cm - configMap: - name: updater-cm - items: - - key: values.command - path: values.command - containers: - - image: ghcr.io/mogenius/mogenius-updater:latest - imagePullPolicy: Always - name: mo-updater - volumeMounts: - - mountPath: /kubeconfig - readOnly: true - name: updater-cm - resources: {} - securityContext: - allowPrivilegeEscalation: false - capabilities: - drop: - - ALL - terminationMessagePath: /dev/termination-log - terminationMessagePolicy: File - dnsPolicy: ClusterFirst - restartPolicy: OnFailure - schedulerName: default-scheduler - serviceAccount: mogenius-k8s-manager-service-account-app - serviceAccountName: mogenius-k8s-manager-service-account-app - securityContext: - runAsNonRoot: false - seccompProfile: - type: RuntimeDefault - terminationGracePeriodSeconds: 30 \ No newline at end of file From 234f3e272fc48d9a231533b8fbf388a130e9dbe6 Mon Sep 17 00:00:00 2001 From: punq Date: Thu, 25 Jan 2024 18:51:30 +0000 Subject: [PATCH 37/57] [skip ci] scoop v1.5.0-develop.47 --- punq-dev.json | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/punq-dev.json b/punq-dev.json index ab51a15..1b4d881 100644 --- a/punq-dev.json +++ b/punq-dev.json @@ -1,14 +1,14 @@ { - "version": "1.5.0-develop.46", + "version": "1.5.0-develop.47", "license": "MIT", "homepage": "https://punq.dev", "bin": "punq-dev.exe", - "pre_install": "Rename-Item \"$dir\\punq-dev-v1.5.0-develop.46-windows-amd64\" punq-dev.exe", + "pre_install": "Rename-Item \"$dir\\punq-dev-v1.5.0-develop.47-windows-amd64\" punq-dev.exe", "description": "A slim open-source workload manager for Kubernetes with team collaboration, WebApp, and CLI.", "architecture": { "64bit": { - "url": "https://github.com/mogenius/punq/releases/download/v1.5.0-develop.46/punq-v1.5.0-develop.46-windows-amd64", - "hash": "5d5db5967884cd0b9d7975052f318e9c423606d73a851e22268dcf7ec9ddecce" + "url": "https://github.com/mogenius/punq/releases/download/v1.5.0-develop.47/punq-v1.5.0-develop.47-windows-amd64", + "hash": "bdb3b1d3bb81c59bd43952fb6f29ff5b5307044bf42fd4716026fbf35d75805e" } } } From 25d62153a1b336be912d021d6203b730fbe324c1 Mon Sep 17 00:00:00 2001 From: Benedikt Iltisberger Date: Fri, 26 Jan 2024 08:39:23 +0100 Subject: [PATCH 38/57] fix: added additional pattern. --- kubernetes/utils.go | 1 + 1 file changed, 1 insertion(+) diff --git a/kubernetes/utils.go b/kubernetes/utils.go index 956dd66..1291e33 100644 --- a/kubernetes/utils.go +++ b/kubernetes/utils.go @@ -876,6 +876,7 @@ type SystemCheckEntry struct { 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"` From 878b725c8be7e370b57e07dbbf50863eee42b441 Mon Sep 17 00:00:00 2001 From: punq Date: Fri, 26 Jan 2024 07:41:48 +0000 Subject: [PATCH 39/57] [skip ci] scoop v1.5.0-develop.48 --- punq-dev.json | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/punq-dev.json b/punq-dev.json index 1b4d881..6e581ae 100644 --- a/punq-dev.json +++ b/punq-dev.json @@ -1,14 +1,14 @@ { - "version": "1.5.0-develop.47", + "version": "1.5.0-develop.48", "license": "MIT", "homepage": "https://punq.dev", "bin": "punq-dev.exe", - "pre_install": "Rename-Item \"$dir\\punq-dev-v1.5.0-develop.47-windows-amd64\" punq-dev.exe", + "pre_install": "Rename-Item \"$dir\\punq-dev-v1.5.0-develop.48-windows-amd64\" punq-dev.exe", "description": "A slim open-source workload manager for Kubernetes with team collaboration, WebApp, and CLI.", "architecture": { "64bit": { - "url": "https://github.com/mogenius/punq/releases/download/v1.5.0-develop.47/punq-v1.5.0-develop.47-windows-amd64", - "hash": "bdb3b1d3bb81c59bd43952fb6f29ff5b5307044bf42fd4716026fbf35d75805e" + "url": "https://github.com/mogenius/punq/releases/download/v1.5.0-develop.48/punq-v1.5.0-develop.48-windows-amd64", + "hash": "3430644316715ad2c84b5a111bc28c0e3d52e07c9e1a63ac4c28c618eb3b63d6" } } } From e8de594949d3778507c58df3f416c39980b022f6 Mon Sep 17 00:00:00 2001 From: Benedikt Iltisberger Date: Fri, 26 Jan 2024 13:55:16 +0100 Subject: [PATCH 40/57] fix: system check model extended. --- kubernetes/utils.go | 26 +++++++++++++++----------- 1 file changed, 15 insertions(+), 11 deletions(-) diff --git a/kubernetes/utils.go b/kubernetes/utils.go index 1291e33..c6a2483 100644 --- a/kubernetes/utils.go +++ b/kubernetes/utils.go @@ -880,9 +880,11 @@ type SystemCheckEntry struct { 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, description string, isRequired bool, wantsToBeInstalled 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 @@ -896,6 +898,8 @@ func CreateSystemCheckEntry(checkName string, alreadyInstalled bool, message str Description: description, IsRequired: isRequired, WantsToBeInstalled: wantsToBeInstalled, + VersionInstalled: versionInstalled, + VersionAvailable: versionAvailable, } } @@ -954,40 +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, false)) + 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, false)) + 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, false)) + 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()) 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)) + 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) metricsDescription := "Maintained by Kubernetes-SIGs, handles metrics for built-in autoscaling pipelines." - result = append(result, CreateSystemCheckEntry("Metrics Server", metricsResult, metricsMsg, metricsDescription, true, true)) + 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, false)) + 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, false)) + result = append(result, CreateSystemCheckEntry("Cluster Provider", clusterProvErr == nil, clusterProviderMsg, "", false, false, "", "")) // API Versions apiVerResult, apiVerErr := ApiVersions(nil) @@ -997,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, false)) + result = append(result, CreateSystemCheckEntry("API Versions", len(apiVerResult) > 0, apiVersMsg, "", true, false, "", "")) // check cluster provider countryResult, countryErr := utils.GuessClusterCountry() @@ -1006,7 +1010,7 @@ 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, false)) + result = append(result, CreateSystemCheckEntry("Cluster Country", countryErr == nil, countryMsg, "", false, false, "", "")) lbName := "LoadBalancer IPs/Hosts" loadbalancerIps := GetClusterExternalIps(nil) @@ -1014,7 +1018,7 @@ func SystemCheck() []SystemCheckEntry { 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, false)) + result = append(result, CreateSystemCheckEntry(lbName, len(loadbalancerIps) > 0, lbIpsMsg, "", false, false, "", "")) return result } From 449e7b81ae15fa7a87e5b780f3c1052b6d5805f6 Mon Sep 17 00:00:00 2001 From: punq Date: Fri, 26 Jan 2024 12:58:00 +0000 Subject: [PATCH 41/57] [skip ci] scoop v1.5.0-develop.49 --- punq-dev.json | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/punq-dev.json b/punq-dev.json index 6e581ae..aa26653 100644 --- a/punq-dev.json +++ b/punq-dev.json @@ -1,14 +1,14 @@ { - "version": "1.5.0-develop.48", + "version": "1.5.0-develop.49", "license": "MIT", "homepage": "https://punq.dev", "bin": "punq-dev.exe", - "pre_install": "Rename-Item \"$dir\\punq-dev-v1.5.0-develop.48-windows-amd64\" punq-dev.exe", + "pre_install": "Rename-Item \"$dir\\punq-dev-v1.5.0-develop.49-windows-amd64\" punq-dev.exe", "description": "A slim open-source workload manager for Kubernetes with team collaboration, WebApp, and CLI.", "architecture": { "64bit": { - "url": "https://github.com/mogenius/punq/releases/download/v1.5.0-develop.48/punq-v1.5.0-develop.48-windows-amd64", - "hash": "3430644316715ad2c84b5a111bc28c0e3d52e07c9e1a63ac4c28c618eb3b63d6" + "url": "https://github.com/mogenius/punq/releases/download/v1.5.0-develop.49/punq-v1.5.0-develop.49-windows-amd64", + "hash": "e394537706b79d7aa07f6751bbafb87b8d36c1726b692b8d836abc8ff84d2959" } } } From eadd2eb3e14ee11b7370719057fd065af69641dc Mon Sep 17 00:00:00 2001 From: Benedikt Iltisberger Date: Thu, 22 Feb 2024 15:18:52 +0100 Subject: [PATCH 42/57] fix: nil pointer. --- kubernetes/nodes.go | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/kubernetes/nodes.go b/kubernetes/nodes.go index 8eeec34..a65a1b6 100644 --- a/kubernetes/nodes.go +++ b/kubernetes/nodes.go @@ -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() From 684e4d65dec5195d8f42bf7835d62e77dc0fab6d Mon Sep 17 00:00:00 2001 From: punq Date: Thu, 22 Feb 2024 14:26:48 +0000 Subject: [PATCH 43/57] [skip ci] scoop v1.5.0-develop.50 --- punq-dev.json | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/punq-dev.json b/punq-dev.json index aa26653..f76d967 100644 --- a/punq-dev.json +++ b/punq-dev.json @@ -1,14 +1,14 @@ { - "version": "1.5.0-develop.49", + "version": "1.5.0-develop.50", "license": "MIT", "homepage": "https://punq.dev", "bin": "punq-dev.exe", - "pre_install": "Rename-Item \"$dir\\punq-dev-v1.5.0-develop.49-windows-amd64\" punq-dev.exe", + "pre_install": "Rename-Item \"$dir\\punq-dev-v1.5.0-develop.50-windows-amd64\" punq-dev.exe", "description": "A slim open-source workload manager for Kubernetes with team collaboration, WebApp, and CLI.", "architecture": { "64bit": { - "url": "https://github.com/mogenius/punq/releases/download/v1.5.0-develop.49/punq-v1.5.0-develop.49-windows-amd64", - "hash": "e394537706b79d7aa07f6751bbafb87b8d36c1726b692b8d836abc8ff84d2959" + "url": "https://github.com/mogenius/punq/releases/download/v1.5.0-develop.50/punq-v1.5.0-develop.50-windows-amd64", + "hash": "bea721461185907200a2b8bc94011eee2cc9afe97dba3b333be0c47b489073cf" } } } From eb22c76bfbb67fe85d08f1cfe355f6e65332c810 Mon Sep 17 00:00:00 2001 From: Benedikt Iltisberger Date: Tue, 27 Feb 2024 12:47:17 +0100 Subject: [PATCH 44/57] fix: sec warnings fixed by upgrading dependencies. --- go.mod | 12 ++++++------ go.sum | 20 ++++++++++---------- 2 files changed, 16 insertions(+), 16 deletions(-) diff --git a/go.mod b/go.mod index 8129994..44e2a5b 100644 --- a/go.mod +++ b/go.mod @@ -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 @@ -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 diff --git a/go.sum b/go.sum index 406d279..5217212 100644 --- a/go.sum +++ b/go.sum @@ -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= @@ -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= @@ -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= From c8d9ef78d041fc02057ed7d700b289c97e35c26f Mon Sep 17 00:00:00 2001 From: Benedikt Iltisberger Date: Tue, 27 Feb 2024 12:57:07 +0100 Subject: [PATCH 45/57] fix: disable default CGO_ENABLE=1 to avoid glibc beeing included. --- Makefile | 1 + Makefile-dev | 1 + 2 files changed, 2 insertions(+) diff --git a/Makefile b/Makefile index ec59a61..8b3a274 100644 --- a/Makefile +++ b/Makefile @@ -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)} diff --git a/Makefile-dev b/Makefile-dev index 16ab5e7..5571a9b 100644 --- a/Makefile-dev +++ b/Makefile-dev @@ -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)} From 839300233303122e791cfc6a4bb2361b3a7afb66 Mon Sep 17 00:00:00 2001 From: punq Date: Tue, 27 Feb 2024 12:42:38 +0000 Subject: [PATCH 46/57] [skip ci] scoop v1.5.0-develop.51 --- punq-dev.json | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/punq-dev.json b/punq-dev.json index f76d967..996548e 100644 --- a/punq-dev.json +++ b/punq-dev.json @@ -1,14 +1,14 @@ { - "version": "1.5.0-develop.50", + "version": "1.5.0-develop.51", "license": "MIT", "homepage": "https://punq.dev", "bin": "punq-dev.exe", - "pre_install": "Rename-Item \"$dir\\punq-dev-v1.5.0-develop.50-windows-amd64\" punq-dev.exe", + "pre_install": "Rename-Item \"$dir\\punq-dev-v1.5.0-develop.51-windows-amd64\" punq-dev.exe", "description": "A slim open-source workload manager for Kubernetes with team collaboration, WebApp, and CLI.", "architecture": { "64bit": { - "url": "https://github.com/mogenius/punq/releases/download/v1.5.0-develop.50/punq-v1.5.0-develop.50-windows-amd64", - "hash": "bea721461185907200a2b8bc94011eee2cc9afe97dba3b333be0c47b489073cf" + "url": "https://github.com/mogenius/punq/releases/download/v1.5.0-develop.51/punq-v1.5.0-develop.51-windows-amd64", + "hash": "df0b3cf40e54c6b3d250aebb72a511e834101a9515c3654fddd781e4db89d12a" } } } From e471d937a9326ea48d6deddfe186b923a79457d7 Mon Sep 17 00:00:00 2001 From: Benedikt Iltisberger Date: Tue, 27 Feb 2024 13:54:37 +0100 Subject: [PATCH 47/57] fix: set golang 1.22 to operator. --- Dockerfile-Operator | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Dockerfile-Operator b/Dockerfile-Operator index cc055b0..6326771 100644 --- a/Dockerfile-Operator +++ b/Dockerfile-Operator @@ -1,4 +1,4 @@ -FROM golang:1.21-alpine AS builder +FROM golang:1.22-alpine AS builder ARG GOOS ARG GOARCH From 50493d737ac05fb821b47f86a85b488b3eec441b Mon Sep 17 00:00:00 2001 From: punq Date: Tue, 27 Feb 2024 12:56:46 +0000 Subject: [PATCH 48/57] [skip ci] scoop v1.5.0-develop.52 --- punq-dev.json | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/punq-dev.json b/punq-dev.json index 996548e..2f65920 100644 --- a/punq-dev.json +++ b/punq-dev.json @@ -1,14 +1,14 @@ { - "version": "1.5.0-develop.51", + "version": "1.5.0-develop.52", "license": "MIT", "homepage": "https://punq.dev", "bin": "punq-dev.exe", - "pre_install": "Rename-Item \"$dir\\punq-dev-v1.5.0-develop.51-windows-amd64\" punq-dev.exe", + "pre_install": "Rename-Item \"$dir\\punq-dev-v1.5.0-develop.52-windows-amd64\" punq-dev.exe", "description": "A slim open-source workload manager for Kubernetes with team collaboration, WebApp, and CLI.", "architecture": { "64bit": { - "url": "https://github.com/mogenius/punq/releases/download/v1.5.0-develop.51/punq-v1.5.0-develop.51-windows-amd64", - "hash": "df0b3cf40e54c6b3d250aebb72a511e834101a9515c3654fddd781e4db89d12a" + "url": "https://github.com/mogenius/punq/releases/download/v1.5.0-develop.52/punq-v1.5.0-develop.52-windows-amd64", + "hash": "75ab8e4cb3007197a2838f2f5b0a6cc38b65afb23dcf723c91718f664ffeb183" } } } From a778ba004ed4ff8ea4ef38ad3e419edcb57081fc Mon Sep 17 00:00:00 2001 From: Benedikt Iltisberger Date: Tue, 27 Feb 2024 14:05:11 +0100 Subject: [PATCH 49/57] fix: static linking. --- Makefile-dev | 16 ++++++++-------- 1 file changed, 8 insertions(+), 8 deletions(-) diff --git a/Makefile-dev b/Makefile-dev index 5571a9b..076b1db 100644 --- a/Makefile-dev +++ b/Makefile-dev @@ -45,28 +45,28 @@ test: $(GOTEST) -v ./... darwin_arm64: - GOOS=darwin GOARCH=arm64 $(GOBUILD) -ldflags="$(LDFLAGS)" -o builds/$(BINARY_NAME)-$(VERSION)-darwin-arm64 -v + GOOS=darwin GOARCH=arm64 $(GOBUILD) -ldflags="$(LDFLAGS)" --static -o builds/$(BINARY_NAME)-$(VERSION)-darwin-arm64 -v darwin_amd64: - GOOS=darwin GOARCH=amd64 $(GOBUILD) -ldflags="$(LDFLAGS)" -o builds/$(BINARY_NAME)-$(VERSION)-darwin-amd64 -v + GOOS=darwin GOARCH=amd64 $(GOBUILD) -ldflags="$(LDFLAGS)" --static -o builds/$(BINARY_NAME)-$(VERSION)-darwin-amd64 -v linux_amd64: - GOOS=linux GOARCH=amd64 $(GOBUILD) -ldflags="$(LDFLAGS)" -o builds/$(BINARY_NAME)-$(VERSION)-linux-amd64 -v + GOOS=linux GOARCH=amd64 $(GOBUILD) -ldflags="$(LDFLAGS)" --static -o builds/$(BINARY_NAME)-$(VERSION)-linux-amd64 -v linux_386: - GOOS=linux GOARCH=386 $(GOBUILD) -ldflags="$(LDFLAGS)" -o builds/$(BINARY_NAME)-$(VERSION)-linux-386 -v + GOOS=linux GOARCH=386 $(GOBUILD) -ldflags="$(LDFLAGS)" --static -o builds/$(BINARY_NAME)-$(VERSION)-linux-386 -v linux_arm64: - GOOS=linux GOARCH=arm64 $(GOBUILD) -ldflags="$(LDFLAGS)" -o builds/$(BINARY_NAME)-$(VERSION)-linux-arm64 -v + GOOS=linux GOARCH=arm64 $(GOBUILD) -ldflags="$(LDFLAGS)" --static -o builds/$(BINARY_NAME)-$(VERSION)-linux-arm64 -v linux_arm: - GOOS=linux GOARCH=arm GOARM=7 $(GOBUILD) -ldflags="$(LDFLAGS)" -o builds/$(BINARY_NAME)-$(VERSION)-linux-arm -v + GOOS=linux GOARCH=arm GOARM=7 $(GOBUILD) -ldflags="$(LDFLAGS)" --static -o builds/$(BINARY_NAME)-$(VERSION)-linux-arm -v windows_amd64: - GOOS=windows GOARCH=amd64 $(GOBUILD) -ldflags="$(LDFLAGS)" -o builds/$(BINARY_NAME)-$(VERSION)-windows-amd64 -v + GOOS=windows GOARCH=amd64 $(GOBUILD) -ldflags="$(LDFLAGS)" --static -o builds/$(BINARY_NAME)-$(VERSION)-windows-amd64 -v windows_386: - GOOS=windows GOARCH=386 $(GOBUILD) -ldflags="$(LDFLAGS)" -o builds/$(BINARY_NAME)-$(VERSION)-windows-386 -v + GOOS=windows GOARCH=386 $(GOBUILD) -ldflags="$(LDFLAGS)" --static -o builds/$(BINARY_NAME)-$(VERSION)-windows-386 -v deps: $(GOGET) ./... From 8bcfbe1f8a0633c38309fb157299d102b2e8a104 Mon Sep 17 00:00:00 2001 From: Benedikt Iltisberger Date: Tue, 27 Feb 2024 14:08:15 +0100 Subject: [PATCH 50/57] fix: static linking. --- Makefile-dev | 16 ++++++++-------- 1 file changed, 8 insertions(+), 8 deletions(-) diff --git a/Makefile-dev b/Makefile-dev index 076b1db..7147aac 100644 --- a/Makefile-dev +++ b/Makefile-dev @@ -45,28 +45,28 @@ test: $(GOTEST) -v ./... darwin_arm64: - GOOS=darwin GOARCH=arm64 $(GOBUILD) -ldflags="$(LDFLAGS)" --static -o builds/$(BINARY_NAME)-$(VERSION)-darwin-arm64 -v + GOOS=darwin GOARCH=arm64 $(GOBUILD) -ldflags="$(LDFLAGS)" -static -o builds/$(BINARY_NAME)-$(VERSION)-darwin-arm64 -v darwin_amd64: - GOOS=darwin GOARCH=amd64 $(GOBUILD) -ldflags="$(LDFLAGS)" --static -o builds/$(BINARY_NAME)-$(VERSION)-darwin-amd64 -v + GOOS=darwin GOARCH=amd64 $(GOBUILD) -ldflags="$(LDFLAGS)" -static -o builds/$(BINARY_NAME)-$(VERSION)-darwin-amd64 -v linux_amd64: - GOOS=linux GOARCH=amd64 $(GOBUILD) -ldflags="$(LDFLAGS)" --static -o builds/$(BINARY_NAME)-$(VERSION)-linux-amd64 -v + GOOS=linux GOARCH=amd64 $(GOBUILD) -ldflags="$(LDFLAGS)" -static -o builds/$(BINARY_NAME)-$(VERSION)-linux-amd64 -v linux_386: - GOOS=linux GOARCH=386 $(GOBUILD) -ldflags="$(LDFLAGS)" --static -o builds/$(BINARY_NAME)-$(VERSION)-linux-386 -v + GOOS=linux GOARCH=386 $(GOBUILD) -ldflags="$(LDFLAGS)" -static -o builds/$(BINARY_NAME)-$(VERSION)-linux-386 -v linux_arm64: - GOOS=linux GOARCH=arm64 $(GOBUILD) -ldflags="$(LDFLAGS)" --static -o builds/$(BINARY_NAME)-$(VERSION)-linux-arm64 -v + GOOS=linux GOARCH=arm64 $(GOBUILD) -ldflags="$(LDFLAGS)" -static -o builds/$(BINARY_NAME)-$(VERSION)-linux-arm64 -v linux_arm: - GOOS=linux GOARCH=arm GOARM=7 $(GOBUILD) -ldflags="$(LDFLAGS)" --static -o builds/$(BINARY_NAME)-$(VERSION)-linux-arm -v + GOOS=linux GOARCH=arm GOARM=7 $(GOBUILD) -ldflags="$(LDFLAGS)" -static -o builds/$(BINARY_NAME)-$(VERSION)-linux-arm -v windows_amd64: - GOOS=windows GOARCH=amd64 $(GOBUILD) -ldflags="$(LDFLAGS)" --static -o builds/$(BINARY_NAME)-$(VERSION)-windows-amd64 -v + GOOS=windows GOARCH=amd64 $(GOBUILD) -ldflags="$(LDFLAGS)" -static -o builds/$(BINARY_NAME)-$(VERSION)-windows-amd64 -v windows_386: - GOOS=windows GOARCH=386 $(GOBUILD) -ldflags="$(LDFLAGS)" --static -o builds/$(BINARY_NAME)-$(VERSION)-windows-386 -v + GOOS=windows GOARCH=386 $(GOBUILD) -ldflags="$(LDFLAGS)" -static -o builds/$(BINARY_NAME)-$(VERSION)-windows-386 -v deps: $(GOGET) ./... From da5cae9c97832aebe05e6a4cbf1246475af73bfb Mon Sep 17 00:00:00 2001 From: Benedikt Iltisberger Date: Tue, 27 Feb 2024 14:09:23 +0100 Subject: [PATCH 51/57] fix: static linking disabled. --- Makefile-dev | 18 +++++++++--------- 1 file changed, 9 insertions(+), 9 deletions(-) diff --git a/Makefile-dev b/Makefile-dev index 7147aac..33e070d 100644 --- a/Makefile-dev +++ b/Makefile-dev @@ -5,7 +5,7 @@ GOBUILD=$(GO) build GOCLEAN=$(GO) clean GOTEST=$(GO) test GOGET=$(GO) get -CGO_ENABLED=0 +CGO_ENABLED=1 # Ensure linker embeds versioning information VERSION=${shell git describe --tags $(git rev-list --tags --max-count=1)} @@ -45,28 +45,28 @@ test: $(GOTEST) -v ./... darwin_arm64: - GOOS=darwin GOARCH=arm64 $(GOBUILD) -ldflags="$(LDFLAGS)" -static -o builds/$(BINARY_NAME)-$(VERSION)-darwin-arm64 -v + GOOS=darwin GOARCH=arm64 $(GOBUILD) -ldflags="$(LDFLAGS)" -o builds/$(BINARY_NAME)-$(VERSION)-darwin-arm64 -v darwin_amd64: - GOOS=darwin GOARCH=amd64 $(GOBUILD) -ldflags="$(LDFLAGS)" -static -o builds/$(BINARY_NAME)-$(VERSION)-darwin-amd64 -v + GOOS=darwin GOARCH=amd64 $(GOBUILD) -ldflags="$(LDFLAGS)" -o builds/$(BINARY_NAME)-$(VERSION)-darwin-amd64 -v linux_amd64: - GOOS=linux GOARCH=amd64 $(GOBUILD) -ldflags="$(LDFLAGS)" -static -o builds/$(BINARY_NAME)-$(VERSION)-linux-amd64 -v + GOOS=linux GOARCH=amd64 $(GOBUILD) -ldflags="$(LDFLAGS)" -o builds/$(BINARY_NAME)-$(VERSION)-linux-amd64 -v linux_386: - GOOS=linux GOARCH=386 $(GOBUILD) -ldflags="$(LDFLAGS)" -static -o builds/$(BINARY_NAME)-$(VERSION)-linux-386 -v + GOOS=linux GOARCH=386 $(GOBUILD) -ldflags="$(LDFLAGS)" -o builds/$(BINARY_NAME)-$(VERSION)-linux-386 -v linux_arm64: - GOOS=linux GOARCH=arm64 $(GOBUILD) -ldflags="$(LDFLAGS)" -static -o builds/$(BINARY_NAME)-$(VERSION)-linux-arm64 -v + GOOS=linux GOARCH=arm64 $(GOBUILD) -ldflags="$(LDFLAGS)" -o builds/$(BINARY_NAME)-$(VERSION)-linux-arm64 -v linux_arm: - GOOS=linux GOARCH=arm GOARM=7 $(GOBUILD) -ldflags="$(LDFLAGS)" -static -o builds/$(BINARY_NAME)-$(VERSION)-linux-arm -v + GOOS=linux GOARCH=arm GOARM=7 $(GOBUILD) -ldflags="$(LDFLAGS)" -o builds/$(BINARY_NAME)-$(VERSION)-linux-arm -v windows_amd64: - GOOS=windows GOARCH=amd64 $(GOBUILD) -ldflags="$(LDFLAGS)" -static -o builds/$(BINARY_NAME)-$(VERSION)-windows-amd64 -v + GOOS=windows GOARCH=amd64 $(GOBUILD) -ldflags="$(LDFLAGS)" -o builds/$(BINARY_NAME)-$(VERSION)-windows-amd64 -v windows_386: - GOOS=windows GOARCH=386 $(GOBUILD) -ldflags="$(LDFLAGS)" -static -o builds/$(BINARY_NAME)-$(VERSION)-windows-386 -v + GOOS=windows GOARCH=386 $(GOBUILD) -ldflags="$(LDFLAGS)" -o builds/$(BINARY_NAME)-$(VERSION)-windows-386 -v deps: $(GOGET) ./... From 0f855e1e35da13a6bf1044079c97fbd9a09b3807 Mon Sep 17 00:00:00 2001 From: punq Date: Tue, 27 Feb 2024 13:11:32 +0000 Subject: [PATCH 52/57] [skip ci] scoop v1.5.0-develop.55 --- punq-dev.json | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/punq-dev.json b/punq-dev.json index 2f65920..4cd2985 100644 --- a/punq-dev.json +++ b/punq-dev.json @@ -1,14 +1,14 @@ { - "version": "1.5.0-develop.52", + "version": "1.5.0-develop.55", "license": "MIT", "homepage": "https://punq.dev", "bin": "punq-dev.exe", - "pre_install": "Rename-Item \"$dir\\punq-dev-v1.5.0-develop.52-windows-amd64\" punq-dev.exe", + "pre_install": "Rename-Item \"$dir\\punq-dev-v1.5.0-develop.55-windows-amd64\" punq-dev.exe", "description": "A slim open-source workload manager for Kubernetes with team collaboration, WebApp, and CLI.", "architecture": { "64bit": { - "url": "https://github.com/mogenius/punq/releases/download/v1.5.0-develop.52/punq-v1.5.0-develop.52-windows-amd64", - "hash": "75ab8e4cb3007197a2838f2f5b0a6cc38b65afb23dcf723c91718f664ffeb183" + "url": "https://github.com/mogenius/punq/releases/download/v1.5.0-develop.55/punq-v1.5.0-develop.55-windows-amd64", + "hash": "0be04e7b6494cb675ee35e79e077e1e507472c8185d268e6da4efbfa6c6f916e" } } } From 5d3fc3bfef9deab91cacff2ac79e61150e3d78dc Mon Sep 17 00:00:00 2001 From: Benedikt Iltisberger Date: Tue, 27 Feb 2024 15:17:31 +0100 Subject: [PATCH 53/57] fix: ubuntu2004 runner added. --- .github/workflows/develop.yml | 2 +- Makefile-dev | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/workflows/develop.yml b/.github/workflows/develop.yml index f579358..70690f7 100644 --- a/.github/workflows/develop.yml +++ b/.github/workflows/develop.yml @@ -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 diff --git a/Makefile-dev b/Makefile-dev index 33e070d..5571a9b 100644 --- a/Makefile-dev +++ b/Makefile-dev @@ -5,7 +5,7 @@ GOBUILD=$(GO) build GOCLEAN=$(GO) clean GOTEST=$(GO) test GOGET=$(GO) get -CGO_ENABLED=1 +CGO_ENABLED=0 # Ensure linker embeds versioning information VERSION=${shell git describe --tags $(git rev-list --tags --max-count=1)} From 9ddcf61ecc035d5acf7b248216563267cbaf192c Mon Sep 17 00:00:00 2001 From: Benedikt Iltisberger Date: Tue, 27 Feb 2024 15:37:09 +0100 Subject: [PATCH 54/57] fix: pipeline fix. --- .github/workflows/develop.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/develop.yml b/.github/workflows/develop.yml index 70690f7..77850d4 100644 --- a/.github/workflows/develop.yml +++ b/.github/workflows/develop.yml @@ -29,7 +29,7 @@ jobs: git config --global user.email "punqs@mogenius.com" 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) From 0742aba7e37c9807cf4121398e18a767231f4b4a Mon Sep 17 00:00:00 2001 From: punq Date: Tue, 27 Feb 2024 14:46:34 +0000 Subject: [PATCH 55/57] [skip ci] scoop v1.5.0-develop.56 --- punq-dev.json | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/punq-dev.json b/punq-dev.json index 4cd2985..ee0217c 100644 --- a/punq-dev.json +++ b/punq-dev.json @@ -1,14 +1,14 @@ { - "version": "1.5.0-develop.55", + "version": "1.5.0-develop.56", "license": "MIT", "homepage": "https://punq.dev", "bin": "punq-dev.exe", - "pre_install": "Rename-Item \"$dir\\punq-dev-v1.5.0-develop.55-windows-amd64\" punq-dev.exe", + "pre_install": "Rename-Item \"$dir\\punq-dev-v1.5.0-develop.56-windows-amd64\" punq-dev.exe", "description": "A slim open-source workload manager for Kubernetes with team collaboration, WebApp, and CLI.", "architecture": { "64bit": { - "url": "https://github.com/mogenius/punq/releases/download/v1.5.0-develop.55/punq-v1.5.0-develop.55-windows-amd64", - "hash": "0be04e7b6494cb675ee35e79e077e1e507472c8185d268e6da4efbfa6c6f916e" + "url": "https://github.com/mogenius/punq/releases/download/v1.5.0-develop.56/punq-v1.5.0-develop.56-windows-amd64", + "hash": "798df016d5432b466c95c8da0b26c2a94e7543a33210cfcd3d1577bb2652fb7c" } } } From 4af7c88b6ac0d97d6f83300702e08ed5921da9a3 Mon Sep 17 00:00:00 2001 From: Benedikt Iltisberger Date: Wed, 28 Feb 2024 14:05:12 +0100 Subject: [PATCH 56/57] fix: minor fix. --- .github/workflows/main.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/workflows/main.yml b/.github/workflows/main.yml index 279853f..711023c 100644 --- a/.github/workflows/main.yml +++ b/.github/workflows/main.yml @@ -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 @@ -29,7 +29,7 @@ jobs: git config --global user.email "punqs@mogenius.com" 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) From de6130123b7caa6dcd44c06e4c10ec19e18a4e93 Mon Sep 17 00:00:00 2001 From: punq Date: Wed, 28 Feb 2024 13:06:57 +0000 Subject: [PATCH 57/57] [skip ci] scoop v1.5.0-develop.57 --- punq-dev.json | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/punq-dev.json b/punq-dev.json index ee0217c..c579339 100644 --- a/punq-dev.json +++ b/punq-dev.json @@ -1,14 +1,14 @@ { - "version": "1.5.0-develop.56", + "version": "1.5.0-develop.57", "license": "MIT", "homepage": "https://punq.dev", "bin": "punq-dev.exe", - "pre_install": "Rename-Item \"$dir\\punq-dev-v1.5.0-develop.56-windows-amd64\" punq-dev.exe", + "pre_install": "Rename-Item \"$dir\\punq-dev-v1.5.0-develop.57-windows-amd64\" punq-dev.exe", "description": "A slim open-source workload manager for Kubernetes with team collaboration, WebApp, and CLI.", "architecture": { "64bit": { - "url": "https://github.com/mogenius/punq/releases/download/v1.5.0-develop.56/punq-v1.5.0-develop.56-windows-amd64", - "hash": "798df016d5432b466c95c8da0b26c2a94e7543a33210cfcd3d1577bb2652fb7c" + "url": "https://github.com/mogenius/punq/releases/download/v1.5.0-develop.57/punq-v1.5.0-develop.57-windows-amd64", + "hash": "9e048121e036634f911c7c4515e67c28ad0874f3f190f567840fce8537a48614" } } }