Skip to content

Commit

Permalink
edit label-selector
Browse files Browse the repository at this point in the history
  • Loading branch information
jokestax committed Aug 12, 2024
1 parent 6625d68 commit dd6d61f
Showing 1 changed file with 1 addition and 4 deletions.
5 changes: 1 addition & 4 deletions internal/k8s/exec.go
Original file line number Diff line number Diff line change
Expand Up @@ -167,13 +167,10 @@ func ReturnDeploymentObject(client kubernetes.Interface, matchLabel string, matc

timeout := time.Duration(timeoutSeconds) * time.Second
var deployment *appsv1.Deployment
labelSelector := map[string]string{
matchLabel: matchLabelValue,
}

err := wait.PollImmediate(15*time.Second, timeout, func() (bool, error) {
deployments, err := client.AppsV1().Deployments(namespace).List(context.Background(), metav1.ListOptions{
LabelSelector: metav1.FormatLabelSelector(metav1.SetAsLabelSelector(labelSelector)),
LabelSelector: fmt.Sprintf("%s=%s", matchLabel, matchLabelValue),
})
if err != nil {
// if we couldn't connect, ask to try again
Expand Down

0 comments on commit dd6d61f

Please sign in to comment.