Skip to content

Commit

Permalink
Use instance as selector
Browse files Browse the repository at this point in the history
  • Loading branch information
JacobSanford committed Aug 24, 2023
1 parent df154d6 commit 3383e38
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion build/src/kubernetes.go
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@ import (
"k8s.io/client-go/tools/clientcmd"
"k8s.io/client-go/tools/remotecommand"
"os"
"strings"
)

func getK8sConfig() *rest.Config {
Expand Down Expand Up @@ -51,7 +52,7 @@ func getInClusterConfig() *rest.Config {
}

func getPodNameFromUri(client corev1client.CoreV1Interface, podUri string, podNamespace string) (string, string) {
labelSelector := fmt.Sprintf("instance=%s", podUri)
labelSelector := fmt.Sprintf("app.kubernetes.io/instance=%s", strings.ReplaceAll(podUri, ".", "-"))

listOptions := metaV1.ListOptions{
LabelSelector: labelSelector,
Expand Down

0 comments on commit 3383e38

Please sign in to comment.