-
Notifications
You must be signed in to change notification settings - Fork 12
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
* clean up readme, add reports (#15) * add scripts to test repo (#16) * adding apache 2.0 license to test repo for compliance (#17) * fix spelling errors (#18) * adding missed RA deprecation test (#19) * Delete accidental add * adding pit to review modification to actions package (#21) * ignore any potential ssh keys (#22) * ignore any potential ssh keys * updating custodian path in Jenkinsfile * pulling over from rancher/rancher/.gitignore * Updates to rancher ha jenkins pipeline (#27) * Getting the k8s versions based on rancher version debug Updated the rancher versions script to work for community versions Debug Adding windows image Updating rancherversion script for rke2 and k3s Debug Update global vars Updated rancher version log * updates to go.mod and go.sum * resolving golang linter errors * fix-resync-interval * rebasing changes from rancher (#32) * rebasing changes from rancher * updating format based on golangci-lint * bumping go.mod -> rancher + shepherd * <main> Public repo fleet deployment on HA downstream clusters after upgrade --------- Co-authored-by: Caleb Warren <[email protected]> Co-authored-by: Anupama Upadhyayula <[email protected]> Co-authored-by: priyashetty <[email protected]> Co-authored-by: lscalabrini01 <[email protected]>
- Loading branch information
1 parent
9b83fc0
commit 1761d7e
Showing
28 changed files
with
2,292 additions
and
3,450 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,36 @@ | ||
package clusters | ||
|
||
import ( | ||
"errors" | ||
"net/url" | ||
|
||
steveV1 "github.com/rancher/shepherd/clients/rancher/v1" | ||
"github.com/sirupsen/logrus" | ||
) | ||
|
||
const ( | ||
LabelWorker = "labelSelector=node-role.kubernetes.io/worker=true" | ||
SmallerPoolMessageError = "Machine pool cluster size is smaller than expected pool size" | ||
) | ||
|
||
// VerifyNodePoolSize is a helper function that checks if the machine pool cluster size is greater than or equal to poolSize | ||
func VerifyNodePoolSize(steveClient *steveV1.Client, labelSelector string, poolSize int) error { | ||
logrus.Info("Checking node pool") | ||
|
||
logrus.Infof("Getting the node using the label [%v]", labelSelector) | ||
query, err := url.ParseQuery(labelSelector) | ||
if err != nil { | ||
return err | ||
} | ||
|
||
nodeList, err := steveClient.SteveType("node").List(query) | ||
if err != nil { | ||
return err | ||
} | ||
|
||
if len(nodeList.Data) < poolSize { | ||
return errors.New(SmallerPoolMessageError) | ||
} | ||
|
||
return nil | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.