Skip to content

Commit 83b9b6d

Browse files
authored
chore(ci): use new replicated vm create --ssh-public-key flag (#2141)
1 parent 3562cc4 commit 83b9b6d

File tree

5 files changed

+6
-12
lines changed

5 files changed

+6
-12
lines changed

.github/actions/e2e-cmx-setup/action.yml

Lines changed: 2 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -4,9 +4,6 @@ inputs:
44
github-token:
55
description: 'the ci github token used to install the replicated cli'
66
required: true
7-
cmx-ssh-private-key:
8-
description: 'the private key used to access the cmx nodes'
9-
required: true
107

118
runs:
129
using: composite
@@ -23,5 +20,5 @@ runs:
2320
shell: bash
2421
run: |
2522
mkdir -p ~/.ssh
26-
echo "${{ inputs.cmx-ssh-private-key }}" > ~/.ssh/id_ed25519
27-
chmod 600 ~/.ssh/id_ed25519
23+
ssh-keygen -t rsa -b 4096 -C "deploy@replicated.com" -f ~/.ssh/id_rsa -N ""
24+
chmod 600 ~/.ssh/id_rsa

.github/actions/e2e/action.yml

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -32,9 +32,6 @@ inputs:
3232
cmx-api-token:
3333
description: 'the token used to access the replicated api for cmx'
3434
required: false # this is only needed for cmx-based tests
35-
cmx-ssh-private-key:
36-
description: 'the private key used to access the cmx nodes'
37-
required: false # this is only needed for cmx-based tests
3835
upgrade-target-ec-version:
3936
description: 'the embedded cluster version to expect after upgrades complete'
4037
required: false # this is only set by post-release testing
@@ -51,7 +48,6 @@ runs:
5148
uses: ./.github/actions/e2e-cmx-setup
5249
with:
5350
github-token: ${{ inputs.github-token }}
54-
cmx-ssh-private-key: ${{ inputs.cmx-ssh-private-key }}
5551

5652
- name: Setup Go
5753
uses: actions/setup-go@v5
@@ -76,6 +72,7 @@ runs:
7672
export EXPECT_K0S_VERSION_PREVIOUS=${{ inputs.k0s-version-previous }}
7773
export EXPECT_K0S_VERSION_PREVIOUS_STABLE=${{ inputs.k0s-version-previous-stable }}
7874
export EXPECT_EMBEDDED_CLUSTER_UPGRADE_TARGET_VERSION=${{ inputs.upgrade-target-ec-version }}
75+
export CMX_SSH_PUBLIC_KEY="$HOME/.ssh/id_rsa.pub"
7976
export SKIP_LXD_CLEANUP=true
8077
make e2e-test TEST_NAME=${{ inputs.test-name }}
8178

.github/workflows/ci.yaml

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -778,7 +778,6 @@ jobs:
778778
version-specifier: ${{ needs.export-version-specifier.outputs.version_specifier }}
779779
github-token: ${{ secrets.GITHUB_TOKEN }}
780780
cmx-api-token: ${{ secrets.CMX_REPLICATED_API_TOKEN }}
781-
cmx-ssh-private-key: ${{ secrets.CMX_SSH_PRIVATE_KEY }}
782781

783782
e2e-main:
784783
name: E2E (on merge)
@@ -816,7 +815,6 @@ jobs:
816815
version-specifier: ${{ needs.export-version-specifier.outputs.version_specifier }}
817816
github-token: ${{ secrets.GITHUB_TOKEN }}
818817
cmx-api-token: ${{ secrets.CMX_REPLICATED_API_TOKEN }}
819-
cmx-ssh-private-key: ${{ secrets.CMX_SSH_PRIVATE_KEY }}
820818

821819
# this job will validate that all the tests passed
822820
# it is used for the github branch protection rule

.github/workflows/release-prod.yaml

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -601,7 +601,6 @@ jobs:
601601
version-specifier: ${{ github.ref_name }}
602602
github-token: ${{ secrets.GITHUB_TOKEN }}
603603
cmx-api-token: ${{ secrets.CMX_REPLICATED_API_TOKEN }}
604-
cmx-ssh-private-key: ${{ secrets.CMX_SSH_PRIVATE_KEY }}
605604
upgrade-target-ec-version: ${{ github.ref_name }}
606605

607606
# this job will validate that all the tests passed

e2e/cluster/cmx/cluster.go

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -129,6 +129,9 @@ func NewNode(in *ClusterInput, index int, networkID string) (*Node, error) {
129129
if in.DiskSize != 0 {
130130
args = append(args, "--disk", strconv.Itoa(in.DiskSize))
131131
}
132+
if key := os.Getenv("CMX_SSH_PUBLIC_KEY"); key != "" {
133+
args = append(args, "--ssh-public-key", key)
134+
}
132135

133136
output, err := exec.Command("replicated", args...).Output() // stderr can break json parsing
134137
if err != nil {

0 commit comments

Comments
 (0)