Skip to content

Commit

Permalink
Handle lint issues
Browse files Browse the repository at this point in the history
Signed-off-by: Marcus Noble <[email protected]>
  • Loading branch information
AverageMarcus committed Apr 26, 2024
1 parent d39d8ac commit 06de4f1
Show file tree
Hide file tree
Showing 4 changed files with 11 additions and 7 deletions.
13 changes: 8 additions & 5 deletions cmd/standup/main.go
Original file line number Diff line number Diff line change
Expand Up @@ -51,14 +51,14 @@ var (
// Functions to run after cluster creation to confirm it is up and ready to use
clusterReadyFns []func(wcClient *client.Client) = []func(wcClient *client.Client){
func(wcClient *client.Client) {
wait.For(
_ = wait.For(
wait.AreNumNodesReady(context.Background(), wcClient, controlPlaneNodes, &cr.MatchingLabels{"node-role.kubernetes.io/control-plane": ""}),
wait.WithTimeout(20*time.Minute),
wait.WithInterval(15*time.Second),
)
},
func(wcClient *client.Client) {
wait.For(
_ = wait.For(
wait.AreNumNodesReady(context.Background(), wcClient, workerNodes, client.DoesNotHaveLabels{"node-role.kubernetes.io/control-plane"}),
wait.WithTimeout(20*time.Minute),
wait.WithInterval(15*time.Second),
Expand All @@ -79,8 +79,8 @@ func init() {
standupCmd.Flags().StringVar(&clusterVersion, "cluster-version", "latest", "The version of the cluster app to install")
standupCmd.Flags().StringVar(&defaultAppVersion, "default-apps-version", "latest", "The version of the default-apps app to install")

standupCmd.MarkFlagRequired("provider")
standupCmd.MarkFlagRequired("context")
_ = standupCmd.MarkFlagRequired("provider")
_ = standupCmd.MarkFlagRequired("context")
}

func main() {
Expand Down Expand Up @@ -131,7 +131,7 @@ func run(cmd *cobra.Command, args []string) error {
// As EKS has no control plane we only check for worker nodes being ready
clusterReadyFns = []func(wcClient *client.Client){
func(wcClient *client.Client) {
wait.For(
_ = wait.For(
wait.AreNumNodesReady(context.Background(), wcClient, workerNodes, &cr.MatchingLabels{"node-role.kubernetes.io/worker": ""}),
wait.WithTimeout(20*time.Minute),
wait.WithInterval(15*time.Second),
Expand Down Expand Up @@ -172,6 +172,9 @@ func run(cmd *cobra.Command, args []string) error {
return err
}
_, err = resultsFile.Write(resultBytes)
if err != nil {
return err
}

resultsFile.Close()

Expand Down
2 changes: 1 addition & 1 deletion cmd/teardown/main.go
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,7 @@ func init() {
teardownCmd.Flags().StringVar(&standupDirectory, "standup-directory", "", "The directory containing the results from 'standup'")
teardownCmd.Flags().BoolVar(&cleanupResults, "cleanup-standup-results", true, "Remove the results and kubeconfig generated by 'standup'")

teardownCmd.MarkFlagRequired("context")
_ = teardownCmd.MarkFlagRequired("context")
}

func main() {
Expand Down
1 change: 1 addition & 0 deletions pkg/clusterbuilder/providers/capa/cluster.go
Original file line number Diff line number Diff line change
Expand Up @@ -64,6 +64,7 @@ func (c *PrivateClusterBuilder) NewClusterApp(clusterName string, orgName string

// WC CIDRs have to not overlap and be in the 10.225. - 10.255. range, so
// we select a random number in that range and set it as the second octet.
//nolint:gosec
randomOctet := rand.Intn(30) + 225
cidrOctet := fmt.Sprintf("%d", randomOctet)
templateValues := &application.TemplateValues{
Expand Down
2 changes: 1 addition & 1 deletion pkg/clusterbuilder/providers/capv/cluster.go
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ import (
const (
RegCredSecretName = "container-registries-configuration"
RegCredSecretNamespace = "default"
VSphereCredSecretName = "vsphere-credentials"
VSphereCredSecretName = "vsphere-credentials" //nolint:gosec
VSphereCredSecretNamespace = "org-giantswarm"
)

Expand Down

0 comments on commit 06de4f1

Please sign in to comment.