Skip to content

Commit

Permalink
Allow both label types to function
Browse files Browse the repository at this point in the history
  • Loading branch information
JacobSanford committed Aug 24, 2023
1 parent 3383e38 commit 6cb9cb6
Showing 1 changed file with 12 additions and 0 deletions.
12 changes: 12 additions & 0 deletions build/src/kubernetes.go
Original file line number Diff line number Diff line change
Expand Up @@ -67,6 +67,18 @@ func getPodNameFromUri(client corev1client.CoreV1Interface, podUri string, podNa
for _, pod := range pods.Items {
return pod.GetName(), ""
}

labelSelector := fmt.Sprintf("instance=%s", strings.ReplaceAll(podUri, ".", "-"))
pods, err := client.Pods(podNamespace).List(context.TODO(), listOptions)

if err != nil {
panic(err.Error())
}

for _, pod := range pods.Items {
return pod.GetName(), ""
}

return "", fmt.Sprintf("Error! No pods exist matching [uri=%s, namespace=%s]", podUri, podNamespace)
}

Expand Down

0 comments on commit 6cb9cb6

Please sign in to comment.