Skip to content

Commit 9b402e3

Browse files
authored
Merge pull request #17496 from izaac/backport-17465-release-2.13
[backport v2.13.6] Automation: Make custom node SSH user configurable via CUSTOM_NODE_USER
2 parents de1187a + d1569c3 commit 9b402e3

3 files changed

Lines changed: 6 additions & 2 deletions

File tree

cypress.config.ts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -103,6 +103,7 @@ export default defineConfig({
103103
azureClientSecret: process.env.AZURE_CLIENT_SECRET,
104104
customNodeIp: process.env.CUSTOM_NODE_IP,
105105
customNodeKey: process.env.CUSTOM_NODE_KEY,
106+
customNodeUser: process.env.CUSTOM_NODE_USER || 'ec2-user',
106107
accessibility: !!process.env.TEST_A11Y, // Are we running accessibility tests?
107108
a11yFolder: path.join('.', 'cypress', 'accessibility'),
108109
gkeServiceAccount: process.env.GKE_SERVICE_ACCOUNT,

cypress/e2e/po/edit/provisioning.cattle.io.cluster/create/cluster-create.po.ts

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -54,7 +54,9 @@ export default class ClusterManagerCreatePagePo extends ClusterManagerCreateImpo
5454
}
5555

5656
customClusterRegistrationCmd(cmd: string) {
57-
return `ssh -i custom_node.key -o "StrictHostKeyChecking=no" -o "UserKnownHostsFile=/dev/null" root@${ Cypress.env('customNodeIp') } \"nohup ${ cmd }\"`;
57+
const sshUser = Cypress.env('customNodeUser');
58+
59+
return `ssh -i custom_node.key -o "StrictHostKeyChecking=no" -o "UserKnownHostsFile=/dev/null" ${ sshUser }@${ Cypress.env('customNodeIp') } \"nohup ${ cmd }\"`;
5860
}
5961

6062
credentialsBanner() {

cypress/e2e/tests/pages/manager/cluster-manager.spec.ts

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -171,7 +171,7 @@ describe('Cluster Manager', { testIsolation: 'off', tags: ['@manager', '@adminUs
171171
// The test validate the warning when selecting none, but now this get back to calico.
172172
// A CNI is mandatory to get the cluster active otherwise manual intervention is needed or
173173
// the use of a cloud provider but that's not in scope.
174-
spec: { rkeConfig: { machineGlobalConfig: { cni: 'calico', 'ingress-controller': 'ingress-nginx' }, machinePoolDefaults: { hostnameLengthLimit: 15 } } }
174+
spec: { rkeConfig: { machineGlobalConfig: { cni: 'calico' }, machinePoolDefaults: { hostnameLengthLimit: 15 } } }
175175
};
176176

177177
cy.userPreferences();
@@ -216,6 +216,7 @@ describe('Cluster Manager', { testIsolation: 'off', tags: ['@manager', '@adminUs
216216
cy.wait('@createRequest').then((intercept) => {
217217
// Issue with linter https://github.com/cypress-io/eslint-plugin-cypress/issues/3
218218
expect(isMatch(intercept.request.body, request)).to.equal(true);
219+
expect(['ingress-nginx', 'traefik']).to.include(intercept.request.body.spec?.rkeConfig?.machineGlobalConfig?.['ingress-controller']);
219220
});
220221

221222
detailRKE2ClusterPage().waitForPage(undefined, 'registration');

0 commit comments

Comments
 (0)