Skip to content

Commit

Permalink
Merge pull request #165 from Charliekenney23/follow-k8s-waiter-covention
Browse files Browse the repository at this point in the history
make ClusterConditionFunc's adhere to k8s waiter convention
  • Loading branch information
0xch4z authored Oct 7, 2020
2 parents 2a019a6 + 9fad0da commit 3cb5d55
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 8 deletions.
4 changes: 1 addition & 3 deletions k8s/pkg/condition/lke.go
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,6 @@ package condition

import (
"context"
"errors"
"fmt"

"github.com/linode/linodego"
Expand Down Expand Up @@ -31,8 +30,7 @@ func ClusterHasReadyNode(ctx context.Context, options linodego.ClusterConditionO
}
}
}

return false, errors.New("no nodes in cluster are ready")
return false, nil
}

// WaitForLKEClusterReady polls with a given timeout for the LKE Cluster's api-server
Expand Down
6 changes: 1 addition & 5 deletions waitfor.go
Original file line number Diff line number Diff line change
Expand Up @@ -221,7 +221,6 @@ func (client Client) WaitForLKEClusterConditions(
}
defer cancel()

var prevLog string
lkeKubeConfig, err := client.GetLKEClusterKubeconfig(ctx, clusterID)
if err != nil {
return fmt.Errorf("failed to get Kubeconfig for LKE cluster %d: %s", clusterID, err)
Expand All @@ -239,10 +238,7 @@ func (client Client) WaitForLKEClusterConditions(
case <-ticker.C:
result, err := condition(ctx, conditionOptions)
if err != nil {
if err.Error() != prevLog {
prevLog = err.Error()
log.Printf("[ERROR] %s\n", err)
}
return err
}

if result {
Expand Down

0 comments on commit 3cb5d55

Please sign in to comment.