From c849b20cb568394c4312c855b7a2e7b7a3a0b32d Mon Sep 17 00:00:00 2001 From: Benedikt Iltisberger Date: Wed, 28 Feb 2024 14:33:23 +0100 Subject: [PATCH] fix: removed absulute path with relative path of kubectl. --- kubernetes/addResources.go | 2 +- kubernetes/certificates.go | 2 +- kubernetes/cluster-role-bindings.go | 2 +- kubernetes/cluster-roles.go | 2 +- kubernetes/clusterIssuer.go | 2 +- kubernetes/configmap.go | 2 +- kubernetes/crds.go | 2 +- kubernetes/cronjobs.go | 2 +- kubernetes/csr.go | 2 +- kubernetes/daemonsets.go | 2 +- kubernetes/deleteResources.go | 2 +- kubernetes/deployment.go | 2 +- kubernetes/endpoints.go | 2 +- kubernetes/events.go | 2 +- kubernetes/hpa.go | 2 +- kubernetes/ingress.go | 2 +- kubernetes/ingressClass.go | 2 +- kubernetes/issuer.go | 2 +- kubernetes/jobs.go | 2 +- kubernetes/leases.go | 2 +- kubernetes/namespace.go | 2 +- kubernetes/networkpolicies.go | 2 +- kubernetes/nodes.go | 2 +- kubernetes/orders.go | 2 +- kubernetes/persistent-volume-claim.go | 2 +- kubernetes/persistent-volume.go | 2 +- kubernetes/pods.go | 2 +- kubernetes/priorityclasses.go | 2 +- kubernetes/replicasets.go | 2 +- kubernetes/resourcequotas.go | 2 +- kubernetes/role-bindings.go | 2 +- kubernetes/roles.go | 2 +- kubernetes/secret.go | 2 +- kubernetes/service-accounts.go | 2 +- kubernetes/service.go | 2 +- kubernetes/statefulsets.go | 2 +- kubernetes/storageClass.go | 2 +- kubernetes/volume-attachments.go | 2 +- kubernetes/volume-snapshots.go | 2 +- utils/utils.go | 2 +- 40 files changed, 40 insertions(+), 40 deletions(-) diff --git a/kubernetes/addResources.go b/kubernetes/addResources.go index cb24d34..19fcad8 100644 --- a/kubernetes/addResources.go +++ b/kubernetes/addResources.go @@ -132,7 +132,7 @@ func addTraefikMiddleware(provider *KubeProvider, ingressHostname string) { if runtime.GOOS == "windows" { cmd = utils.RunOnLocalShell(fmt.Sprintf("kubectl apply -f %s%s", fileName, ContextFlag(nil))) } else { - cmd = utils.RunOnLocalShell(fmt.Sprintf("/usr/local/bin/kubectl apply -f %s%s", fileName, ContextFlag(nil))) + cmd = utils.RunOnLocalShell(fmt.Sprintf("kubectl apply -f %s%s", fileName, ContextFlag(nil))) } output, err := cmd.CombinedOutput() diff --git a/kubernetes/certificates.go b/kubernetes/certificates.go index 223a9b7..9752d62 100644 --- a/kubernetes/certificates.go +++ b/kubernetes/certificates.go @@ -103,7 +103,7 @@ func DeleteK8sCertificateBy(namespace string, name string, contextId *string) er } func DescribeK8sCertificate(namespace string, name string, contextId *string) utils.K8sWorkloadResult { - cmd := utils.RunOnLocalShell(fmt.Sprintf("/usr/local/bin/kubectl describe certificate %s -n %s%s", name, namespace, ContextFlag(contextId))) + cmd := utils.RunOnLocalShell(fmt.Sprintf("kubectl describe certificate %s -n %s%s", name, namespace, ContextFlag(contextId))) output, err := cmd.CombinedOutput() if err != nil { diff --git a/kubernetes/cluster-role-bindings.go b/kubernetes/cluster-role-bindings.go index f0e4895..e6b28aa 100644 --- a/kubernetes/cluster-role-bindings.go +++ b/kubernetes/cluster-role-bindings.go @@ -75,7 +75,7 @@ func DeleteK8sClusterRoleBindingBy(name string, contextId *string) error { } func DescribeK8sClusterRoleBinding(name string, contextId *string) utils.K8sWorkloadResult { - cmd := utils.RunOnLocalShell(fmt.Sprintf("/usr/local/bin/kubectl describe clusterrolebinding %s%s", name, ContextFlag(contextId))) + cmd := utils.RunOnLocalShell(fmt.Sprintf("kubectl describe clusterrolebinding %s%s", name, ContextFlag(contextId))) output, err := cmd.CombinedOutput() if err != nil { diff --git a/kubernetes/cluster-roles.go b/kubernetes/cluster-roles.go index 7d7ebd0..82e1a61 100644 --- a/kubernetes/cluster-roles.go +++ b/kubernetes/cluster-roles.go @@ -78,7 +78,7 @@ func DeleteK8sClusterRoleBy(name string, contextId *string) error { } func DescribeK8sClusterRole(name string, contextId *string) utils.K8sWorkloadResult { - cmd := utils.RunOnLocalShell(fmt.Sprintf("/usr/local/bin/kubectl describe clusterrole %s%s", name, ContextFlag(contextId))) + cmd := utils.RunOnLocalShell(fmt.Sprintf("kubectl describe clusterrole %s%s", name, ContextFlag(contextId))) output, err := cmd.CombinedOutput() if err != nil { diff --git a/kubernetes/clusterIssuer.go b/kubernetes/clusterIssuer.go index 545102a..9f13586 100644 --- a/kubernetes/clusterIssuer.go +++ b/kubernetes/clusterIssuer.go @@ -77,7 +77,7 @@ func DeleteK8sClusterIssuerBy(name string, contextId *string) error { } func DescribeK8sClusterIssuer(name string, contextId *string) utils.K8sWorkloadResult { - cmd := utils.RunOnLocalShell(fmt.Sprintf("/usr/local/bin/kubectl describe clusterissuer %s%s", name, ContextFlag(contextId))) + cmd := utils.RunOnLocalShell(fmt.Sprintf("kubectl describe clusterissuer %s%s", name, ContextFlag(contextId))) output, err := cmd.CombinedOutput() if err != nil { diff --git a/kubernetes/configmap.go b/kubernetes/configmap.go index f1e84ee..12f413a 100644 --- a/kubernetes/configmap.go +++ b/kubernetes/configmap.go @@ -115,7 +115,7 @@ func DeleteK8sConfigmapBy(namespaceName string, name string, contextId *string) } func DescribeK8sConfigmap(namespace string, name string, contextId *string) utils.K8sWorkloadResult { - cmd := utils.RunOnLocalShell(fmt.Sprintf("/usr/local/bin/kubectl describe configmap %s -n %s%s", name, namespace, ContextFlag(contextId))) + cmd := utils.RunOnLocalShell(fmt.Sprintf("kubectl describe configmap %s -n %s%s", name, namespace, ContextFlag(contextId))) output, err := cmd.CombinedOutput() if err != nil { diff --git a/kubernetes/crds.go b/kubernetes/crds.go index 5ed5052..700f1ad 100644 --- a/kubernetes/crds.go +++ b/kubernetes/crds.go @@ -56,7 +56,7 @@ func DeleteK8sCustomResourceDefinition(data apiExt.CustomResourceDefinition) uti } func DescribeK8sCustomResourceDefinition(name string, contextId *string) utils.K8sWorkloadResult { - cmd := utils.RunOnLocalShell(fmt.Sprintf("/usr/local/bin/kubectl describe crds %s%s", name, ContextFlag(contextId))) + cmd := utils.RunOnLocalShell(fmt.Sprintf("kubectl describe crds %s%s", name, ContextFlag(contextId))) output, err := cmd.CombinedOutput() if err != nil { diff --git a/kubernetes/cronjobs.go b/kubernetes/cronjobs.go index f3d7ef5..4a701d1 100644 --- a/kubernetes/cronjobs.go +++ b/kubernetes/cronjobs.go @@ -77,7 +77,7 @@ func DeleteK8sCronJobBy(namespace string, name string, contextId *string) error } func DescribeK8sCronJob(namespace string, name string, contextId *string) utils.K8sWorkloadResult { - cmd := utils.RunOnLocalShell(fmt.Sprintf("/usr/local/bin/kubectl describe cronjob %s -n %s%s", name, namespace, ContextFlag(contextId))) + cmd := utils.RunOnLocalShell(fmt.Sprintf("kubectl describe cronjob %s -n %s%s", name, namespace, ContextFlag(contextId))) output, err := cmd.CombinedOutput() if err != nil { diff --git a/kubernetes/csr.go b/kubernetes/csr.go index f7683a9..70027b4 100644 --- a/kubernetes/csr.go +++ b/kubernetes/csr.go @@ -77,7 +77,7 @@ func DeleteK8sCertificateSigningRequestBy(namespace string, name string, context } func DescribeK8sCertificateSigningRequest(namespace string, name string, contextId *string) utils.K8sWorkloadResult { - cmd := utils.RunOnLocalShell(fmt.Sprintf("/usr/local/bin/kubectl describe -n %s csr%s", name, ContextFlag(contextId))) + cmd := utils.RunOnLocalShell(fmt.Sprintf("kubectl describe -n %s csr%s", name, ContextFlag(contextId))) output, err := cmd.CombinedOutput() if err != nil { diff --git a/kubernetes/daemonsets.go b/kubernetes/daemonsets.go index 3720d8d..a3e0afc 100644 --- a/kubernetes/daemonsets.go +++ b/kubernetes/daemonsets.go @@ -98,7 +98,7 @@ func DeleteK8sDaemonSetBy(namespace string, name string, contextId *string) erro } func DescribeK8sDaemonSet(namespace string, name string, contextId *string) utils.K8sWorkloadResult { - cmd := utils.RunOnLocalShell(fmt.Sprintf("/usr/local/bin/kubectl describe daemonset %s -n %s%s", name, namespace, ContextFlag(contextId))) + cmd := utils.RunOnLocalShell(fmt.Sprintf("kubectl describe daemonset %s -n %s%s", name, namespace, ContextFlag(contextId))) output, err := cmd.CombinedOutput() if err != nil { diff --git a/kubernetes/deleteResources.go b/kubernetes/deleteResources.go index 606c5b6..a5e0ab1 100644 --- a/kubernetes/deleteResources.go +++ b/kubernetes/deleteResources.go @@ -82,7 +82,7 @@ func removeIngress(provider *KubeProvider) { } if ingressControllerType == TRAEFIK { fmt.Printf("Deleting TRAEFIK middleware ...\n") - cmd := utils.RunOnLocalShell(fmt.Sprintf("/usr/local/bin/kubectl delete middleware mw-backend -n %s", utils.CONFIG.Kubernetes.OwnNamespace)) + cmd := utils.RunOnLocalShell(fmt.Sprintf("kubectl delete middleware mw-backend -n %s", utils.CONFIG.Kubernetes.OwnNamespace)) output, err := cmd.CombinedOutput() if err != nil { diff --git a/kubernetes/deployment.go b/kubernetes/deployment.go index f377742..16d3e89 100644 --- a/kubernetes/deployment.go +++ b/kubernetes/deployment.go @@ -111,7 +111,7 @@ func DeleteK8sDeploymentBy(namespace string, name string, contextId *string) err } func DescribeK8sDeployment(namespace string, name string, contextId *string) utils.K8sWorkloadResult { - cmd := utils.RunOnLocalShell(fmt.Sprintf("/usr/local/bin/kubectl describe deployment %s -n %s%s", name, namespace, ContextFlag(contextId))) + cmd := utils.RunOnLocalShell(fmt.Sprintf("kubectl describe deployment %s -n %s%s", name, namespace, ContextFlag(contextId))) output, err := cmd.CombinedOutput() if err != nil { diff --git a/kubernetes/endpoints.go b/kubernetes/endpoints.go index 8e57ffd..941ef46 100644 --- a/kubernetes/endpoints.go +++ b/kubernetes/endpoints.go @@ -76,7 +76,7 @@ func DeleteK8sEndpointBy(namespace string, name string, contextId *string) error } func DescribeK8sEndpoint(namespace string, name string, contextId *string) utils.K8sWorkloadResult { - cmd := utils.RunOnLocalShell(fmt.Sprintf("/usr/local/bin/kubectl describe endpoint %s -n %s%s", name, namespace, ContextFlag(contextId))) + cmd := utils.RunOnLocalShell(fmt.Sprintf("kubectl describe endpoint %s -n %s%s", name, namespace, ContextFlag(contextId))) output, err := cmd.CombinedOutput() if err != nil { diff --git a/kubernetes/events.go b/kubernetes/events.go index ab10efe..fbd4d4d 100644 --- a/kubernetes/events.go +++ b/kubernetes/events.go @@ -41,7 +41,7 @@ func GetEvent(namespaceName string, name string, contextId *string) (*v1Core.Eve } func DescribeK8sEvent(namespace string, name string, contextId *string) utils.K8sWorkloadResult { - cmd := utils.RunOnLocalShell(fmt.Sprintf("/usr/local/bin/kubectl describe event %s -n %s%s", name, namespace, ContextFlag(contextId))) + cmd := utils.RunOnLocalShell(fmt.Sprintf("kubectl describe event %s -n %s%s", name, namespace, ContextFlag(contextId))) output, err := cmd.CombinedOutput() if err != nil { diff --git a/kubernetes/hpa.go b/kubernetes/hpa.go index 4c7f4ea..00dd089 100644 --- a/kubernetes/hpa.go +++ b/kubernetes/hpa.go @@ -77,7 +77,7 @@ func DeleteK8sHpaBy(namespace string, name string, contextId *string) error { } func DescribeK8sHpa(namespace string, name string, contextId *string) utils.K8sWorkloadResult { - cmd := utils.RunOnLocalShell(fmt.Sprintf("/usr/local/bin/kubectl describe hpa %s -n %s%s", name, namespace, ContextFlag(contextId))) + cmd := utils.RunOnLocalShell(fmt.Sprintf("kubectl describe hpa %s -n %s%s", name, namespace, ContextFlag(contextId))) output, err := cmd.CombinedOutput() if err != nil { diff --git a/kubernetes/ingress.go b/kubernetes/ingress.go index 3f330b0..a460395 100644 --- a/kubernetes/ingress.go +++ b/kubernetes/ingress.go @@ -101,7 +101,7 @@ func DeleteK8sIngressBy(namespace string, name string, contextId *string) error } func DescribeK8sIngress(namespace string, name string, contextId *string) utils.K8sWorkloadResult { - cmd := utils.RunOnLocalShell(fmt.Sprintf("/usr/local/bin/kubectl describe ingress %s -n %s%s", name, namespace, ContextFlag(contextId))) + cmd := utils.RunOnLocalShell(fmt.Sprintf("kubectl describe ingress %s -n %s%s", name, namespace, ContextFlag(contextId))) output, err := cmd.CombinedOutput() if err != nil { diff --git a/kubernetes/ingressClass.go b/kubernetes/ingressClass.go index 43923d9..d6d44da 100644 --- a/kubernetes/ingressClass.go +++ b/kubernetes/ingressClass.go @@ -91,7 +91,7 @@ func DeleteK8sIngressClassBy(name string, contextId *string) error { } func DescribeK8sIngressClass(name string, contextId *string) utils.K8sWorkloadResult { - cmd := utils.RunOnLocalShell(fmt.Sprintf("/usr/local/bin/kubectl describe ingressclass %s%s", name, ContextFlag(contextId))) + cmd := utils.RunOnLocalShell(fmt.Sprintf("kubectl describe ingressclass %s%s", name, ContextFlag(contextId))) output, err := cmd.CombinedOutput() if err != nil { diff --git a/kubernetes/issuer.go b/kubernetes/issuer.go index e4f96a5..dd9974d 100644 --- a/kubernetes/issuer.go +++ b/kubernetes/issuer.go @@ -77,7 +77,7 @@ func DeleteK8sIssuerBy(namespace string, name string, contextId *string) error { } func DescribeK8sIssuer(namespace string, name string, contextId *string) utils.K8sWorkloadResult { - cmd := utils.RunOnLocalShell(fmt.Sprintf("/usr/local/bin/kubectl describe issuer %s -n %s%s", name, namespace, ContextFlag(contextId))) + cmd := utils.RunOnLocalShell(fmt.Sprintf("kubectl describe issuer %s -n %s%s", name, namespace, ContextFlag(contextId))) output, err := cmd.CombinedOutput() if err != nil { diff --git a/kubernetes/jobs.go b/kubernetes/jobs.go index 20f0088..fa8402e 100644 --- a/kubernetes/jobs.go +++ b/kubernetes/jobs.go @@ -77,7 +77,7 @@ func DeleteK8sJobBy(namespace string, name string, contextId *string) error { } func DescribeK8sJob(namespace string, name string, contextId *string) utils.K8sWorkloadResult { - cmd := utils.RunOnLocalShell(fmt.Sprintf("/usr/local/bin/kubectl describe job %s -n %s%s", name, namespace, ContextFlag(contextId))) + cmd := utils.RunOnLocalShell(fmt.Sprintf("kubectl describe job %s -n %s%s", name, namespace, ContextFlag(contextId))) output, err := cmd.CombinedOutput() if err != nil { diff --git a/kubernetes/leases.go b/kubernetes/leases.go index 3a1c5d3..2069fac 100644 --- a/kubernetes/leases.go +++ b/kubernetes/leases.go @@ -78,7 +78,7 @@ func DeleteK8sLeaseBy(namespace string, name string, contextId *string) error { } func DescribeK8sLease(namespace string, name string, contextId *string) utils.K8sWorkloadResult { - cmd := utils.RunOnLocalShell(fmt.Sprintf("/usr/local/bin/kubectl describe lease %s -n %s%s", name, namespace, ContextFlag(contextId))) + cmd := utils.RunOnLocalShell(fmt.Sprintf("kubectl describe lease %s -n %s%s", name, namespace, ContextFlag(contextId))) output, err := cmd.CombinedOutput() if err != nil { diff --git a/kubernetes/namespace.go b/kubernetes/namespace.go index 2ce0c05..7084c6c 100644 --- a/kubernetes/namespace.go +++ b/kubernetes/namespace.go @@ -115,7 +115,7 @@ func DeleteK8sNamespaceBy(name string, contextId *string) error { } func DescribeK8sNamespace(name string, contextId *string) utils.K8sWorkloadResult { - cmd := utils.RunOnLocalShell(fmt.Sprintf("/usr/local/bin/kubectl describe namespace %s%s", name, ContextFlag(contextId))) + cmd := utils.RunOnLocalShell(fmt.Sprintf("kubectl describe namespace %s%s", name, ContextFlag(contextId))) output, err := cmd.CombinedOutput() if err != nil { diff --git a/kubernetes/networkpolicies.go b/kubernetes/networkpolicies.go index 5c442f6..64394a9 100644 --- a/kubernetes/networkpolicies.go +++ b/kubernetes/networkpolicies.go @@ -77,7 +77,7 @@ func DeleteK8sNetworkPolicyBy(namespace string, name string, contextId *string) } func DescribeK8sNetworkPolicy(namespace string, name string, contextId *string) utils.K8sWorkloadResult { - cmd := utils.RunOnLocalShell(fmt.Sprintf("/usr/local/bin/kubectl describe netpol %s -n %s%s", name, namespace, ContextFlag(contextId))) + cmd := utils.RunOnLocalShell(fmt.Sprintf("kubectl describe netpol %s -n %s%s", name, namespace, ContextFlag(contextId))) output, err := cmd.CombinedOutput() if err != nil { diff --git a/kubernetes/nodes.go b/kubernetes/nodes.go index a65a1b6..88587ee 100644 --- a/kubernetes/nodes.go +++ b/kubernetes/nodes.go @@ -157,7 +157,7 @@ func DeleteK8sNode(name string, contextId *string) error { } func DescribeK8sNode(name string, contextId *string) utils.K8sWorkloadResult { - cmd := utils.RunOnLocalShell(fmt.Sprintf("/usr/local/bin/kubectl describe node %s%s", name, ContextFlag(contextId))) + cmd := utils.RunOnLocalShell(fmt.Sprintf("kubectl describe node %s%s", name, ContextFlag(contextId))) output, err := cmd.CombinedOutput() if err != nil { diff --git a/kubernetes/orders.go b/kubernetes/orders.go index fdb65e2..f0de0f7 100644 --- a/kubernetes/orders.go +++ b/kubernetes/orders.go @@ -77,7 +77,7 @@ func DeleteK8sOrderBy(namespace string, name string, contextId *string) error { } func DescribeK8sOrder(namespace string, name string, contextId *string) utils.K8sWorkloadResult { - cmd := utils.RunOnLocalShell(fmt.Sprintf("/usr/local/bin/kubectl describe order %s -n %s%s", name, namespace, ContextFlag(contextId))) + cmd := utils.RunOnLocalShell(fmt.Sprintf("kubectl describe order %s -n %s%s", name, namespace, ContextFlag(contextId))) output, err := cmd.CombinedOutput() if err != nil { diff --git a/kubernetes/persistent-volume-claim.go b/kubernetes/persistent-volume-claim.go index 93a2456..9b85e04 100644 --- a/kubernetes/persistent-volume-claim.go +++ b/kubernetes/persistent-volume-claim.go @@ -90,7 +90,7 @@ func DeleteK8sPersistentVolumeClaimBy(namespace string, name string, contextId * } func DescribeK8sPersistentVolumeClaim(namespace string, name string, contextId *string) utils.K8sWorkloadResult { - cmd := utils.RunOnLocalShell(fmt.Sprintf("/usr/local/bin/kubectl describe persistentvolumeclaim %s -n %s%s", name, namespace, ContextFlag(contextId))) + cmd := utils.RunOnLocalShell(fmt.Sprintf("kubectl describe persistentvolumeclaim %s -n %s%s", name, namespace, ContextFlag(contextId))) output, err := cmd.CombinedOutput() if err != nil { diff --git a/kubernetes/persistent-volume.go b/kubernetes/persistent-volume.go index 396a3bc..abd7768 100644 --- a/kubernetes/persistent-volume.go +++ b/kubernetes/persistent-volume.go @@ -90,7 +90,7 @@ func DeleteK8sPersistentVolumeBy(name string, contextId *string) error { } func DescribeK8sPersistentVolume(name string, contextId *string) utils.K8sWorkloadResult { - cmd := utils.RunOnLocalShell(fmt.Sprintf("/usr/local/bin/kubectl describe persistentvolume %s%s", name, ContextFlag(contextId))) + cmd := utils.RunOnLocalShell(fmt.Sprintf("kubectl describe persistentvolume %s%s", name, ContextFlag(contextId))) output, err := cmd.CombinedOutput() if err != nil { diff --git a/kubernetes/pods.go b/kubernetes/pods.go index b278134..e3faa3d 100644 --- a/kubernetes/pods.go +++ b/kubernetes/pods.go @@ -308,7 +308,7 @@ func DeleteK8sPodBy(namespace string, name string, contextId *string) error { } func DescribeK8sPod(namespace string, name string, contextId *string) utils.K8sWorkloadResult { - cmd := utils.RunOnLocalShell(fmt.Sprintf("/usr/local/bin/kubectl describe pod %s -n %s%s", name, namespace, ContextFlag(contextId))) + cmd := utils.RunOnLocalShell(fmt.Sprintf("kubectl describe pod %s -n %s%s", name, namespace, ContextFlag(contextId))) output, err := cmd.CombinedOutput() if err != nil { diff --git a/kubernetes/priorityclasses.go b/kubernetes/priorityclasses.go index 5e5fa87..6a9db9b 100644 --- a/kubernetes/priorityclasses.go +++ b/kubernetes/priorityclasses.go @@ -78,7 +78,7 @@ func DeleteK8sPriorityClassBy(name string, contextId *string) error { } func DescribeK8sPriorityClass(name string, contextId *string) utils.K8sWorkloadResult { - cmd := utils.RunOnLocalShell(fmt.Sprintf("/usr/local/bin/kubectl describe priorityclasses %s%s", name, ContextFlag(contextId))) + cmd := utils.RunOnLocalShell(fmt.Sprintf("kubectl describe priorityclasses %s%s", name, ContextFlag(contextId))) output, err := cmd.CombinedOutput() if err != nil { diff --git a/kubernetes/replicasets.go b/kubernetes/replicasets.go index 12b67ac..6dd000d 100644 --- a/kubernetes/replicasets.go +++ b/kubernetes/replicasets.go @@ -98,7 +98,7 @@ func DeleteK8sReplicasetBy(namespace string, name string, contextId *string) err } func DescribeK8sReplicaset(namespace string, name string, contextId *string) utils.K8sWorkloadResult { - cmd := utils.RunOnLocalShell(fmt.Sprintf("/usr/local/bin/kubectl describe replicaset %s -n %s%s", name, namespace, ContextFlag(contextId))) + cmd := utils.RunOnLocalShell(fmt.Sprintf("kubectl describe replicaset %s -n %s%s", name, namespace, ContextFlag(contextId))) output, err := cmd.CombinedOutput() if err != nil { diff --git a/kubernetes/resourcequotas.go b/kubernetes/resourcequotas.go index 103a2bb..7ed7471 100644 --- a/kubernetes/resourcequotas.go +++ b/kubernetes/resourcequotas.go @@ -78,7 +78,7 @@ func DeleteK8sResourceQuotaBy(namespace string, name string, contextId *string) } func DescribeK8sResourceQuota(namespace string, name string, contextId *string) utils.K8sWorkloadResult { - cmd := utils.RunOnLocalShell(fmt.Sprintf("/usr/local/bin/kubectl describe resourcequotas %s -n %s%s", name, namespace, ContextFlag(contextId))) + cmd := utils.RunOnLocalShell(fmt.Sprintf("kubectl describe resourcequotas %s -n %s%s", name, namespace, ContextFlag(contextId))) output, err := cmd.CombinedOutput() if err != nil { diff --git a/kubernetes/role-bindings.go b/kubernetes/role-bindings.go index fefe3c5..57d0d68 100644 --- a/kubernetes/role-bindings.go +++ b/kubernetes/role-bindings.go @@ -77,7 +77,7 @@ func DeleteK8sRoleBindingBy(namespace string, name string, contextId *string) er } func DescribeK8sRoleBinding(namespace string, name string, contextId *string) utils.K8sWorkloadResult { - cmd := utils.RunOnLocalShell(fmt.Sprintf("/usr/local/bin/kubectl describe rolebinding %s -n %s%s", name, namespace, ContextFlag(contextId))) + cmd := utils.RunOnLocalShell(fmt.Sprintf("kubectl describe rolebinding %s -n %s%s", name, namespace, ContextFlag(contextId))) output, err := cmd.CombinedOutput() if err != nil { diff --git a/kubernetes/roles.go b/kubernetes/roles.go index 5a99719..00cae49 100644 --- a/kubernetes/roles.go +++ b/kubernetes/roles.go @@ -77,7 +77,7 @@ func DeleteK8sRoleBy(namespace string, name string, contextId *string) error { } func DescribeK8sRole(namespace string, name string, contextId *string) utils.K8sWorkloadResult { - cmd := utils.RunOnLocalShell(fmt.Sprintf("/usr/local/bin/kubectl describe role %s -n %s%s", name, namespace, ContextFlag(contextId))) + cmd := utils.RunOnLocalShell(fmt.Sprintf("kubectl describe role %s -n %s%s", name, namespace, ContextFlag(contextId))) output, err := cmd.CombinedOutput() if err != nil { diff --git a/kubernetes/secret.go b/kubernetes/secret.go index 738a4bb..aa7e232 100644 --- a/kubernetes/secret.go +++ b/kubernetes/secret.go @@ -138,7 +138,7 @@ func DeleteK8sSecretBy(namespace string, name string, contextId *string) error { } func DescribeK8sSecret(namespace string, name string, contextId *string) utils.K8sWorkloadResult { - cmd := utils.RunOnLocalShell(fmt.Sprintf("/usr/local/bin/kubectl describe secret %s -n %s%s", name, namespace, ContextFlag(contextId))) + cmd := utils.RunOnLocalShell(fmt.Sprintf("kubectl describe secret %s -n %s%s", name, namespace, ContextFlag(contextId))) output, err := cmd.CombinedOutput() if err != nil { diff --git a/kubernetes/service-accounts.go b/kubernetes/service-accounts.go index b4e577a..e7eb79a 100644 --- a/kubernetes/service-accounts.go +++ b/kubernetes/service-accounts.go @@ -78,7 +78,7 @@ func DeleteK8sServiceAccountBy(namespace string, name string, contextId *string) } func DescribeK8sServiceAccount(namespace string, name string, contextId *string) utils.K8sWorkloadResult { - cmd := utils.RunOnLocalShell(fmt.Sprintf("/usr/local/bin/kubectl describe serviceaccount %s -n %s%s", name, namespace, ContextFlag(contextId))) + cmd := utils.RunOnLocalShell(fmt.Sprintf("kubectl describe serviceaccount %s -n %s%s", name, namespace, ContextFlag(contextId))) output, err := cmd.CombinedOutput() if err != nil { diff --git a/kubernetes/service.go b/kubernetes/service.go index 4646b69..abb03df 100644 --- a/kubernetes/service.go +++ b/kubernetes/service.go @@ -109,7 +109,7 @@ func DeleteK8sServiceBy(namespace string, name string, contextId *string) error } func DescribeK8sService(namespace string, name string, contextId *string) utils.K8sWorkloadResult { - cmd := utils.RunOnLocalShell(fmt.Sprintf("/usr/local/bin/kubectl describe service %s -n %s%s", name, namespace, ContextFlag(contextId))) + cmd := utils.RunOnLocalShell(fmt.Sprintf("kubectl describe service %s -n %s%s", name, namespace, ContextFlag(contextId))) output, err := cmd.CombinedOutput() if err != nil { diff --git a/kubernetes/statefulsets.go b/kubernetes/statefulsets.go index e350012..500241a 100644 --- a/kubernetes/statefulsets.go +++ b/kubernetes/statefulsets.go @@ -77,7 +77,7 @@ func DeleteK8sStatefulsetBy(namespace string, name string, contextId *string) er } func DescribeK8sStatefulset(namespace string, name string, contextId *string) utils.K8sWorkloadResult { - cmd := utils.RunOnLocalShell(fmt.Sprintf("/usr/local/bin/kubectl describe statefulset %s -n %s%s", name, namespace, ContextFlag(contextId))) + cmd := utils.RunOnLocalShell(fmt.Sprintf("kubectl describe statefulset %s -n %s%s", name, namespace, ContextFlag(contextId))) output, err := cmd.CombinedOutput() if err != nil { diff --git a/kubernetes/storageClass.go b/kubernetes/storageClass.go index 8ff52d6..9b2972b 100644 --- a/kubernetes/storageClass.go +++ b/kubernetes/storageClass.go @@ -73,7 +73,7 @@ func DeleteK8sStorageClassBy(name string, contextId *string) error { } func DescribeK8sStorageClass(name string, contextId *string) utils.K8sWorkloadResult { - cmd := utils.RunOnLocalShell(fmt.Sprintf("/usr/local/bin/kubectl describe storageclass %s%s", name, ContextFlag(contextId))) + cmd := utils.RunOnLocalShell(fmt.Sprintf("kubectl describe storageclass %s%s", name, ContextFlag(contextId))) output, err := cmd.CombinedOutput() if err != nil { diff --git a/kubernetes/volume-attachments.go b/kubernetes/volume-attachments.go index 95db012..7738d7f 100644 --- a/kubernetes/volume-attachments.go +++ b/kubernetes/volume-attachments.go @@ -72,7 +72,7 @@ func DeleteK8sVolumeAttachmentBy(name string, contextId *string) error { } func DescribeK8sVolumeAttachment(name string, contextId *string) utils.K8sWorkloadResult { - cmd := utils.RunOnLocalShell(fmt.Sprintf("/usr/local/bin/kubectl describe volumeattachment %s%s", name, ContextFlag(contextId))) + cmd := utils.RunOnLocalShell(fmt.Sprintf("kubectl describe volumeattachment %s%s", name, ContextFlag(contextId))) output, err := cmd.CombinedOutput() if err != nil { diff --git a/kubernetes/volume-snapshots.go b/kubernetes/volume-snapshots.go index 717868b..016ebe8 100644 --- a/kubernetes/volume-snapshots.go +++ b/kubernetes/volume-snapshots.go @@ -63,7 +63,7 @@ func DeleteK8sVolumeSnapshotBy(namespace string, name string, contextId *string) } func DescribeK8sVolumeSnapshot(namespace string, name string, contextId *string) utils.K8sWorkloadResult { - cmd := utils.RunOnLocalShell(fmt.Sprintf("/usr/local/bin/kubectl describe volumesnapshots %s -n %s%s", name, namespace, ContextFlag(contextId))) + cmd := utils.RunOnLocalShell(fmt.Sprintf("kubectl describe volumesnapshots %s -n %s%s", name, namespace, ContextFlag(contextId))) output, err := cmd.CombinedOutput() if err != nil { diff --git a/utils/utils.go b/utils/utils.go index 994a413..7a1cc62 100644 --- a/utils/utils.go +++ b/utils/utils.go @@ -466,7 +466,7 @@ func CheckInternetAccess() (bool, error) { } func IsKubectlInstalled() (bool, string, error) { - cmd := RunOnLocalShell("/usr/local/bin/kubectl version") + cmd := RunOnLocalShell("kubectl version") output, err := cmd.CombinedOutput() return err == nil, strings.TrimRight(string(output), "\n\r"), err }