Skip to content

Conversation

@slickwarren
Copy link
Collaborator

also added scripts to fall back on if the 'build server' goes down

@slickwarren slickwarren requested a review from a team as a code owner January 22, 2026 22:48
@slickwarren slickwarren added the team/pit-crew slack notifier for pit crew label Jan 22, 2026
Copy link
Contributor

@lscalabrini01 lscalabrini01 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Overall, it looks good. I just have a few comments

@floatingman floatingman self-requested a review January 23, 2026 17:12
@slickwarren slickwarren requested review from a team and lscalabrini01 January 23, 2026 17:23

p.cattleConfig = config.LoadConfigFromFile(os.Getenv(config.ConfigEnvironmentKey))

p.cattleConfig, err = defaults.SetK8sDefault(client, defaults.RKE2, p.cattleConfig)
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

is the k8s version configurable?

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

yes, its still pulled from the config file. But if it shows up as empty, SetK8sDefault will use the latest (which is what I want in this case, but the config value is still used as 1st priority if it is there)

Comment on lines +55 to +58
nodeRolesDedicated := []provisioninginput.MachinePools{provisioninginput.EtcdMachinePool, provisioninginput.ControlPlaneMachinePool, provisioninginput.WorkerMachinePool}
nodeRolesDedicated[0].MachinePoolConfig.Quantity = 1
nodeRolesDedicated[1].MachinePoolConfig.Quantity = 2
nodeRolesDedicated[2].MachinePoolConfig.Quantity = 2
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

So this means 1 etcd, 2 control plane and 2 worker? why not the more standard 1 etcd, 1 control plane and 2 worker?

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

for cloud provider, the cpi controller runs on the control plane. having 2 cp nodes is the 'production minimum' recommendation (we usually do 3etcd, 2cp, 3 workers but I'm resource limited in harvester lab)

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Potential future enhancement to allow this to be set via config as well, but I'm fine with the hardcoded values right now due to our lab limitations.

@hamistao
Copy link
Contributor

@slickwarren Also just alerting that a PR check is failing due to:

  validation/harvester/provisioning/cloud_provider_test.go:29:1: File is not properly formatted (goimports)
  	client             *rancher.Client
  ^

Copy link
Contributor

@floatingman floatingman left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Just a few bash suggestions

@@ -0,0 +1,45 @@
#!/bin/bash

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Added a set -eu so this script quits if there is an error, otherwise it will continue to run, which could cause problems with all of the creating and deleting going on.

# harvester has a heavy dependency on v28 and below of docker for now.
sudo apt install -y docker-ce=5:28.5.2-1~ubuntu.24.04~noble docker-ce-cli=5:28.5.2-1~ubuntu.24.04~noble containerd.io

sudo usermod -aG docker ubuntu
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Change ubuntu to $USER in case the user running this script changes. For example, if we ever change to using SUSE Linux vs. Ubuntu

# can run make before-hand, but I don't think its necessary if I just want images. .
# make
make build-iso
sleep 10
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Why is this sleep necessary?

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

sometimes, the file write at the last stage isn't quite complete for some reason after make build-iso which caused a timing issue on the next step.


rm -rf /usr/local/go && tar -C /usr/local -xzf go1.25.5.linux-amd64.tar.gz

echo "export PATH=$PATH:/usr/local/go/bin" >> .bashrc
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Change this to single quotes. Changes the way the $PATH variable is expanded, preventing issues that are hard to diagnose.

listen [::]:32309;
server_name _;

root /home/ubuntu/harvester/dist/artifacts;
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

You might want to add a comment here about changing the path if we ever change the linux distribution this is run on.

Comment on lines 23 to 24
rm -rf old/
rm -rf latest/
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

You probably want to check if these directories exist first before deleting them.
Something like this is sufficient

if [ -d "$DIRECTORY" ]; then
  echo "$DIRECTORY does exist."
fi

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

this is actually why I don't set -eu 😅 good suggestion

@@ -0,0 +1,36 @@
#!/bin/bash

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Add a set -eu here too.

logrus.Infof("Provisioning cluster")
cluster, err := provisioning.CreateProvisioningCluster(tt.client, provider, credentialSpec, clusterConfig, machineConfigSpec, nil)
require.NoError(p.T(), err)
logrus.Infof("Provisioning cluster")
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

nit: could you use the suite approche for the logs on the tests?

suggestion: p.T().Logf("Provisioning cluster")

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

we usually use logrus for logs

}

func (p *HarvesterProvisioningTestSuite) TestHarvesterCloudProvider() {
func (p *HarvesterProvisioningTestSuite) TestCloudProvider() {
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

nit: could we 'h' as suite variable?

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I wanted p for provisioning 😄

@slickwarren
Copy link
Collaborator Author

@floatingman the scripts are in a 'beta' state if you will. But they're all currently used and working on the server node. I just wanted to add them here as a fallback -- Can I make a separate ticket to address your comments for it and merge as-is?

Comment on lines +55 to +58
nodeRolesDedicated := []provisioninginput.MachinePools{provisioninginput.EtcdMachinePool, provisioninginput.ControlPlaneMachinePool, provisioninginput.WorkerMachinePool}
nodeRolesDedicated[0].MachinePoolConfig.Quantity = 1
nodeRolesDedicated[1].MachinePoolConfig.Quantity = 2
nodeRolesDedicated[2].MachinePoolConfig.Quantity = 2
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Potential future enhancement to allow this to be set via config as well, but I'm fine with the hardcoded values right now due to our lab limitations.

@slickwarren slickwarren dismissed floatingman’s stale review January 23, 2026 22:17

removed from this PR

@slickwarren slickwarren merged commit 3a410cd into rancher:main Jan 23, 2026
3 checks passed
@slickwarren slickwarren deleted the cwarren/harvester-tests-v1 branch January 23, 2026 22:31
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

team/pit-crew slack notifier for pit crew

Projects

None yet

Development

Successfully merging this pull request may close these issues.

5 participants