Bump to v2.2.0 (#399)

This commit is contained in:
Itxaka
2023-06-14 16:53:12 +02:00
committed by GitHub
parent f91073db5d
commit 97fccf79f5
7 changed files with 64 additions and 18 deletions

View File

@@ -52,7 +52,17 @@ jobs:
- name: Login to Quay Registry - name: Login to Quay Registry
if: ${{ github.event_name == 'push' && github.ref == 'refs/heads/main' }} if: ${{ github.event_name == 'push' && github.ref == 'refs/heads/main' }}
run: echo ${{ secrets.QUAY_PASSWORD }} | docker login -u ${{ secrets.QUAY_USERNAME }} --password-stdin quay.io run: echo ${{ secrets.QUAY_PASSWORD }} | docker login -u ${{ secrets.QUAY_USERNAME }} --password-stdin quay.io
- name: Build 🔧 - name: Build PR 🔧
if: ${{ github.event_name == 'pull_request' }}
env:
FLAVOR: ${{ matrix.flavor }}
IMAGE: quay.io/kairos/kairos-${{ matrix.flavor }}:latest
run: |
./earthly.sh +ci --IMAGE=$IMAGE --FLAVOR=$FLAVOR
sudo mv build/* .
sudo rm -rf build
- name: Build main 🔧
if: ${{ github.event_name == 'push' && github.ref == 'refs/heads/main' }}
env: env:
FLAVOR: ${{ matrix.flavor }} FLAVOR: ${{ matrix.flavor }}
IMAGE: quay.io/kairos/kairos-${{ matrix.flavor }}:latest IMAGE: quay.io/kairos/kairos-${{ matrix.flavor }}:latest
@@ -68,6 +78,7 @@ jobs:
*.sha256 *.sha256
if-no-files-found: error if-no-files-found: error
- uses: actions/upload-artifact@v3 - uses: actions/upload-artifact@v3
if: ${{ github.event_name == 'push' && github.ref == 'refs/heads/main' }}
with: with:
name: kairos-${{ matrix.flavor }}.sbom.zip name: kairos-${{ matrix.flavor }}.sbom.zip
path: | path: |
@@ -75,18 +86,21 @@ jobs:
*.spdx.json *.spdx.json
if-no-files-found: error if-no-files-found: error
- uses: actions/upload-artifact@v3 - uses: actions/upload-artifact@v3
if: ${{ github.event_name == 'push' && github.ref == 'refs/heads/main' }}
with: with:
name: kairos-${{ matrix.flavor }}.initrd.zip name: kairos-${{ matrix.flavor }}.initrd.zip
path: | path: |
*-initrd *-initrd
if-no-files-found: error if-no-files-found: error
- uses: actions/upload-artifact@v3 - uses: actions/upload-artifact@v3
if: ${{ github.event_name == 'push' && github.ref == 'refs/heads/main' }}
with: with:
name: kairos-${{ matrix.flavor }}.squashfs.zip name: kairos-${{ matrix.flavor }}.squashfs.zip
path: | path: |
*.squashfs *.squashfs
if-no-files-found: error if-no-files-found: error
- uses: actions/upload-artifact@v3 - uses: actions/upload-artifact@v3
if: ${{ github.event_name == 'push' && github.ref == 'refs/heads/main' }}
with: with:
name: kairos-${{ matrix.flavor }}.kernel.zip name: kairos-${{ matrix.flavor }}.kernel.zip
path: | path: |
@@ -94,6 +108,7 @@ jobs:
*-initrd *-initrd
if-no-files-found: error if-no-files-found: error
- uses: actions/upload-artifact@v3 - uses: actions/upload-artifact@v3
if: ${{ github.event_name == 'push' && github.ref == 'refs/heads/main' }}
with: with:
name: kairos-${{ matrix.flavor }}.ipxe.zip name: kairos-${{ matrix.flavor }}.ipxe.zip
path: | path: |
@@ -196,7 +211,6 @@ jobs:
name: ${{ matrix.flavor }}-upgrade-test.logs.zip name: ${{ matrix.flavor }}-upgrade-test.logs.zip
path: tests/**/logs/* path: tests/**/logs/*
if-no-files-found: warn if-no-files-found: warn
provider_upgrade: provider_upgrade:
needs: needs:
- build - build

View File

@@ -1 +1 @@
v2.1.0 v2.2.0

View File

@@ -55,6 +55,10 @@ all:
BUILD +ipxe-iso BUILD +ipxe-iso
DO +RELEASEVERSION DO +RELEASEVERSION
ci:
BUILD +docker
BUILD +iso
all-arm: all-arm:
ARG SECURITY_SCANS=true ARG SECURITY_SCANS=true
BUILD --platform=linux/arm64 +docker BUILD --platform=linux/arm64 +docker

View File

@@ -45,7 +45,6 @@ var _ = Describe("kairos decentralized k8s test", Label("decentralized-k8s"), fu
vmForEach("checking if it has default service active", vms, func(vm VM) { vmForEach("checking if it has default service active", vms, func(vm VM) {
if isFlavor(vm, "alpine") { if isFlavor(vm, "alpine") {
out, _ := vm.Sudo("rc-status") out, _ := vm.Sudo("rc-status")
Expect(out).Should(ContainSubstring("kairos"))
Expect(out).Should(ContainSubstring("kairos-agent")) Expect(out).Should(ContainSubstring("kairos-agent"))
} else { } else {
out, _ := vm.Sudo("systemctl status kairos") out, _ := vm.Sudo("systemctl status kairos")
@@ -73,7 +72,6 @@ var _ = Describe("kairos decentralized k8s test", Label("decentralized-k8s"), fu
out, _ := vm.Sudo("rc-status") out, _ := vm.Sudo("rc-status")
return out return out
}, 30*time.Second, 10*time.Second).Should(And( }, 30*time.Second, 10*time.Second).Should(And(
ContainSubstring("kairos"),
ContainSubstring("kairos-agent"))) ContainSubstring("kairos-agent")))
} else { } else {
Eventually(func() string { Eventually(func() string {
@@ -119,6 +117,8 @@ var _ = Describe("kairos decentralized k8s test", Label("decentralized-k8s"), fu
out, err := vm.Sudo("cat /run/cos/live_mode") out, err := vm.Sudo("cat /run/cos/live_mode")
Expect(err).To(HaveOccurred(), out) Expect(err).To(HaveOccurred(), out)
if isFlavor(vm, "alpine") { if isFlavor(vm, "alpine") {
// Skip for now as agent doesn't log anymore as it cannot behave both as a one-off and a daemon
/*
Eventually(func() string { Eventually(func() string {
out, _ = vm.Sudo("sudo cat /var/log/kairos/agent.log") out, _ = vm.Sudo("sudo cat /var/log/kairos/agent.log")
return out return out
@@ -127,6 +127,7 @@ var _ = Describe("kairos decentralized k8s test", Label("decentralized-k8s"), fu
ContainSubstring("Configuring k3s-agent"), ContainSubstring("Configuring k3s-agent"),
ContainSubstring("Configuring k3s"), ContainSubstring("Configuring k3s"),
), out) ), out)
*/
} else { } else {
Eventually(func() string { Eventually(func() string {
out, _ = vm.Sudo("systemctl status kairos-agent") out, _ = vm.Sudo("systemctl status kairos-agent")

View File

@@ -76,6 +76,8 @@ func startVM(iso string) (context.Context, VM) {
stateDir, err := os.MkdirTemp("", "stateDir-*") stateDir, err := os.MkdirTemp("", "stateDir-*")
Expect(err).ToNot(HaveOccurred()) Expect(err).ToNot(HaveOccurred())
fmt.Printf("Statedir: %s\n", stateDir)
sshPort, err = getFreePort() sshPort, err = getFreePort()
Expect(err).ToNot(HaveOccurred()) Expect(err).ToNot(HaveOccurred())
@@ -111,6 +113,14 @@ func startVM(iso string) (context.Context, VM) {
// but we just print the output just in case. // but we just print the output just in case.
fmt.Printf("\nVM Aborted: %s %s Exit status: %s\n", out, err, status) fmt.Printf("\nVM Aborted: %s %s Exit status: %s\n", out, err, status)
}), }),
func(m *types.MachineConfig) error {
m.Args = append(m.Args,
"-chardev", fmt.Sprintf("stdio,mux=on,id=char0,logfile=%s,signal=off", path.Join(stateDir, "serial.log")),
"-serial", "chardev:char0",
"-mon", "chardev=char0",
)
return nil
},
types.WithStateDir(stateDir), types.WithStateDir(stateDir),
types.WithDataSource(os.Getenv("DATASOURCE")), types.WithDataSource(os.Getenv("DATASOURCE")),
} }

View File

@@ -86,22 +86,23 @@ var _ = Describe("k3s upgrade test", Label("upgrade-k8s"), func() {
"loaded (/usr/lib/systemd/system/systemd-timesyncd.service; enabled; vendor preset: disabled)")) "loaded (/usr/lib/systemd/system/systemd-timesyncd.service; enabled; vendor preset: disabled)"))
} }
By("checking if it has a working kubeconfig") By("checking if kairos-agent has started")
Eventually(func() string { Eventually(func() string {
var out string var out string
if isFlavor(vm, "alpine") { if isFlavor(vm, "alpine") {
out, _ = vm.Sudo("cat /var/log/kairos/agent.log;cat /var/log/kairos-agent.log") out, _ = vm.Sudo("rc-service kairos-agent status")
} else { } else {
out, _ = vm.Sudo("systemctl status kairos-agent") out, _ = vm.Sudo("systemctl status kairos-agent")
} }
return out return out
}, 900*time.Second, 10*time.Second).Should(ContainSubstring("One time bootstrap starting")) }, 900*time.Second, 10*time.Second).Should(Or(ContainSubstring("One time bootstrap starting"), ContainSubstring("status: started")))
By("Checking agent provider correct start")
Eventually(func() string { Eventually(func() string {
out, _ := vm.Sudo("cat /var/log/kairos/agent-provider.log") out, _ := vm.Sudo("cat /var/log/kairos/agent-provider.log")
return out return out
}, 900*time.Second, 10*time.Second).Should(Or(ContainSubstring("One time bootstrap starting"), ContainSubstring("Sentinel exists"))) }, 900*time.Second, 10*time.Second).Should(Or(ContainSubstring("One time bootstrap starting"), ContainSubstring("Sentinel exists")))
By("Checking k3s is pointing to https")
Eventually(func() string { Eventually(func() string {
out, _ := vm.Sudo("cat /etc/rancher/k3s/k3s.yaml") out, _ := vm.Sudo("cat /etc/rancher/k3s/k3s.yaml")
return out return out
@@ -120,6 +121,14 @@ var _ = Describe("k3s upgrade test", Label("upgrade-k8s"), func() {
return out return out
}, 900*time.Second, 10*time.Second).Should(ContainSubstring("system-upgrade-controller")) }, 900*time.Second, 10*time.Second).Should(ContainSubstring("system-upgrade-controller"))
By("wait for all containers to be in running state")
Eventually(func() string {
out, _ := kubectl(vm, "get pods -A")
fmt.Printf("out = %+v\n", out)
return out
}, 900*time.Second, 10*time.Second).ShouldNot(And(ContainSubstring("Pending"), ContainSubstring("ContainerCreating")))
By("applying upgrade plan") By("applying upgrade plan")
err = vm.Scp("assets/suc.yaml", "./suc.yaml", "0770") err = vm.Scp("assets/suc.yaml", "./suc.yaml", "0770")
Expect(err).ToNot(HaveOccurred()) Expect(err).ToNot(HaveOccurred())

View File

@@ -144,7 +144,15 @@ var _ = Describe("k3s upgrade test from k8s", Label("upgrade-latest-with-kuberne
out, _ := kubectl(vm, "get pods -A") out, _ := kubectl(vm, "get pods -A")
fmt.Printf("out = %+v\n", out) fmt.Printf("out = %+v\n", out)
return out return out
}, 900*time.Second, 10*time.Second).Should(ContainSubstring("system-upgrade-controller")) })
By("wait for all containers to be in running state")
Eventually(func() string {
out, _ := kubectl(vm, "get pods -A")
fmt.Printf("out = %+v\n", out)
return out
}, 900*time.Second, 10*time.Second).ShouldNot(And(ContainSubstring("Pending"), ContainSubstring("ContainerCreating")))
By("triggering an upgrade") By("triggering an upgrade")
suc := sucYAML(strings.ReplaceAll(containerImage, ":8h", ""), "8h") suc := sucYAML(strings.ReplaceAll(containerImage, ":8h", ""), "8h")