Skip to content

Commit

Permalink
fix: removed absulute path with relative path of kubectl.
Browse files Browse the repository at this point in the history
  • Loading branch information
beneiltis committed Feb 28, 2024
1 parent de61301 commit c849b20
Show file tree
Hide file tree
Showing 40 changed files with 40 additions and 40 deletions.
2 changes: 1 addition & 1 deletion kubernetes/addResources.go
Original file line number Diff line number Diff line change
Expand Up @@ -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()
Expand Down
2 changes: 1 addition & 1 deletion kubernetes/certificates.go
Original file line number Diff line number Diff line change
Expand Up @@ -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 {
Expand Down
2 changes: 1 addition & 1 deletion kubernetes/cluster-role-bindings.go
Original file line number Diff line number Diff line change
Expand Up @@ -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 {
Expand Down
2 changes: 1 addition & 1 deletion kubernetes/cluster-roles.go
Original file line number Diff line number Diff line change
Expand Up @@ -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 {
Expand Down
2 changes: 1 addition & 1 deletion kubernetes/clusterIssuer.go
Original file line number Diff line number Diff line change
Expand Up @@ -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 {
Expand Down
2 changes: 1 addition & 1 deletion kubernetes/configmap.go
Original file line number Diff line number Diff line change
Expand Up @@ -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 {
Expand Down
2 changes: 1 addition & 1 deletion kubernetes/crds.go
Original file line number Diff line number Diff line change
Expand Up @@ -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 {
Expand Down
2 changes: 1 addition & 1 deletion kubernetes/cronjobs.go
Original file line number Diff line number Diff line change
Expand Up @@ -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 {
Expand Down
2 changes: 1 addition & 1 deletion kubernetes/csr.go
Original file line number Diff line number Diff line change
Expand Up @@ -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 {
Expand Down
2 changes: 1 addition & 1 deletion kubernetes/daemonsets.go
Original file line number Diff line number Diff line change
Expand Up @@ -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 {
Expand Down
2 changes: 1 addition & 1 deletion kubernetes/deleteResources.go
Original file line number Diff line number Diff line change
Expand Up @@ -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 {
Expand Down
2 changes: 1 addition & 1 deletion kubernetes/deployment.go
Original file line number Diff line number Diff line change
Expand Up @@ -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 {
Expand Down
2 changes: 1 addition & 1 deletion kubernetes/endpoints.go
Original file line number Diff line number Diff line change
Expand Up @@ -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 {
Expand Down
2 changes: 1 addition & 1 deletion kubernetes/events.go
Original file line number Diff line number Diff line change
Expand Up @@ -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 {
Expand Down
2 changes: 1 addition & 1 deletion kubernetes/hpa.go
Original file line number Diff line number Diff line change
Expand Up @@ -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 {
Expand Down
2 changes: 1 addition & 1 deletion kubernetes/ingress.go
Original file line number Diff line number Diff line change
Expand Up @@ -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 {
Expand Down
2 changes: 1 addition & 1 deletion kubernetes/ingressClass.go
Original file line number Diff line number Diff line change
Expand Up @@ -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 {
Expand Down
2 changes: 1 addition & 1 deletion kubernetes/issuer.go
Original file line number Diff line number Diff line change
Expand Up @@ -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 {
Expand Down
2 changes: 1 addition & 1 deletion kubernetes/jobs.go
Original file line number Diff line number Diff line change
Expand Up @@ -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 {
Expand Down
2 changes: 1 addition & 1 deletion kubernetes/leases.go
Original file line number Diff line number Diff line change
Expand Up @@ -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 {
Expand Down
2 changes: 1 addition & 1 deletion kubernetes/namespace.go
Original file line number Diff line number Diff line change
Expand Up @@ -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 {
Expand Down
2 changes: 1 addition & 1 deletion kubernetes/networkpolicies.go
Original file line number Diff line number Diff line change
Expand Up @@ -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 {
Expand Down
2 changes: 1 addition & 1 deletion kubernetes/nodes.go
Original file line number Diff line number Diff line change
Expand Up @@ -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 {
Expand Down
2 changes: 1 addition & 1 deletion kubernetes/orders.go
Original file line number Diff line number Diff line change
Expand Up @@ -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 {
Expand Down
2 changes: 1 addition & 1 deletion kubernetes/persistent-volume-claim.go
Original file line number Diff line number Diff line change
Expand Up @@ -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 {
Expand Down
2 changes: 1 addition & 1 deletion kubernetes/persistent-volume.go
Original file line number Diff line number Diff line change
Expand Up @@ -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 {
Expand Down
2 changes: 1 addition & 1 deletion kubernetes/pods.go
Original file line number Diff line number Diff line change
Expand Up @@ -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 {
Expand Down
2 changes: 1 addition & 1 deletion kubernetes/priorityclasses.go
Original file line number Diff line number Diff line change
Expand Up @@ -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 {
Expand Down
2 changes: 1 addition & 1 deletion kubernetes/replicasets.go
Original file line number Diff line number Diff line change
Expand Up @@ -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 {
Expand Down
2 changes: 1 addition & 1 deletion kubernetes/resourcequotas.go
Original file line number Diff line number Diff line change
Expand Up @@ -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 {
Expand Down
2 changes: 1 addition & 1 deletion kubernetes/role-bindings.go
Original file line number Diff line number Diff line change
Expand Up @@ -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 {
Expand Down
2 changes: 1 addition & 1 deletion kubernetes/roles.go
Original file line number Diff line number Diff line change
Expand Up @@ -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 {
Expand Down
2 changes: 1 addition & 1 deletion kubernetes/secret.go
Original file line number Diff line number Diff line change
Expand Up @@ -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 {
Expand Down
2 changes: 1 addition & 1 deletion kubernetes/service-accounts.go
Original file line number Diff line number Diff line change
Expand Up @@ -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 {
Expand Down
2 changes: 1 addition & 1 deletion kubernetes/service.go
Original file line number Diff line number Diff line change
Expand Up @@ -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 {
Expand Down
2 changes: 1 addition & 1 deletion kubernetes/statefulsets.go
Original file line number Diff line number Diff line change
Expand Up @@ -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 {
Expand Down
2 changes: 1 addition & 1 deletion kubernetes/storageClass.go
Original file line number Diff line number Diff line change
Expand Up @@ -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 {
Expand Down
2 changes: 1 addition & 1 deletion kubernetes/volume-attachments.go
Original file line number Diff line number Diff line change
Expand Up @@ -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 {
Expand Down
2 changes: 1 addition & 1 deletion kubernetes/volume-snapshots.go
Original file line number Diff line number Diff line change
Expand Up @@ -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 {
Expand Down
2 changes: 1 addition & 1 deletion utils/utils.go
Original file line number Diff line number Diff line change
Expand Up @@ -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
}
Expand Down

0 comments on commit c849b20

Please sign in to comment.