Fix cgroup smoke test (#4823)

* Fixed control group vagrantfile so running vagrant up doesn't fail locally

Signed-off-by: Derek Nola <derek.nola@suse.com>
pull/4824/head
Derek Nola 2021-12-22 12:16:43 -08:00 committed by GitHub
parent 08d538fb3a
commit a02db0f2fa
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 13 additions and 6 deletions

View File

@ -34,7 +34,7 @@ jobs:
uses: actions/upload-artifact@v2
with: { name: k3s, path: dist/artifacts/k3s }
test:
name: "Smoke Test"
name: "Conformance Test"
needs: prep
# nested virtualization is only available on macOS hosts
runs-on: macos-10.15
@ -66,10 +66,14 @@ jobs:
continue-on-error: true
- name: "Vagrant Plugin(s)"
run: vagrant plugin install vagrant-k3s
- name: "Vagrant Up ⏩ Install K3s"
- name: "Vagrant Up"
run: vagrant up
- name: "K3s Start" # start k3s rootfull
run: vagrant ssh -- sudo systemctl start k3s-server
- name: "K3s Prepare"
run: vagrant provision --provision-with=k3s-prepare
- name: ⏬ "K3s Install"
run: vagrant provision --provision-with=k3s-install
- name: ⏩ "K3s Start"
run: vagrant provision --provision-with=k3s-start
- name: "K3s Ready" # wait for k3s to be ready
run: vagrant provision --provision-with=k3s-ready
- name: "K3s Status" # kubectl get node,all -A -o wide

View File

@ -19,7 +19,7 @@ Vagrant.configure("2") do |config|
test.vm.hostname = 'smoke'
test.vm.provision :file, run: 'always', source: ENV['TEST_UNITFILE_ROOTFULL'], destination: 'k3s-rootfull.service'
test.vm.provision :file, run: 'always', source: ENV['TEST_UNITFILE_ROOTLESS'], destination: 'k3s-rootless.service'
test.vm.provision 'k3s-prepare', type: "shell", run: "once", privileged: true do |sh|
test.vm.provision 'k3s-prepare', type: "shell", run: ENV['CI'] == 'true' ? 'never' : 'once', privileged: true do |sh|
sh.inline = <<~SHELL
#!/usr/bin/env bash
set -eux -o pipefail
@ -58,7 +58,7 @@ EOF
chown -R vagrant:vagrant /home/vagrant/.config
SHELL
end
test.vm.provision 'k3s-install', type: 'k3s', run: 'once' do |k3s|
test.vm.provision 'k3s-install', type: 'k3s', run: ENV['CI'] == 'true' ? 'never' : 'once' do |k3s|
k3s.args = %w[server]
k3s.env = %w[INSTALL_K3S_NAME=server INSTALL_K3S_SKIP_DOWNLOAD=true K3S_TOKEN=vagrant INSTALL_K3S_SKIP_ENABLE=true]
k3s.config = {
@ -69,6 +69,9 @@ EOF
}
k3s.config_mode = '0644' # side-step https://github.com/k3s-io/k3s/issues/4321
end
test.vm.provision "k3s-start", type: "shell", run: ENV['CI'] == 'true' ? 'never' : 'once' do |sh|
sh.inline = "systemctl start k3s-server"
end
test.vm.provision "k3s-ready", type: "shell", run: ENV['CI'] == 'true' ? 'never' : 'once' do |sh|
sh.env = {
:PATH => "/usr/local/bin:/usr/local/sbin:/sbin:/bin:/usr/sbin:/usr/bin:/root/bin",