mirror of
https://github.com/kairos-io/provider-kairos.git
synced 2025-09-16 23:31:59 +00:00
4
.github/bump_repositories.sh
vendored
4
.github/bump_repositories.sh
vendored
@@ -17,8 +17,8 @@ last_commit_snapshot() {
|
|||||||
echo $(docker run --rm quay.io/skopeo/stable list-tags docker://$1 | jq -rc '.Tags | map(select( (. | contains("-repository.yaml")) )) | sort_by(. | sub("v";"") | sub("-repository.yaml";"") | sub("-";"") | split(".") | map(tonumber) ) | .[-1]' | sed "s/-repository.yaml//g")
|
echo $(docker run --rm quay.io/skopeo/stable list-tags docker://$1 | jq -rc '.Tags | map(select( (. | contains("-repository.yaml")) )) | sort_by(. | sub("v";"") | sub("-repository.yaml";"") | sub("-";"") | split(".") | map(tonumber) ) | .[-1]' | sed "s/-repository.yaml//g")
|
||||||
}
|
}
|
||||||
|
|
||||||
latest_tag=$(last_commit_snapshot quay.io/c3os/packages)
|
latest_tag=$(last_commit_snapshot quay.io/kairosos/packages)
|
||||||
latest_tag_arm64=$(last_commit_snapshot quay.io/c3os/packages-arm64)
|
latest_tag_arm64=$(last_commit_snapshot quay.io/kairos/packages-arm64)
|
||||||
|
|
||||||
$YQ eval "$(reference 0 $latest_tag)" -i repository.yaml
|
$YQ eval "$(reference 0 $latest_tag)" -i repository.yaml
|
||||||
$YQ eval "$(reference 1 $latest_tag_arm64)" -i repository.yaml
|
$YQ eval "$(reference 1 $latest_tag_arm64)" -i repository.yaml
|
||||||
|
2
.github/workflows/image-arm.yaml
vendored
2
.github/workflows/image-arm.yaml
vendored
@@ -41,7 +41,7 @@ jobs:
|
|||||||
MODEL: ${{ matrix.model }}
|
MODEL: ${{ matrix.model }}
|
||||||
run: |
|
run: |
|
||||||
export TAG=${GITHUB_REF##*/}
|
export TAG=${GITHUB_REF##*/}
|
||||||
./earthly.sh +all-arm --IMAGE_NAME=c3os-$FLAVOR-$TAG.img --IMAGE=quay.io/c3os/c3os-$FLAVOR:$TAG --MODEL=$MODEL --FLAVOR=$FLAVOR
|
./earthly.sh +all-arm --IMAGE_NAME=kairos-$FLAVOR-$TAG.img --IMAGE=quay.io/kairos/kairos-$FLAVOR:$TAG --MODEL=$MODEL --FLAVOR=$FLAVOR
|
||||||
- name: Upload results
|
- name: Upload results
|
||||||
uses: actions/upload-artifact@v2
|
uses: actions/upload-artifact@v2
|
||||||
with:
|
with:
|
||||||
|
48
.github/workflows/image.yaml
vendored
48
.github/workflows/image.yaml
vendored
@@ -42,40 +42,40 @@ jobs:
|
|||||||
- name: Build 🔧
|
- name: Build 🔧
|
||||||
env:
|
env:
|
||||||
FLAVOR: ${{ matrix.flavor }}
|
FLAVOR: ${{ matrix.flavor }}
|
||||||
IMAGE: quay.io/c3os/c3os-${{ matrix.flavor }}:latest
|
IMAGE: quay.io/kairos/kairos-${{ matrix.flavor }}:latest
|
||||||
run: |
|
run: |
|
||||||
./earthly.sh +all --IMAGE=$IMAGE --FLAVOR=$FLAVOR
|
./earthly.sh +all --IMAGE=$IMAGE --FLAVOR=$FLAVOR
|
||||||
sudo mv build/* .
|
sudo mv build/* .
|
||||||
sudo rm -rf build
|
sudo rm -rf build
|
||||||
- uses: actions/upload-artifact@v2
|
- uses: actions/upload-artifact@v2
|
||||||
with:
|
with:
|
||||||
name: c3os-${{ matrix.flavor }}.iso.zip
|
name: kairos-${{ matrix.flavor }}.iso.zip
|
||||||
path: |
|
path: |
|
||||||
*.iso
|
*.iso
|
||||||
*.sha256
|
*.sha256
|
||||||
if-no-files-found: error
|
if-no-files-found: error
|
||||||
- uses: actions/upload-artifact@v2
|
- uses: actions/upload-artifact@v2
|
||||||
with:
|
with:
|
||||||
name: c3os-${{ 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@v2
|
- uses: actions/upload-artifact@v2
|
||||||
with:
|
with:
|
||||||
name: c3os-${{ 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@v2
|
- uses: actions/upload-artifact@v2
|
||||||
with:
|
with:
|
||||||
name: c3os-${{ matrix.flavor }}.kernel.zip
|
name: kairos-${{ matrix.flavor }}.kernel.zip
|
||||||
path: |
|
path: |
|
||||||
*-kernel
|
*-kernel
|
||||||
*-initrd
|
*-initrd
|
||||||
if-no-files-found: error
|
if-no-files-found: error
|
||||||
- uses: actions/upload-artifact@v2
|
- uses: actions/upload-artifact@v2
|
||||||
with:
|
with:
|
||||||
name: c3os-${{ matrix.flavor }}.ipxe.zip
|
name: kairos-${{ matrix.flavor }}.ipxe.zip
|
||||||
path: |
|
path: |
|
||||||
*.ipxe
|
*.ipxe
|
||||||
if-no-files-found: error
|
if-no-files-found: error
|
||||||
@@ -84,12 +84,12 @@ jobs:
|
|||||||
env:
|
env:
|
||||||
COSIGN_EXPERIMENTAL: 1
|
COSIGN_EXPERIMENTAL: 1
|
||||||
run: |
|
run: |
|
||||||
docker push quay.io/c3os/c3os-${{ matrix.flavor }}:latest
|
docker push quay.io/kairos/kairos-${{ matrix.flavor }}:latest
|
||||||
cosign sign quay.io/c3os/c3os-${{ matrix.flavor }}:latest
|
cosign sign quay.io/kairos/kairos-${{ matrix.flavor }}:latest
|
||||||
- name: Push to testing
|
- name: Push to testing
|
||||||
run: |
|
run: |
|
||||||
docker tag quay.io/c3os/c3os-${{ matrix.flavor }}:latest ttl.sh/c3os-${{ matrix.flavor }}-${{ github.sha }}:8h
|
docker tag quay.io/kairos/kairos-${{ matrix.flavor }}:latest ttl.sh/kairos-${{ matrix.flavor }}-${{ github.sha }}:8h
|
||||||
docker push ttl.sh/c3os-${{ matrix.flavor }}-${{ github.sha }}:8h
|
docker push ttl.sh/kairos-${{ matrix.flavor }}-${{ github.sha }}:8h
|
||||||
# Test start
|
# Test start
|
||||||
build-vm-images:
|
build-vm-images:
|
||||||
needs:
|
needs:
|
||||||
@@ -113,20 +113,20 @@ jobs:
|
|||||||
- name: Download artifacts
|
- name: Download artifacts
|
||||||
uses: actions/download-artifact@v2
|
uses: actions/download-artifact@v2
|
||||||
with:
|
with:
|
||||||
name: c3os-${{ matrix.flavor }}.iso.zip
|
name: kairos-${{ matrix.flavor }}.iso.zip
|
||||||
- run: |
|
- run: |
|
||||||
git clone https://github.com/c3os-io/c3os
|
git clone https://github.com/kairos-io/kairos
|
||||||
ls -liah
|
ls -liah
|
||||||
iso=$(ls *.iso)
|
iso=$(ls *.iso)
|
||||||
bash c3os/scripts/build_vm.sh $iso
|
bash kairos/scripts/build_vm.sh $iso
|
||||||
- uses: actions/upload-artifact@v2
|
- uses: actions/upload-artifact@v2
|
||||||
with:
|
with:
|
||||||
name: c3os-${{ matrix.flavor }}.qcow2.tar.xz
|
name: kairos-${{ matrix.flavor }}.qcow2.tar.xz
|
||||||
path: |
|
path: |
|
||||||
*.qcow2.tar.xz
|
*.qcow2.tar.xz
|
||||||
- uses: actions/upload-artifact@v2
|
- uses: actions/upload-artifact@v2
|
||||||
with:
|
with:
|
||||||
name: c3os-${{ matrix.flavor }}.ova
|
name: kairos-${{ matrix.flavor }}.ova
|
||||||
path: |
|
path: |
|
||||||
*.ova
|
*.ova
|
||||||
if-no-files-found: error
|
if-no-files-found: error
|
||||||
@@ -172,7 +172,7 @@ jobs:
|
|||||||
- name: Download artifacts
|
- name: Download artifacts
|
||||||
uses: actions/download-artifact@v2
|
uses: actions/download-artifact@v2
|
||||||
with:
|
with:
|
||||||
name: c3os-${{ matrix.flavor }}.iso.zip
|
name: kairos-${{ matrix.flavor }}.iso.zip
|
||||||
- name: Download artifacts
|
- name: Download artifacts
|
||||||
uses: actions/download-artifact@v2
|
uses: actions/download-artifact@v2
|
||||||
with:
|
with:
|
||||||
@@ -221,7 +221,7 @@ jobs:
|
|||||||
- name: Download artifacts
|
- name: Download artifacts
|
||||||
uses: actions/download-artifact@v2
|
uses: actions/download-artifact@v2
|
||||||
with:
|
with:
|
||||||
name: c3os-${{ matrix.flavor }}.iso.zip
|
name: kairos-${{ matrix.flavor }}.iso.zip
|
||||||
- name: Download artifacts
|
- name: Download artifacts
|
||||||
uses: actions/download-artifact@v2
|
uses: actions/download-artifact@v2
|
||||||
with:
|
with:
|
||||||
@@ -291,7 +291,7 @@ jobs:
|
|||||||
- name: Download artifacts
|
- name: Download artifacts
|
||||||
uses: actions/download-artifact@v2
|
uses: actions/download-artifact@v2
|
||||||
with:
|
with:
|
||||||
name: c3os-${{ matrix.flavor }}.iso.zip
|
name: kairos-${{ matrix.flavor }}.iso.zip
|
||||||
- name: Download artifacts
|
- name: Download artifacts
|
||||||
uses: actions/download-artifact@v2
|
uses: actions/download-artifact@v2
|
||||||
with:
|
with:
|
||||||
@@ -327,7 +327,7 @@ jobs:
|
|||||||
# A flag to set the download target as latest release
|
# A flag to set the download target as latest release
|
||||||
# The default value is 'false'
|
# The default value is 'false'
|
||||||
latest: true
|
latest: true
|
||||||
repository: "c3os-io/provider-c3os"
|
repository: "kairos-io/provider-kairos"
|
||||||
fileName: "*.iso"
|
fileName: "*.iso"
|
||||||
out-file-path: "last-release"
|
out-file-path: "last-release"
|
||||||
- uses: actions/upload-artifact@v2
|
- uses: actions/upload-artifact@v2
|
||||||
@@ -354,8 +354,8 @@ jobs:
|
|||||||
with:
|
with:
|
||||||
go-version: '^1.16'
|
go-version: '^1.16'
|
||||||
- run: |
|
- run: |
|
||||||
./earthly.sh +build-c3os-agent-provider
|
./earthly.sh +build-kairos-agent-provider
|
||||||
sudo cp -rfv build/agent-provider-c3os /usr/bin/c3os
|
sudo cp -rfv build/agent-provider-kairos /usr/bin/kairos
|
||||||
export CLOUD_INIT=$PWD/tests/assets/qrcode.yaml
|
export CLOUD_INIT=$PWD/tests/assets/qrcode.yaml
|
||||||
export FLAVOR=${{ matrix.flavor }}
|
export FLAVOR=${{ matrix.flavor }}
|
||||||
./.github/run_test.sh "qrcode-register"
|
./.github/run_test.sh "qrcode-register"
|
||||||
@@ -390,7 +390,7 @@ jobs:
|
|||||||
- name: Download artifacts
|
- name: Download artifacts
|
||||||
uses: actions/download-artifact@v2
|
uses: actions/download-artifact@v2
|
||||||
with:
|
with:
|
||||||
name: c3os-${{ matrix.flavor }}.iso.zip
|
name: kairos-${{ matrix.flavor }}.iso.zip
|
||||||
- name: Install deps
|
- name: Install deps
|
||||||
run: |
|
run: |
|
||||||
brew install cdrtools jq
|
brew install cdrtools jq
|
||||||
@@ -447,9 +447,9 @@ jobs:
|
|||||||
go-version: '^1.16'
|
go-version: '^1.16'
|
||||||
- run: |
|
- run: |
|
||||||
ls -liah
|
ls -liah
|
||||||
export ISO=$PWD/$(ls c3os-${{ matrix.flavor }}-*.iso | tail -n1 )
|
export ISO=$PWD/$(ls kairos-${{ matrix.flavor }}-*.iso | tail -n1 )
|
||||||
export GOPATH="/Users/runner/go"
|
export GOPATH="/Users/runner/go"
|
||||||
export CONTAINER_IMAGE=ttl.sh/c3os-${{ matrix.flavor }}-${{ github.sha }}:8h
|
export CONTAINER_IMAGE=ttl.sh/kairos-${{ matrix.flavor }}-${{ github.sha }}:8h
|
||||||
export PATH=$PATH:$GOPATH/bin
|
export PATH=$PATH:$GOPATH/bin
|
||||||
export CLOUD_INIT=$PWD/tests/assets/config.yaml
|
export CLOUD_INIT=$PWD/tests/assets/config.yaml
|
||||||
export CREATE_VM=true
|
export CREATE_VM=true
|
||||||
|
18
.github/workflows/release.yaml
vendored
18
.github/workflows/release.yaml
vendored
@@ -71,7 +71,7 @@ jobs:
|
|||||||
sudo mv release/*.sha256 ./
|
sudo mv release/*.sha256 ./
|
||||||
- uses: actions/upload-artifact@v2
|
- uses: actions/upload-artifact@v2
|
||||||
with:
|
with:
|
||||||
name: c3os-${{ matrix.flavor }}${{ matrix.k3s_version }}.iso.zip
|
name: kairos-${{ matrix.flavor }}${{ matrix.k3s_version }}.iso.zip
|
||||||
path: |
|
path: |
|
||||||
*.iso
|
*.iso
|
||||||
*.sha256
|
*.sha256
|
||||||
@@ -95,20 +95,20 @@ jobs:
|
|||||||
- name: Download artifacts
|
- name: Download artifacts
|
||||||
uses: actions/download-artifact@v2
|
uses: actions/download-artifact@v2
|
||||||
with:
|
with:
|
||||||
name: c3os-${{ matrix.flavor }}${{ matrix.k3s_version }}.iso.zip
|
name: kairos-${{ matrix.flavor }}${{ matrix.k3s_version }}.iso.zip
|
||||||
- run: |
|
- run: |
|
||||||
git clone https://github.com/c3os-io/c3os
|
git clone https://github.com/kairos-io/kairos
|
||||||
ls -liah
|
ls -liah
|
||||||
iso=$(ls *.iso)
|
iso=$(ls *.iso)
|
||||||
bash c3os/scripts/build_vm.sh $iso
|
bash kairos/scripts/build_vm.sh $iso
|
||||||
- uses: actions/upload-artifact@v2
|
- uses: actions/upload-artifact@v2
|
||||||
with:
|
with:
|
||||||
name: c3os-${{ matrix.flavor }}${{ matrix.k3s_version }}.qcow2.tar.xz
|
name: kairos-${{ matrix.flavor }}${{ matrix.k3s_version }}.qcow2.tar.xz
|
||||||
path: |
|
path: |
|
||||||
*.qcow2.tar.xz
|
*.qcow2.tar.xz
|
||||||
- uses: actions/upload-artifact@v2
|
- uses: actions/upload-artifact@v2
|
||||||
with:
|
with:
|
||||||
name: c3os-${{ matrix.flavor }}${{ matrix.k3s_version }}.ova
|
name: kairos-${{ matrix.flavor }}${{ matrix.k3s_version }}.ova
|
||||||
path: |
|
path: |
|
||||||
*.ova
|
*.ova
|
||||||
if-no-files-found: error
|
if-no-files-found: error
|
||||||
@@ -127,11 +127,11 @@ jobs:
|
|||||||
- name: Download artifacts
|
- name: Download artifacts
|
||||||
uses: actions/download-artifact@v2
|
uses: actions/download-artifact@v2
|
||||||
with:
|
with:
|
||||||
name: c3os-${{ matrix.flavor }}${{ matrix.k3s_version }}.qcow2.tar.xz
|
name: kairos-${{ matrix.flavor }}${{ matrix.k3s_version }}.qcow2.tar.xz
|
||||||
- name: Download artifacts
|
- name: Download artifacts
|
||||||
uses: actions/download-artifact@v2
|
uses: actions/download-artifact@v2
|
||||||
with:
|
with:
|
||||||
name: c3os-${{ matrix.flavor }}${{ matrix.k3s_version }}.ova
|
name: kairos-${{ matrix.flavor }}${{ matrix.k3s_version }}.ova
|
||||||
- run: |
|
- run: |
|
||||||
mkdir release
|
mkdir release
|
||||||
mv *.qcow2.tar.xz release/
|
mv *.qcow2.tar.xz release/
|
||||||
@@ -143,7 +143,7 @@ jobs:
|
|||||||
path_to_add: 'release'
|
path_to_add: 'release'
|
||||||
- run: |
|
- run: |
|
||||||
mkdir dist
|
mkdir dist
|
||||||
echo ${{ steps.web3.outputs.url }} > dist/c3os-${{ matrix.flavor }}-k3s${{ matrix.k3s_version }}.qcow2.url.txt
|
echo ${{ steps.web3.outputs.url }} > dist/kairos-${{ matrix.flavor }}-k3s${{ matrix.k3s_version }}.qcow2.url.txt
|
||||||
- name: Release
|
- name: Release
|
||||||
uses: softprops/action-gh-release@v1
|
uses: softprops/action-gh-release@v1
|
||||||
if: startsWith(github.ref, 'refs/tags/')
|
if: startsWith(github.ref, 'refs/tags/')
|
||||||
|
@@ -11,14 +11,14 @@ builds:
|
|||||||
- amd64
|
- amd64
|
||||||
- 386
|
- 386
|
||||||
main: ./
|
main: ./
|
||||||
id: "c3os-cli"
|
id: "kairos-cli"
|
||||||
binary: "c3os-cli"
|
binary: "kairos-cli"
|
||||||
source:
|
source:
|
||||||
enabled: true
|
enabled: true
|
||||||
name_template: 'c3os-cli-{{ .Tag }}-source'
|
name_template: 'kairos-cli-{{ .Tag }}-source'
|
||||||
archives:
|
archives:
|
||||||
# Default template uses underscores instead of -
|
# Default template uses underscores instead of -
|
||||||
- name_template: "c3os-cli-{{ .Tag }}-{{ .Os }}-{{ .Arch }}{{ if .Arm }}v{{ .Arm }}{{ end }}"
|
- name_template: "kairos-cli-{{ .Tag }}-{{ .Os }}-{{ .Arch }}{{ if .Arm }}v{{ .Arm }}{{ end }}"
|
||||||
replacements:
|
replacements:
|
||||||
darwin: Darwin
|
darwin: Darwin
|
||||||
linux: Linux
|
linux: Linux
|
||||||
@@ -26,7 +26,7 @@ archives:
|
|||||||
386: i386
|
386: i386
|
||||||
amd64: x86_64
|
amd64: x86_64
|
||||||
checksum:
|
checksum:
|
||||||
name_template: 'c3os-cli-{{ .Tag }}-checksums.txt'
|
name_template: 'kairos-cli-{{ .Tag }}-checksums.txt'
|
||||||
snapshot:
|
snapshot:
|
||||||
name_template: "{{ .Tag }}-next"
|
name_template: "{{ .Tag }}-next"
|
||||||
changelog:
|
changelog:
|
||||||
|
60
Earthfile
60
Earthfile
@@ -1,9 +1,9 @@
|
|||||||
VERSION 0.6
|
VERSION 0.6
|
||||||
|
|
||||||
IMPORT github.com/c3os-io/c3os
|
IMPORT github.com/kairos-io/kairos
|
||||||
|
|
||||||
FROM alpine
|
FROM alpine
|
||||||
ARG VARIANT=c3os # core, lite, framework
|
ARG VARIANT=kairos # core, lite, framework
|
||||||
ARG FLAVOR=opensuse
|
ARG FLAVOR=opensuse
|
||||||
|
|
||||||
## Versioning
|
## Versioning
|
||||||
@@ -16,8 +16,8 @@ ARG VERSION=$(cat VERSION)
|
|||||||
RUN echo "version ${VERSION}"
|
RUN echo "version ${VERSION}"
|
||||||
ARG K3S_VERSION_TAG=$(echo $K3S_VERSION | sed s/+/-/)
|
ARG K3S_VERSION_TAG=$(echo $K3S_VERSION | sed s/+/-/)
|
||||||
ARG TAG=${VERSION}-k3s${K3S_VERSION_TAG}
|
ARG TAG=${VERSION}-k3s${K3S_VERSION_TAG}
|
||||||
ARG IMAGE=quay.io/c3os/${VARIANT}-${FLAVOR}:$TAG
|
ARG IMAGE=quay.io/kairos/${VARIANT}-${FLAVOR}:$TAG
|
||||||
ARG BASE_IMAGE=quay.io/c3os/core-${FLAVOR}:${CORE_VERSION}
|
ARG BASE_IMAGE=quay.io/kairos/core-${FLAVOR}:${CORE_VERSION}
|
||||||
ARG ISO_NAME=${VARIANT}-${FLAVOR}-${VERSION}-k3s${K3S_VERSION}
|
ARG ISO_NAME=${VARIANT}-${FLAVOR}-${VERSION}-k3s${K3S_VERSION}
|
||||||
|
|
||||||
## External deps pinned versions
|
## External deps pinned versions
|
||||||
@@ -26,7 +26,7 @@ ARG ELEMENTAL_IMAGE=quay.io/costoolkit/elemental-cli:v0.0.15-8a78e6b
|
|||||||
ARG GOLINT_VERSION=1.47.3
|
ARG GOLINT_VERSION=1.47.3
|
||||||
ARG GO_VERSION=1.18
|
ARG GO_VERSION=1.18
|
||||||
|
|
||||||
ARG OS_ID=c3os
|
ARG OS_ID=kairos
|
||||||
ARG CGO_ENABLED=0
|
ARG CGO_ENABLED=0
|
||||||
|
|
||||||
RELEASEVERSION:
|
RELEASEVERSION:
|
||||||
@@ -83,12 +83,12 @@ BUILD_GOLANG:
|
|||||||
RUN go build -ldflags "-s -w" -o ${BIN} ${SRC} && upx ${BIN}
|
RUN go build -ldflags "-s -w" -o ${BIN} ${SRC} && upx ${BIN}
|
||||||
SAVE ARTIFACT ${BIN} ${BIN} AS LOCAL build/${BIN}
|
SAVE ARTIFACT ${BIN} ${BIN} AS LOCAL build/${BIN}
|
||||||
|
|
||||||
build-c3os-agent-provider:
|
build-kairos-agent-provider:
|
||||||
FROM +go-deps
|
FROM +go-deps
|
||||||
DO +BUILD_GOLANG --BIN=agent-provider-c3os --SRC=./ --CGO_ENABLED=$CGO_ENABLED
|
DO +BUILD_GOLANG --BIN=agent-provider-kairos --SRC=./ --CGO_ENABLED=$CGO_ENABLED
|
||||||
|
|
||||||
build:
|
build:
|
||||||
BUILD +build-c3os-agent-provider
|
BUILD +build-kairos-agent-provider
|
||||||
|
|
||||||
dist:
|
dist:
|
||||||
ARG GO_VERSION
|
ARG GO_VERSION
|
||||||
@@ -134,8 +134,8 @@ docker:
|
|||||||
RUN rm -rf /etc/rancher/k3s/k3s.env /etc/rancher/k3s/k3s-agent.env && touch /etc/rancher/k3s/.keep
|
RUN rm -rf /etc/rancher/k3s/k3s.env /etc/rancher/k3s/k3s-agent.env && touch /etc/rancher/k3s/.keep
|
||||||
END
|
END
|
||||||
|
|
||||||
COPY +build-c3os-agent-provider/agent-provider-c3os /system/providers/agent-provider-c3os
|
COPY +build-kairos-agent-provider/agent-provider-kairos /system/providers/agent-provider-kairos
|
||||||
RUN ln -s /system/providers/agent-provider-c3os /usr/bin/c3os
|
RUN ln -s /system/providers/agent-provider-kairos /usr/bin/kairos
|
||||||
|
|
||||||
ARG C3OS_VERSION
|
ARG C3OS_VERSION
|
||||||
IF [ "$C3OS_VERSION" = "" ]
|
IF [ "$C3OS_VERSION" = "" ]
|
||||||
@@ -146,10 +146,10 @@ docker:
|
|||||||
|
|
||||||
ARG OS_ID
|
ARG OS_ID
|
||||||
ARG OS_NAME=${OS_ID}-${FLAVOR}
|
ARG OS_NAME=${OS_ID}-${FLAVOR}
|
||||||
ARG OS_REPO=quay.io/c3os/${VARIANT}-${FLAVOR}
|
ARG OS_REPO=quay.io/kairos/${VARIANT}-${FLAVOR}
|
||||||
ARG OS_LABEL=latest
|
ARG OS_LABEL=latest
|
||||||
|
|
||||||
DO c3os+OSRELEASE --BUG_REPORT_URL="https://github.com/c3os-io/c3os/issues/new/choose" --HOME_URL="https://github.com/c3os-io/provider-c3os" --OS_ID=${OS_ID} --OS_LABEL=${OS_LABEL} --OS_NAME=${OS_NAME} --OS_REPO=${OS_REPO} --OS_VERSION=${OS_VERSION}-k3s${K3S_VERSION} --GITHUB_REPO="c3os-io/provider-c3os"
|
DO kairos+OSRELEASE --BUG_REPORT_URL="https://github.com/kairos-io/kairos/issues/new/choose" --HOME_URL="https://github.com/kairos-io/provider-kairos" --OS_ID=${OS_ID} --OS_LABEL=${OS_LABEL} --OS_NAME=${OS_NAME} --OS_REPO=${OS_REPO} --OS_VERSION=${OS_VERSION}-k3s${K3S_VERSION} --GITHUB_REPO="kairos-io/provider-kairos"
|
||||||
|
|
||||||
SAVE IMAGE $IMAGE
|
SAVE IMAGE $IMAGE
|
||||||
|
|
||||||
@@ -162,18 +162,18 @@ elemental:
|
|||||||
FROM ${ELEMENTAL_IMAGE}
|
FROM ${ELEMENTAL_IMAGE}
|
||||||
SAVE ARTIFACT /usr/bin/elemental elemental
|
SAVE ARTIFACT /usr/bin/elemental elemental
|
||||||
|
|
||||||
c3os:
|
kairos:
|
||||||
ARG C3OS_VERSION=master
|
ARG C3OS_VERSION=master
|
||||||
FROM alpine
|
FROM alpine
|
||||||
RUN apk add git
|
RUN apk add git
|
||||||
WORKDIR /c3os
|
WORKDIR /kairos
|
||||||
RUN git clone https://github.com/c3os-io/c3os /c3os && cd /c3os && git checkout "$C3OS_VERSION"
|
RUN git clone https://github.com/kairos-io/kairos /kairos && cd /kairos && git checkout "$C3OS_VERSION"
|
||||||
SAVE ARTIFACT /c3os/
|
SAVE ARTIFACT /kairos/
|
||||||
|
|
||||||
get-c3os-scripts:
|
get-kairos-scripts:
|
||||||
FROM alpine
|
FROM alpine
|
||||||
WORKDIR /build
|
WORKDIR /build
|
||||||
COPY +c3os/c3os/ ./
|
COPY +kairos/kairos/ ./
|
||||||
SAVE ARTIFACT /build/scripts AS LOCAL scripts
|
SAVE ARTIFACT /build/scripts AS LOCAL scripts
|
||||||
|
|
||||||
iso:
|
iso:
|
||||||
@@ -189,27 +189,27 @@ iso:
|
|||||||
|
|
||||||
COPY . ./
|
COPY . ./
|
||||||
RUN mkdir -p overlay/files-iso
|
RUN mkdir -p overlay/files-iso
|
||||||
COPY +c3os/c3os/overlay/files-iso/ ./overlay/files-iso/
|
COPY +kairos/kairos/overlay/files-iso/ ./overlay/files-iso/
|
||||||
|
|
||||||
WITH DOCKER --allow-privileged --load $IMAGE=(+docker)
|
WITH DOCKER --allow-privileged --load $IMAGE=(+docker)
|
||||||
RUN elemental --repo $TOOLKIT_REPOSITORY --name $ISO_NAME --debug build-iso --date=false --local --overlay-iso /build/${overlay} $IMAGE --output /build/
|
RUN elemental --repo $TOOLKIT_REPOSITORY --name $ISO_NAME --debug build-iso --date=false --local --overlay-iso /build/${overlay} $IMAGE --output /build/
|
||||||
END
|
END
|
||||||
# See: https://github.com/rancher/elemental-cli/issues/228
|
# See: https://github.com/rancher/elemental-cli/issues/228
|
||||||
RUN sha256sum $ISO_NAME.iso > $ISO_NAME.iso.sha256
|
RUN sha256sum $ISO_NAME.iso > $ISO_NAME.iso.sha256
|
||||||
SAVE ARTIFACT /build/$ISO_NAME.iso c3os.iso AS LOCAL build/$ISO_NAME.iso
|
SAVE ARTIFACT /build/$ISO_NAME.iso kairos.iso AS LOCAL build/$ISO_NAME.iso
|
||||||
SAVE ARTIFACT /build/$ISO_NAME.iso.sha256 c3os.iso.sha256 AS LOCAL build/$ISO_NAME.iso.sha256
|
SAVE ARTIFACT /build/$ISO_NAME.iso.sha256 kairos.iso.sha256 AS LOCAL build/$ISO_NAME.iso.sha256
|
||||||
|
|
||||||
netboot:
|
netboot:
|
||||||
FROM opensuse/leap
|
FROM opensuse/leap
|
||||||
ARG VERSION
|
ARG VERSION
|
||||||
ARG ISO_NAME
|
ARG ISO_NAME
|
||||||
WORKDIR /build
|
WORKDIR /build
|
||||||
COPY +iso/c3os.iso c3os.iso
|
COPY +iso/kairos.iso kairos.iso
|
||||||
COPY . .
|
COPY . .
|
||||||
RUN zypper in -y cdrtools
|
RUN zypper in -y cdrtools
|
||||||
|
|
||||||
COPY +c3os/c3os/scripts/netboot.sh ./
|
COPY +kairos/kairos/scripts/netboot.sh ./
|
||||||
RUN sh netboot.sh c3os.iso $ISO_NAME $VERSION
|
RUN sh netboot.sh kairos.iso $ISO_NAME $VERSION
|
||||||
|
|
||||||
SAVE ARTIFACT /build/$ISO_NAME.squashfs squashfs AS LOCAL build/$ISO_NAME.squashfs
|
SAVE ARTIFACT /build/$ISO_NAME.squashfs squashfs AS LOCAL build/$ISO_NAME.squashfs
|
||||||
SAVE ARTIFACT /build/$ISO_NAME-kernel kernel AS LOCAL build/$ISO_NAME-kernel
|
SAVE ARTIFACT /build/$ISO_NAME-kernel kernel AS LOCAL build/$ISO_NAME-kernel
|
||||||
@@ -323,13 +323,13 @@ run-qemu-tests:
|
|||||||
|
|
||||||
IF [ "$FROM_ARTIFACTS" = "true" ]
|
IF [ "$FROM_ARTIFACTS" = "true" ]
|
||||||
COPY . .
|
COPY . .
|
||||||
ENV ISO=/test/build/c3os.iso
|
ENV ISO=/test/build/kairos.iso
|
||||||
ENV DATASOURCE=/test/build/datasource.iso
|
ENV DATASOURCE=/test/build/datasource.iso
|
||||||
ELSE
|
ELSE
|
||||||
COPY ./tests .
|
COPY ./tests .
|
||||||
COPY +iso/c3os.iso c3os.iso
|
COPY +iso/kairos.iso kairos.iso
|
||||||
COPY ( +datasource-iso/iso.iso --CLOUD_CONFIG=$CLOUD_CONFIG) datasource.iso
|
COPY ( +datasource-iso/iso.iso --CLOUD_CONFIG=$CLOUD_CONFIG) datasource.iso
|
||||||
ENV ISO=/test/c3os.iso
|
ENV ISO=/test/kairos.iso
|
||||||
ENV DATASOURCE=/test/datasource.iso
|
ENV DATASOURCE=/test/datasource.iso
|
||||||
END
|
END
|
||||||
|
|
||||||
@@ -340,12 +340,12 @@ run-qemu-tests:
|
|||||||
test-create-config:
|
test-create-config:
|
||||||
FROM alpine
|
FROM alpine
|
||||||
ARG WITH_DNS
|
ARG WITH_DNS
|
||||||
COPY +build-c3os-agent-provider/agent-provider-c3os agent-provider-c3os
|
COPY +build-kairos-agent-provider/agent-provider-kairos agent-provider-kairos
|
||||||
COPY . .
|
COPY . .
|
||||||
RUN ./agent-provider-c3os create-config > config.yaml
|
RUN ./agent-provider-kairos create-config > config.yaml
|
||||||
RUN cat tests/assets/config.yaml >> config.yaml
|
RUN cat tests/assets/config.yaml >> config.yaml
|
||||||
IF [ "$WITH_DNS" == "true" ]
|
IF [ "$WITH_DNS" == "true" ]
|
||||||
RUN apk add yq
|
RUN apk add yq
|
||||||
RUN yq -i '.c3os.dns = true' 'config.yaml'
|
RUN yq -i '.kairos.dns = true' 'config.yaml'
|
||||||
END
|
END
|
||||||
SAVE ARTIFACT config.yaml AS LOCAL config.yaml
|
SAVE ARTIFACT config.yaml AS LOCAL config.yaml
|
||||||
|
12
README.md
12
README.md
@@ -9,7 +9,7 @@
|
|||||||
|
|
||||||
This repository generates c3OS images with full-mesh support. full-mesh support currently is available only with k3s, and the provider follows strictly k3s releases.
|
This repository generates c3OS images with full-mesh support. full-mesh support currently is available only with k3s, and the provider follows strictly k3s releases.
|
||||||
|
|
||||||
To use c3os with mesh support, either download the bootable medium in the releases, or either use c3os light/core with the provider-c3os bundles, during configuration like so:
|
To use kairosos with mesh support, either download the bootable medium in the releases, or either use kairos light/core with the provider-kairos bundles, during configuration like so:
|
||||||
```yaml
|
```yaml
|
||||||
#node-config
|
#node-config
|
||||||
|
|
||||||
@@ -19,11 +19,11 @@ bundles:
|
|||||||
|
|
||||||
## Upgrades
|
## Upgrades
|
||||||
|
|
||||||
Upgrading can be done either via Kubernetes or manually with `c3os-agent upgrade --image <image>`, or you can list available versions with `c3os-agent upgrade list-releases`.
|
Upgrading can be done either via Kubernetes or manually with `kairos-agent upgrade --image <image>`, or you can list available versions with `kairos-agent upgrade list-releases`.
|
||||||
|
|
||||||
Container images available for upgrades are pushed to quay:
|
Container images available for upgrades are pushed to quay:
|
||||||
|
|
||||||
- [OpenSUSE based](https://quay.io/repository/c3os/c3os-opensuse)
|
- [OpenSUSE based](https://quay.io/repository/kairos/kairos-opensuse)
|
||||||
- [Alpine based](https://quay.io/repository/c3os/c3os-alpine)
|
- [Alpine based](https://quay.io/repository/kairos/kairos-alpine)
|
||||||
- [OpenSUSE RaspberryPi 3/4](https://quay.io/repository/c3os/c3os-opensuse-arm-rpi)
|
- [OpenSUSE RaspberryPi 3/4](https://quay.io/repository/kairos/kairos-opensuse-arm-rpi)
|
||||||
- [Alpine RaspberryPi 3/4](https://quay.io/repository/c3os/c3os-alpine-arm-rpi)
|
- [Alpine RaspberryPi 3/4](https://quay.io/repository/kairos/kairos-alpine-arm-rpi)
|
4
go.mod
4
go.mod
@@ -1,11 +1,11 @@
|
|||||||
module github.com/c3os-io/provider-c3os
|
module github.com/kairos-io/provider-kairos
|
||||||
|
|
||||||
go 1.18
|
go 1.18
|
||||||
|
|
||||||
replace github.com/elastic/gosigar => github.com/mudler/gosigar v0.14.3-0.20220502202347-34be910bdaaf
|
replace github.com/elastic/gosigar => github.com/mudler/gosigar v0.14.3-0.20220502202347-34be910bdaaf
|
||||||
|
|
||||||
require (
|
require (
|
||||||
github.com/c3os-io/c3os v1.24.3-56.0.20220818151915-d719856bd7c3
|
github.com/kairos-io/kairos v1.24.3-56.0.20220818151915-d719856bd7c3
|
||||||
github.com/creack/pty v1.1.19-0.20220421211855-0d412c9fbeb1
|
github.com/creack/pty v1.1.19-0.20220421211855-0d412c9fbeb1
|
||||||
github.com/gliderlabs/ssh v0.2.2
|
github.com/gliderlabs/ssh v0.2.2
|
||||||
github.com/google/go-containerregistry v0.11.0
|
github.com/google/go-containerregistry v0.11.0
|
||||||
|
8
go.sum
8
go.sum
@@ -187,10 +187,10 @@ github.com/buger/jsonparser v0.0.0-20181115193947-bf1c66bbce23/go.mod h1:bbYlZJ7
|
|||||||
github.com/butuzov/ireturn v0.1.1/go.mod h1:Wh6Zl3IMtTpaIKbmwzqi6olnM9ptYQxxVacMsOEFPoc=
|
github.com/butuzov/ireturn v0.1.1/go.mod h1:Wh6Zl3IMtTpaIKbmwzqi6olnM9ptYQxxVacMsOEFPoc=
|
||||||
github.com/c-robinson/iplib v1.0.3 h1:NG0UF0GoEsrC1/vyfX1Lx2Ss7CySWl3KqqXh3q4DdPU=
|
github.com/c-robinson/iplib v1.0.3 h1:NG0UF0GoEsrC1/vyfX1Lx2Ss7CySWl3KqqXh3q4DdPU=
|
||||||
github.com/c-robinson/iplib v1.0.3/go.mod h1:i3LuuFL1hRT5gFpBRnEydzw8R6yhGkF4szNDIbF8pgo=
|
github.com/c-robinson/iplib v1.0.3/go.mod h1:i3LuuFL1hRT5gFpBRnEydzw8R6yhGkF4szNDIbF8pgo=
|
||||||
github.com/c3os-io/c3os v1.24.3-56.0.20220812161215-f983eeb2bf4f h1:sYDd9y7rn3BvE5iKaxBJqhr3kZQNDhbJSc8WRMemB8I=
|
github.com/kairos-io/kairos v1.24.3-56.0.20220812161215-f983eeb2bf4f h1:sYDd9y7rn3BvE5iKaxBJqhr3kZQNDhbJSc8WRMemB8I=
|
||||||
github.com/c3os-io/c3os v1.24.3-56.0.20220812161215-f983eeb2bf4f/go.mod h1:YvuC8j7UNOKlYgOWJIBGw0iK+wZqqnYT1aMpTvaDAvE=
|
github.com/kairos-io/kairos v1.24.3-56.0.20220812161215-f983eeb2bf4f/go.mod h1:YvuC8j7UNOKlYgOWJIBGw0iK+wZqqnYT1aMpTvaDAvE=
|
||||||
github.com/c3os-io/c3os v1.24.3-56.0.20220818151915-d719856bd7c3 h1:6WPdTiAWhxVyF2SecI5y9COscCll0W93UoJmtu9nrbU=
|
github.com/kairos-io/kairos v1.24.3-56.0.20220818151915-d719856bd7c3 h1:6WPdTiAWhxVyF2SecI5y9COscCll0W93UoJmtu9nrbU=
|
||||||
github.com/c3os-io/c3os v1.24.3-56.0.20220818151915-d719856bd7c3/go.mod h1:YvuC8j7UNOKlYgOWJIBGw0iK+wZqqnYT1aMpTvaDAvE=
|
github.com/kairos-io/kairos v1.24.3-56.0.20220818151915-d719856bd7c3/go.mod h1:YvuC8j7UNOKlYgOWJIBGw0iK+wZqqnYT1aMpTvaDAvE=
|
||||||
github.com/casbin/casbin/v2 v2.1.2/go.mod h1:YcPU1XXisHhLzuxH9coDNf2FbKpjGlbCg3n9yuLkIJQ=
|
github.com/casbin/casbin/v2 v2.1.2/go.mod h1:YcPU1XXisHhLzuxH9coDNf2FbKpjGlbCg3n9yuLkIJQ=
|
||||||
github.com/cavaliergopher/grab v2.0.0+incompatible/go.mod h1:6ICNRTQPwkMP0m2sKIDv/9XkhFJJwiEOQyZ+8E4H7Yg=
|
github.com/cavaliergopher/grab v2.0.0+incompatible/go.mod h1:6ICNRTQPwkMP0m2sKIDv/9XkhFJJwiEOQyZ+8E4H7Yg=
|
||||||
github.com/cenkalti/backoff v2.2.1+incompatible/go.mod h1:90ReRw6GdpyfrHakVjL/QHaoyV4aDUVVkXQJJJ3NXXM=
|
github.com/cenkalti/backoff v2.2.1+incompatible/go.mod h1:90ReRw6GdpyfrHakVjL/QHaoyV4aDUVVkXQJJJ3NXXM=
|
||||||
|
@@ -6,8 +6,8 @@ import (
|
|||||||
"net"
|
"net"
|
||||||
"time"
|
"time"
|
||||||
|
|
||||||
"github.com/c3os-io/c3os/pkg/utils"
|
|
||||||
"github.com/ipfs/go-log"
|
"github.com/ipfs/go-log"
|
||||||
|
"github.com/kairos-io/kairos/pkg/utils"
|
||||||
"github.com/mudler/edgevpn/api"
|
"github.com/mudler/edgevpn/api"
|
||||||
"github.com/mudler/edgevpn/pkg/logger"
|
"github.com/mudler/edgevpn/pkg/logger"
|
||||||
"github.com/mudler/edgevpn/pkg/node"
|
"github.com/mudler/edgevpn/pkg/node"
|
||||||
@@ -51,7 +51,7 @@ func bridge(c *cli.Context) error {
|
|||||||
|
|
||||||
ctx := context.Background()
|
ctx := context.Background()
|
||||||
|
|
||||||
nc := networkConfig(token, c.String("address"), c.String("log-level"), "c3os0")
|
nc := networkConfig(token, c.String("address"), c.String("log-level"), "kairos0")
|
||||||
|
|
||||||
lvl, err := log.LevelFromString(nc.LogLevel)
|
lvl, err := log.LevelFromString(nc.LogLevel)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
|
@@ -5,8 +5,8 @@ import (
|
|||||||
"os"
|
"os"
|
||||||
"path/filepath"
|
"path/filepath"
|
||||||
|
|
||||||
"github.com/c3os-io/c3os/pkg/config"
|
"github.com/kairos-io/kairos/pkg/config"
|
||||||
. "github.com/c3os-io/provider-c3os/internal/cli"
|
. "github.com/kairos-io/provider-kairos/internal/cli"
|
||||||
. "github.com/onsi/ginkgo/v2"
|
. "github.com/onsi/ginkgo/v2"
|
||||||
. "github.com/onsi/gomega"
|
. "github.com/onsi/gomega"
|
||||||
"gopkg.in/yaml.v2"
|
"gopkg.in/yaml.v2"
|
||||||
@@ -15,7 +15,7 @@ import (
|
|||||||
type TConfig struct {
|
type TConfig struct {
|
||||||
C3OS struct {
|
C3OS struct {
|
||||||
NetworkToken string `yaml:"network_token"`
|
NetworkToken string `yaml:"network_token"`
|
||||||
} `yaml:"c3os"`
|
} `yaml:"kairos"`
|
||||||
}
|
}
|
||||||
|
|
||||||
var _ = Describe("Get config", func() {
|
var _ = Describe("Get config", func() {
|
||||||
@@ -24,7 +24,7 @@ var _ = Describe("Get config", func() {
|
|||||||
It("replace token in config files", func() {
|
It("replace token in config files", func() {
|
||||||
|
|
||||||
var cc string = `#node-config
|
var cc string = `#node-config
|
||||||
c3os:
|
kairos:
|
||||||
network_token: "foo"
|
network_token: "foo"
|
||||||
|
|
||||||
bb:
|
bb:
|
||||||
@@ -54,7 +54,7 @@ fooz:
|
|||||||
Expect(hasHeader).To(BeTrue())
|
Expect(hasHeader).To(BeTrue())
|
||||||
|
|
||||||
Expect(res).To(Equal(map[interface{}]interface{}{
|
Expect(res).To(Equal(map[interface{}]interface{}{
|
||||||
"c3os": map[interface{}]interface{}{"network_token": "baz"},
|
"kairos": map[interface{}]interface{}{"network_token": "baz"},
|
||||||
"bb": map[interface{}]interface{}{"nothing": "foo"},
|
"bb": map[interface{}]interface{}{"nothing": "foo"},
|
||||||
}))
|
}))
|
||||||
})
|
})
|
||||||
|
@@ -64,7 +64,7 @@ func networkConfig(token, address, loglevel, i string) *edgevpnConfig.Config {
|
|||||||
|
|
||||||
func startRecoveryService(ctx context.Context, token, name, address, loglevel string) error {
|
func startRecoveryService(ctx context.Context, token, name, address, loglevel string) error {
|
||||||
|
|
||||||
nc := networkConfig(token, "", loglevel, "c3osrecovery0")
|
nc := networkConfig(token, "", loglevel, "kairosrecovery0")
|
||||||
|
|
||||||
lvl, err := log.LevelFromString(loglevel)
|
lvl, err := log.LevelFromString(loglevel)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
|
@@ -6,10 +6,10 @@ import (
|
|||||||
"io/ioutil"
|
"io/ioutil"
|
||||||
"os"
|
"os"
|
||||||
|
|
||||||
config "github.com/c3os-io/c3os/pkg/config"
|
config "github.com/kairos-io/kairos/pkg/config"
|
||||||
"github.com/c3os-io/provider-c3os/internal/provider"
|
"github.com/kairos-io/provider-kairos/internal/provider"
|
||||||
providerConfig "github.com/c3os-io/provider-c3os/internal/provider/config"
|
providerConfig "github.com/kairos-io/provider-kairos/internal/provider/config"
|
||||||
"github.com/c3os-io/provider-c3os/internal/services"
|
"github.com/kairos-io/provider-kairos/internal/services"
|
||||||
"gopkg.in/yaml.v3"
|
"gopkg.in/yaml.v3"
|
||||||
)
|
)
|
||||||
|
|
||||||
@@ -63,9 +63,9 @@ func ReplaceToken(dir []string, token string) (err error) {
|
|||||||
return err
|
return err
|
||||||
}
|
}
|
||||||
|
|
||||||
section, exists := content["c3os"]
|
section, exists := content["kairos"]
|
||||||
if !exists {
|
if !exists {
|
||||||
return errors.New("no c3os section in config file")
|
return errors.New("no kairos section in config file")
|
||||||
}
|
}
|
||||||
|
|
||||||
dd, err := yaml.Marshal(section)
|
dd, err := yaml.Marshal(section)
|
||||||
@@ -80,7 +80,7 @@ func ReplaceToken(dir []string, token string) (err error) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
piece["network_token"] = token
|
piece["network_token"] = token
|
||||||
content["c3os"] = piece
|
content["kairos"] = piece
|
||||||
|
|
||||||
d, err := yaml.Marshal(content)
|
d, err := yaml.Marshal(content)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
|
@@ -9,7 +9,7 @@ import (
|
|||||||
|
|
||||||
edgeVPNClient "github.com/mudler/edgevpn/api/client"
|
edgeVPNClient "github.com/mudler/edgevpn/api/client"
|
||||||
|
|
||||||
providerConfig "github.com/c3os-io/provider-c3os/internal/provider/config"
|
providerConfig "github.com/kairos-io/provider-kairos/internal/provider/config"
|
||||||
"github.com/urfave/cli"
|
"github.com/urfave/cli"
|
||||||
"gopkg.in/yaml.v1"
|
"gopkg.in/yaml.v1"
|
||||||
|
|
||||||
@@ -25,7 +25,7 @@ var networkAPI = []cli.Flag{
|
|||||||
},
|
},
|
||||||
&cli.StringFlag{
|
&cli.StringFlag{
|
||||||
Name: "network-id",
|
Name: "network-id",
|
||||||
Value: "c3os",
|
Value: "kairos",
|
||||||
Usage: "Kubernetes Network Deployment ID",
|
Usage: "Kubernetes Network Deployment ID",
|
||||||
},
|
},
|
||||||
}
|
}
|
||||||
@@ -34,12 +34,12 @@ const recoveryAddr = "127.0.0.1:2222"
|
|||||||
|
|
||||||
func Start() error {
|
func Start() error {
|
||||||
app := &cli.App{
|
app := &cli.App{
|
||||||
Name: "c3os",
|
Name: "kairos",
|
||||||
Version: "0.1",
|
Version: "0.1",
|
||||||
Author: "Ettore Di Giacinto",
|
Author: "Ettore Di Giacinto",
|
||||||
Usage: "c3os CLI to bootstrap, upgrade, connect and manage a c3os network",
|
Usage: "kairos CLI to bootstrap, upgrade, connect and manage a kairos network",
|
||||||
Description: `
|
Description: `
|
||||||
The c3os CLI can be used to manage a c3os box and perform all day-two tasks, like:
|
The kairos CLI can be used to manage a kairos box and perform all day-two tasks, like:
|
||||||
- register a node
|
- register a node
|
||||||
- connect to a node in recovery mode
|
- connect to a node in recovery mode
|
||||||
- to establish a VPN connection
|
- to establish a VPN connection
|
||||||
@@ -48,7 +48,7 @@ The c3os CLI can be used to manage a c3os box and perform all day-two tasks, lik
|
|||||||
|
|
||||||
and much more.
|
and much more.
|
||||||
|
|
||||||
For all the example cases, see: https://docs.c3os.io .
|
For all the example cases, see: https://docs.kairos.io .
|
||||||
`,
|
`,
|
||||||
UsageText: ``,
|
UsageText: ``,
|
||||||
Copyright: "Ettore Di Giacinto",
|
Copyright: "Ettore Di Giacinto",
|
||||||
@@ -89,16 +89,16 @@ For all the example cases, see: https://docs.c3os.io .
|
|||||||
UsageText: "register --reboot --device /dev/sda /image/snapshot.png",
|
UsageText: "register --reboot --device /dev/sda /image/snapshot.png",
|
||||||
Usage: "Registers and bootstraps a node",
|
Usage: "Registers and bootstraps a node",
|
||||||
Description: `
|
Description: `
|
||||||
Bootstraps a node which is started in pairing mode. It can send over a configuration file used to install the c3os node.
|
Bootstraps a node which is started in pairing mode. It can send over a configuration file used to install the kairos node.
|
||||||
|
|
||||||
For example:
|
For example:
|
||||||
$ c3os register --config config.yaml --device /dev/sda ~/Downloads/screenshot.png
|
$ kairos register --config config.yaml --device /dev/sda ~/Downloads/screenshot.png
|
||||||
|
|
||||||
will decode the QR code from ~/Downloads/screenshot.png and bootstrap the node remotely.
|
will decode the QR code from ~/Downloads/screenshot.png and bootstrap the node remotely.
|
||||||
|
|
||||||
If the image is omitted, a screenshot will be taken and used to decode the QR code.
|
If the image is omitted, a screenshot will be taken and used to decode the QR code.
|
||||||
|
|
||||||
See also https://docs.c3os.io/installation/device_pairing/ for documentation.
|
See also https://docs.kairos.io/installation/device_pairing/ for documentation.
|
||||||
`,
|
`,
|
||||||
ArgsUsage: "Register optionally accepts an image. If nothing is passed will take a screenshot of the screen and try to decode the QR code",
|
ArgsUsage: "Register optionally accepts an image. If nothing is passed will take a screenshot of the screen and try to decode the QR code",
|
||||||
Flags: []cli.Flag{
|
Flags: []cli.Flag{
|
||||||
@@ -137,9 +137,9 @@ For all the example cases, see: https://docs.c3os.io .
|
|||||||
{
|
{
|
||||||
Name: "bridge",
|
Name: "bridge",
|
||||||
UsageText: "bridge --network-token XXX",
|
UsageText: "bridge --network-token XXX",
|
||||||
Usage: "Connect to a c3os VPN network",
|
Usage: "Connect to a kairos VPN network",
|
||||||
Description: `
|
Description: `
|
||||||
Starts a bridge with a c3os network or a node.
|
Starts a bridge with a kairos network or a node.
|
||||||
|
|
||||||
# With a network
|
# With a network
|
||||||
|
|
||||||
@@ -147,7 +147,7 @@ For all the example cases, see: https://docs.c3os.io .
|
|||||||
|
|
||||||
For example:
|
For example:
|
||||||
|
|
||||||
$ sudo c3os bridge --network-token <TOKEN>
|
$ sudo kairos bridge --network-token <TOKEN>
|
||||||
|
|
||||||
Will start a VPN, which local ip is fixed to 10.1.0.254 (tweakable with --address).
|
Will start a VPN, which local ip is fixed to 10.1.0.254 (tweakable with --address).
|
||||||
|
|
||||||
@@ -155,16 +155,16 @@ For all the example cases, see: https://docs.c3os.io .
|
|||||||
|
|
||||||
# With a node
|
# With a node
|
||||||
|
|
||||||
"c3os bridge" can be used also to connect over to a node in recovery mode. When operating in this modality c3os bridge requires no specific permissions, indeed a tunnel
|
"kairos bridge" can be used also to connect over to a node in recovery mode. When operating in this modality kairos bridge requires no specific permissions, indeed a tunnel
|
||||||
will be created locally to connect to the machine remotely.
|
will be created locally to connect to the machine remotely.
|
||||||
|
|
||||||
For example:
|
For example:
|
||||||
|
|
||||||
$ c3os bridge --qr-code-image /path/to/image.png
|
$ kairos bridge --qr-code-image /path/to/image.png
|
||||||
|
|
||||||
Will scan the QR code in the image and connect over. Further instructions on how to connect over will be printed out to the screen.
|
Will scan the QR code in the image and connect over. Further instructions on how to connect over will be printed out to the screen.
|
||||||
|
|
||||||
See also: https://docs.c3os.io/after_install/troubleshooting/#connect-to-the-cluster-network and https://docs.c3os.io/after_install/recovery_mode/
|
See also: https://docs.kairos.io/after_install/troubleshooting/#connect-to-the-cluster-network and https://docs.kairos.io/after_install/recovery_mode/
|
||||||
|
|
||||||
`,
|
`,
|
||||||
Flags: []cli.Flag{
|
Flags: []cli.Flag{
|
||||||
@@ -210,7 +210,7 @@ For all the example cases, see: https://docs.c3os.io .
|
|||||||
Usage: "Specify an address for the bridge",
|
Usage: "Specify an address for the bridge",
|
||||||
},
|
},
|
||||||
&cli.StringFlag{
|
&cli.StringFlag{
|
||||||
Value: "/tmp/c3os",
|
Value: "/tmp/kairos",
|
||||||
Name: "lease-dir",
|
Name: "lease-dir",
|
||||||
EnvVar: "lease-dir",
|
EnvVar: "lease-dir",
|
||||||
Usage: "DHCP Lease directory",
|
Usage: "DHCP Lease directory",
|
||||||
@@ -221,7 +221,7 @@ For all the example cases, see: https://docs.c3os.io .
|
|||||||
{
|
{
|
||||||
Name: "get-kubeconfig",
|
Name: "get-kubeconfig",
|
||||||
Usage: "Return a deployment kubeconfig",
|
Usage: "Return a deployment kubeconfig",
|
||||||
UsageText: "Retrieve a c3os network kubeconfig (only for automated deployments)",
|
UsageText: "Retrieve a kairos network kubeconfig (only for automated deployments)",
|
||||||
Description: `
|
Description: `
|
||||||
Retrieve a network kubeconfig and prints out to screen.
|
Retrieve a network kubeconfig and prints out to screen.
|
||||||
|
|
||||||
@@ -229,7 +229,7 @@ For all the example cases, see: https://docs.c3os.io .
|
|||||||
|
|
||||||
For example:
|
For example:
|
||||||
|
|
||||||
$ c3os get-kubeconfig --network-id c3os
|
$ kairos get-kubeconfig --network-id kairos
|
||||||
`,
|
`,
|
||||||
Flags: networkAPI,
|
Flags: networkAPI,
|
||||||
Action: func(c *cli.Context) error {
|
Action: func(c *cli.Context) error {
|
||||||
@@ -251,16 +251,16 @@ For all the example cases, see: https://docs.c3os.io .
|
|||||||
Flags: networkAPI,
|
Flags: networkAPI,
|
||||||
Name: "set",
|
Name: "set",
|
||||||
Usage: "Set a node role",
|
Usage: "Set a node role",
|
||||||
UsageText: "c3os role set <UUID> master",
|
UsageText: "kairos role set <UUID> master",
|
||||||
Description: `
|
Description: `
|
||||||
Sets a node role propagating the setting to the network.
|
Sets a node role propagating the setting to the network.
|
||||||
|
|
||||||
A role must be set prior to the node joining a network. You can retrieve a node UUID by running "c3os uuid".
|
A role must be set prior to the node joining a network. You can retrieve a node UUID by running "kairos uuid".
|
||||||
|
|
||||||
Example:
|
Example:
|
||||||
|
|
||||||
$ (node A) c3os uuid
|
$ (node A) kairos uuid
|
||||||
$ (node B) c3os role set <UUID of node A> master
|
$ (node B) kairos role set <UUID of node A> master
|
||||||
`,
|
`,
|
||||||
Action: func(c *cli.Context) error {
|
Action: func(c *cli.Context) error {
|
||||||
cc := service.NewClient(
|
cc := service.NewClient(
|
||||||
@@ -295,7 +295,7 @@ For all the example cases, see: https://docs.c3os.io .
|
|||||||
|
|
||||||
Usage: "Creates a pristine config file",
|
Usage: "Creates a pristine config file",
|
||||||
Description: `
|
Description: `
|
||||||
Prints a vanilla YAML configuration on screen which can be used to bootstrap a c3os network.
|
Prints a vanilla YAML configuration on screen which can be used to bootstrap a kairos network.
|
||||||
`,
|
`,
|
||||||
ArgsUsage: "Optionally takes a token rotation interval (seconds)",
|
ArgsUsage: "Optionally takes a token rotation interval (seconds)",
|
||||||
|
|
||||||
@@ -319,7 +319,7 @@ For all the example cases, see: https://docs.c3os.io .
|
|||||||
UsageText: "Generate a network token",
|
UsageText: "Generate a network token",
|
||||||
Usage: "Creates a new token",
|
Usage: "Creates a new token",
|
||||||
Description: `
|
Description: `
|
||||||
Generates a new token which can be used to bootstrap a c3os network.
|
Generates a new token which can be used to bootstrap a kairos network.
|
||||||
`,
|
`,
|
||||||
ArgsUsage: "Optionally takes a token rotation interval (seconds)",
|
ArgsUsage: "Optionally takes a token rotation interval (seconds)",
|
||||||
|
|
||||||
|
@@ -6,22 +6,22 @@ import (
|
|||||||
"fmt"
|
"fmt"
|
||||||
"strings"
|
"strings"
|
||||||
|
|
||||||
"github.com/c3os-io/c3os/sdk/bus"
|
"github.com/kairos-io/kairos/sdk/bus"
|
||||||
|
|
||||||
logging "github.com/ipfs/go-log"
|
logging "github.com/ipfs/go-log"
|
||||||
edgeVPNClient "github.com/mudler/edgevpn/api/client"
|
edgeVPNClient "github.com/mudler/edgevpn/api/client"
|
||||||
"go.uber.org/zap"
|
"go.uber.org/zap"
|
||||||
|
|
||||||
"github.com/c3os-io/c3os/pkg/machine"
|
"github.com/kairos-io/kairos/pkg/machine"
|
||||||
"github.com/c3os-io/c3os/pkg/machine/openrc"
|
"github.com/kairos-io/kairos/pkg/machine/openrc"
|
||||||
"github.com/c3os-io/c3os/pkg/machine/systemd"
|
"github.com/kairos-io/kairos/pkg/machine/systemd"
|
||||||
"github.com/c3os-io/c3os/pkg/utils"
|
"github.com/kairos-io/kairos/pkg/utils"
|
||||||
sdk "github.com/c3os-io/c3os/sdk/bus"
|
sdk "github.com/kairos-io/kairos/sdk/bus"
|
||||||
providerConfig "github.com/c3os-io/provider-c3os/internal/provider/config"
|
providerConfig "github.com/kairos-io/provider-kairos/internal/provider/config"
|
||||||
"github.com/c3os-io/provider-c3os/internal/role"
|
"github.com/kairos-io/provider-kairos/internal/role"
|
||||||
"github.com/c3os-io/provider-c3os/internal/services"
|
"github.com/kairos-io/provider-kairos/internal/services"
|
||||||
|
|
||||||
"github.com/c3os-io/c3os/pkg/config"
|
"github.com/kairos-io/kairos/pkg/config"
|
||||||
"github.com/mudler/edgevpn/api/client/service"
|
"github.com/mudler/edgevpn/api/client/service"
|
||||||
"github.com/mudler/go-pluggable"
|
"github.com/mudler/go-pluggable"
|
||||||
)
|
)
|
||||||
@@ -49,11 +49,11 @@ func Bootstrap(e *pluggable.Event) pluggable.EventResponse {
|
|||||||
tokenNotDefined := (providerConfig.C3OS != nil && providerConfig.C3OS.NetworkToken == "")
|
tokenNotDefined := (providerConfig.C3OS != nil && providerConfig.C3OS.NetworkToken == "")
|
||||||
|
|
||||||
if providerConfig.C3OS == nil && !providerConfig.K3s.Enabled && !providerConfig.K3sAgent.Enabled {
|
if providerConfig.C3OS == nil && !providerConfig.K3s.Enabled && !providerConfig.K3sAgent.Enabled {
|
||||||
return pluggable.EventResponse{State: "no c3os or k3s configuration. nothing to do"}
|
return pluggable.EventResponse{State: "no kairos or k3s configuration. nothing to do"}
|
||||||
}
|
}
|
||||||
|
|
||||||
utils.SH("elemental run-stage c3os-agent.bootstrap") //nolint:errcheck
|
utils.SH("elemental run-stage kairos-agent.bootstrap") //nolint:errcheck
|
||||||
sdk.RunHookScript("/usr/bin/c3os-agent.bootstrap.hook") //nolint:errcheck
|
sdk.RunHookScript("/usr/bin/kairos-agent.bootstrap.hook") //nolint:errcheck
|
||||||
|
|
||||||
logLevel := "debug"
|
logLevel := "debug"
|
||||||
|
|
||||||
@@ -81,7 +81,7 @@ func Bootstrap(e *pluggable.Event) pluggable.EventResponse {
|
|||||||
log := &logging.ZapEventLogger{SugaredLogger: *logger.Sugar()}
|
log := &logging.ZapEventLogger{SugaredLogger: *logger.Sugar()}
|
||||||
|
|
||||||
// Do onetimebootstrap if K3s or K3s-agent are enabled.
|
// Do onetimebootstrap if K3s or K3s-agent are enabled.
|
||||||
// Those blocks are not required to be enabled in case of a c3os
|
// Those blocks are not required to be enabled in case of a kairos
|
||||||
// full automated setup. Otherwise, they must be explicitly enabled.
|
// full automated setup. Otherwise, they must be explicitly enabled.
|
||||||
if providerConfig.K3s.Enabled || providerConfig.K3sAgent.Enabled {
|
if providerConfig.K3s.Enabled || providerConfig.K3sAgent.Enabled {
|
||||||
err := oneTimeBootstrap(log, providerConfig, func() error {
|
err := oneTimeBootstrap(log, providerConfig, func() error {
|
||||||
@@ -100,7 +100,7 @@ func Bootstrap(e *pluggable.Event) pluggable.EventResponse {
|
|||||||
return ErrorEvent("Failed setup VPN: %s", err.Error())
|
return ErrorEvent("Failed setup VPN: %s", err.Error())
|
||||||
}
|
}
|
||||||
|
|
||||||
networkID := "c3os"
|
networkID := "kairos"
|
||||||
|
|
||||||
if providerConfig.C3OS != nil && providerConfig.C3OS.NetworkID != "" {
|
if providerConfig.C3OS != nil && providerConfig.C3OS.NetworkID != "" {
|
||||||
networkID = providerConfig.C3OS.NetworkID
|
networkID = providerConfig.C3OS.NetworkID
|
||||||
@@ -114,7 +114,7 @@ func Bootstrap(e *pluggable.Event) pluggable.EventResponse {
|
|||||||
service.WithLogger(log),
|
service.WithLogger(log),
|
||||||
service.WithClient(cc),
|
service.WithClient(cc),
|
||||||
service.WithUUID(machine.UUID()),
|
service.WithUUID(machine.UUID()),
|
||||||
service.WithStateDir("/usr/local/.c3os/state"),
|
service.WithStateDir("/usr/local/.kairos/state"),
|
||||||
service.WithNetworkToken(providerConfig.C3OS.NetworkToken),
|
service.WithNetworkToken(providerConfig.C3OS.NetworkToken),
|
||||||
service.WithPersistentRoles("auto"),
|
service.WithPersistentRoles("auto"),
|
||||||
service.WithRoles(
|
service.WithRoles(
|
||||||
|
@@ -5,10 +5,10 @@ import (
|
|||||||
"io/ioutil"
|
"io/ioutil"
|
||||||
"os"
|
"os"
|
||||||
|
|
||||||
"github.com/c3os-io/c3os/sdk/bus"
|
"github.com/kairos-io/kairos/sdk/bus"
|
||||||
|
|
||||||
. "github.com/c3os-io/provider-c3os/internal/provider"
|
. "github.com/kairos-io/provider-kairos/internal/provider"
|
||||||
providerConfig "github.com/c3os-io/provider-c3os/internal/provider/config"
|
providerConfig "github.com/kairos-io/provider-kairos/internal/provider/config"
|
||||||
"github.com/mudler/go-pluggable"
|
"github.com/mudler/go-pluggable"
|
||||||
. "github.com/onsi/ginkgo/v2"
|
. "github.com/onsi/ginkgo/v2"
|
||||||
. "github.com/onsi/gomega"
|
. "github.com/onsi/gomega"
|
||||||
|
@@ -3,10 +3,10 @@ package provider
|
|||||||
import (
|
import (
|
||||||
"encoding/json"
|
"encoding/json"
|
||||||
|
|
||||||
"github.com/c3os-io/c3os/sdk/bus"
|
"github.com/kairos-io/kairos/sdk/bus"
|
||||||
|
|
||||||
"github.com/c3os-io/c3os/pkg/config"
|
"github.com/kairos-io/kairos/pkg/config"
|
||||||
providerConfig "github.com/c3os-io/provider-c3os/internal/provider/config"
|
providerConfig "github.com/kairos-io/provider-kairos/internal/provider/config"
|
||||||
|
|
||||||
"github.com/mudler/go-nodepair"
|
"github.com/mudler/go-nodepair"
|
||||||
"github.com/mudler/go-pluggable"
|
"github.com/mudler/go-pluggable"
|
||||||
|
@@ -5,11 +5,11 @@ import (
|
|||||||
"io/ioutil"
|
"io/ioutil"
|
||||||
"os"
|
"os"
|
||||||
|
|
||||||
"github.com/c3os-io/c3os/sdk/bus"
|
"github.com/kairos-io/kairos/sdk/bus"
|
||||||
|
|
||||||
providerConfig "github.com/c3os-io/provider-c3os/internal/provider/config"
|
providerConfig "github.com/kairos-io/provider-kairos/internal/provider/config"
|
||||||
|
|
||||||
. "github.com/c3os-io/provider-c3os/internal/provider"
|
. "github.com/kairos-io/provider-kairos/internal/provider"
|
||||||
"github.com/mudler/go-pluggable"
|
"github.com/mudler/go-pluggable"
|
||||||
. "github.com/onsi/ginkgo/v2"
|
. "github.com/onsi/ginkgo/v2"
|
||||||
. "github.com/onsi/gomega"
|
. "github.com/onsi/gomega"
|
||||||
|
@@ -9,7 +9,7 @@ type C3OS struct {
|
|||||||
}
|
}
|
||||||
|
|
||||||
type Config struct {
|
type Config struct {
|
||||||
C3OS *C3OS `yaml:"c3os,omitempty"`
|
C3OS *C3OS `yaml:"kairos,omitempty"`
|
||||||
K3sAgent K3s `yaml:"k3s-agent,omitempty"`
|
K3sAgent K3s `yaml:"k3s-agent,omitempty"`
|
||||||
K3s K3s `yaml:"k3s,omitempty"`
|
K3s K3s `yaml:"k3s,omitempty"`
|
||||||
VPN map[string]string `yaml:"vpn,omitempty"`
|
VPN map[string]string `yaml:"vpn,omitempty"`
|
||||||
|
@@ -4,7 +4,7 @@ import (
|
|||||||
"context"
|
"context"
|
||||||
"encoding/json"
|
"encoding/json"
|
||||||
|
|
||||||
"github.com/c3os-io/c3os/sdk/bus"
|
"github.com/kairos-io/kairos/sdk/bus"
|
||||||
|
|
||||||
"github.com/mudler/go-nodepair"
|
"github.com/mudler/go-nodepair"
|
||||||
"github.com/mudler/go-pluggable"
|
"github.com/mudler/go-pluggable"
|
||||||
|
@@ -3,7 +3,7 @@ package provider
|
|||||||
import (
|
import (
|
||||||
"encoding/json"
|
"encoding/json"
|
||||||
|
|
||||||
"github.com/c3os-io/c3os/sdk/bus"
|
"github.com/kairos-io/kairos/sdk/bus"
|
||||||
|
|
||||||
"github.com/mudler/edgevpn/pkg/node"
|
"github.com/mudler/edgevpn/pkg/node"
|
||||||
"github.com/mudler/go-pluggable"
|
"github.com/mudler/go-pluggable"
|
||||||
@@ -12,7 +12,7 @@ import (
|
|||||||
func InteractiveInstall(e *pluggable.Event) pluggable.EventResponse {
|
func InteractiveInstall(e *pluggable.Event) pluggable.EventResponse {
|
||||||
prompts := []bus.YAMLPrompt{
|
prompts := []bus.YAMLPrompt{
|
||||||
{
|
{
|
||||||
YAMLSection: "c3os.network_token",
|
YAMLSection: "kairos.network_token",
|
||||||
Prompt: "Insert a network token, leave empty to autogenerate",
|
Prompt: "Insert a network token, leave empty to autogenerate",
|
||||||
AskFirst: true,
|
AskFirst: true,
|
||||||
AskPrompt: "Do you want to setup a full mesh-support?",
|
AskPrompt: "Do you want to setup a full mesh-support?",
|
||||||
|
@@ -4,7 +4,7 @@ import (
|
|||||||
"fmt"
|
"fmt"
|
||||||
"os"
|
"os"
|
||||||
|
|
||||||
"github.com/c3os-io/c3os/pkg/utils"
|
"github.com/kairos-io/kairos/pkg/utils"
|
||||||
|
|
||||||
nodepair "github.com/mudler/go-nodepair"
|
nodepair "github.com/mudler/go-nodepair"
|
||||||
"github.com/mudler/go-pluggable"
|
"github.com/mudler/go-pluggable"
|
||||||
|
@@ -3,7 +3,7 @@ package provider
|
|||||||
import (
|
import (
|
||||||
"os"
|
"os"
|
||||||
|
|
||||||
"github.com/c3os-io/c3os/sdk/bus"
|
"github.com/kairos-io/kairos/sdk/bus"
|
||||||
|
|
||||||
"github.com/mudler/go-pluggable"
|
"github.com/mudler/go-pluggable"
|
||||||
)
|
)
|
||||||
|
@@ -4,7 +4,7 @@ import (
|
|||||||
"encoding/json"
|
"encoding/json"
|
||||||
"strings"
|
"strings"
|
||||||
|
|
||||||
"github.com/c3os-io/c3os/pkg/utils"
|
"github.com/kairos-io/kairos/pkg/utils"
|
||||||
"github.com/google/go-containerregistry/pkg/crane"
|
"github.com/google/go-containerregistry/pkg/crane"
|
||||||
"github.com/mudler/go-pluggable"
|
"github.com/mudler/go-pluggable"
|
||||||
)
|
)
|
||||||
|
@@ -6,11 +6,11 @@ import (
|
|||||||
"path/filepath"
|
"path/filepath"
|
||||||
"strings"
|
"strings"
|
||||||
|
|
||||||
"github.com/c3os-io/c3os/pkg/config"
|
"github.com/kairos-io/kairos/pkg/config"
|
||||||
"github.com/c3os-io/c3os/pkg/machine/systemd"
|
"github.com/kairos-io/kairos/pkg/machine/systemd"
|
||||||
"github.com/c3os-io/c3os/pkg/utils"
|
"github.com/kairos-io/kairos/pkg/utils"
|
||||||
providerConfig "github.com/c3os-io/provider-c3os/internal/provider/config"
|
providerConfig "github.com/kairos-io/provider-kairos/internal/provider/config"
|
||||||
"github.com/c3os-io/provider-c3os/internal/services"
|
"github.com/kairos-io/provider-kairos/internal/services"
|
||||||
|
|
||||||
yip "github.com/mudler/yip/pkg/schema"
|
yip "github.com/mudler/yip/pkg/schema"
|
||||||
)
|
)
|
||||||
@@ -35,7 +35,7 @@ func SetupVPN(instance, apiAddress, rootDir string, start bool, c *providerConfi
|
|||||||
"APILISTEN": apiAddress,
|
"APILISTEN": apiAddress,
|
||||||
"EDGEVPNLOWPROFILEVPN": "true",
|
"EDGEVPNLOWPROFILEVPN": "true",
|
||||||
"DHCP": "true",
|
"DHCP": "true",
|
||||||
"DHCPLEASEDIR": "/usr/local/.c3os/lease",
|
"DHCPLEASEDIR": "/usr/local/.kairos/lease",
|
||||||
}
|
}
|
||||||
// Override opts with user-supplied
|
// Override opts with user-supplied
|
||||||
for k, v := range c.VPN {
|
for k, v := range c.VPN {
|
||||||
@@ -70,7 +70,7 @@ func SetupVPN(instance, apiAddress, rootDir string, start bool, c *providerConfi
|
|||||||
|
|
||||||
os.MkdirAll("/etc/systemd/system.conf.d/", 0600) //nolint:errcheck
|
os.MkdirAll("/etc/systemd/system.conf.d/", 0600) //nolint:errcheck
|
||||||
// Setup edgevpn instance
|
// Setup edgevpn instance
|
||||||
err = utils.WriteEnv(filepath.Join(rootDir, "/etc/systemd/system.conf.d/edgevpn-c3os.env"), vpnOpts)
|
err = utils.WriteEnv(filepath.Join(rootDir, "/etc/systemd/system.conf.d/edgevpn-kairos.env"), vpnOpts)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
return fmt.Errorf("could not create write env file: %w", err)
|
return fmt.Errorf("could not create write env file: %w", err)
|
||||||
}
|
}
|
||||||
|
@@ -1,9 +1,9 @@
|
|||||||
package role
|
package role
|
||||||
|
|
||||||
import (
|
import (
|
||||||
"github.com/c3os-io/c3os/pkg/config"
|
"github.com/kairos-io/kairos/pkg/config"
|
||||||
|
|
||||||
providerConfig "github.com/c3os-io/provider-c3os/internal/provider/config"
|
providerConfig "github.com/kairos-io/provider-kairos/internal/provider/config"
|
||||||
utils "github.com/mudler/edgevpn/pkg/utils"
|
utils "github.com/mudler/edgevpn/pkg/utils"
|
||||||
|
|
||||||
service "github.com/mudler/edgevpn/api/client/service"
|
service "github.com/mudler/edgevpn/api/client/service"
|
||||||
|
@@ -10,12 +10,12 @@ import (
|
|||||||
type Role func(*service.RoleConfig) error
|
type Role func(*service.RoleConfig) error
|
||||||
|
|
||||||
func SentinelExist() bool {
|
func SentinelExist() bool {
|
||||||
if _, err := os.Stat("/usr/local/.c3os/deployed"); err == nil {
|
if _, err := os.Stat("/usr/local/.kairos/deployed"); err == nil {
|
||||||
return true
|
return true
|
||||||
}
|
}
|
||||||
return false
|
return false
|
||||||
}
|
}
|
||||||
|
|
||||||
func CreateSentinel() error {
|
func CreateSentinel() error {
|
||||||
return ioutil.WriteFile("/usr/local/.c3os/deployed", []byte{}, os.ModePerm)
|
return ioutil.WriteFile("/usr/local/.kairos/deployed", []byte{}, os.ModePerm)
|
||||||
}
|
}
|
||||||
|
@@ -8,11 +8,11 @@ import (
|
|||||||
"strings"
|
"strings"
|
||||||
"time"
|
"time"
|
||||||
|
|
||||||
"github.com/c3os-io/c3os/pkg/config"
|
"github.com/kairos-io/kairos/pkg/config"
|
||||||
"github.com/c3os-io/c3os/pkg/machine"
|
"github.com/kairos-io/kairos/pkg/machine"
|
||||||
|
|
||||||
"github.com/c3os-io/c3os/pkg/utils"
|
"github.com/kairos-io/kairos/pkg/utils"
|
||||||
providerConfig "github.com/c3os-io/provider-c3os/internal/provider/config"
|
providerConfig "github.com/kairos-io/provider-kairos/internal/provider/config"
|
||||||
|
|
||||||
service "github.com/mudler/edgevpn/api/client/service"
|
service "github.com/mudler/edgevpn/api/client/service"
|
||||||
)
|
)
|
||||||
|
@@ -4,9 +4,9 @@ import (
|
|||||||
"math/rand"
|
"math/rand"
|
||||||
"time"
|
"time"
|
||||||
|
|
||||||
"github.com/c3os-io/c3os/pkg/config"
|
"github.com/kairos-io/kairos/pkg/config"
|
||||||
|
|
||||||
providerConfig "github.com/c3os-io/provider-c3os/internal/provider/config"
|
providerConfig "github.com/kairos-io/provider-kairos/internal/provider/config"
|
||||||
service "github.com/mudler/edgevpn/api/client/service"
|
service "github.com/mudler/edgevpn/api/client/service"
|
||||||
)
|
)
|
||||||
|
|
||||||
|
@@ -5,11 +5,11 @@ import (
|
|||||||
"fmt"
|
"fmt"
|
||||||
"strings"
|
"strings"
|
||||||
|
|
||||||
"github.com/c3os-io/c3os/pkg/config"
|
"github.com/kairos-io/kairos/pkg/config"
|
||||||
"github.com/c3os-io/c3os/pkg/machine"
|
"github.com/kairos-io/kairos/pkg/machine"
|
||||||
"github.com/c3os-io/c3os/pkg/utils"
|
"github.com/kairos-io/kairos/pkg/utils"
|
||||||
|
|
||||||
providerConfig "github.com/c3os-io/provider-c3os/internal/provider/config"
|
providerConfig "github.com/kairos-io/provider-kairos/internal/provider/config"
|
||||||
service "github.com/mudler/edgevpn/api/client/service"
|
service "github.com/mudler/edgevpn/api/client/service"
|
||||||
)
|
)
|
||||||
|
|
||||||
|
@@ -1,11 +1,11 @@
|
|||||||
package services
|
package services
|
||||||
|
|
||||||
import (
|
import (
|
||||||
"github.com/c3os-io/c3os/pkg/machine/openrc"
|
"github.com/kairos-io/kairos/pkg/machine/openrc"
|
||||||
"github.com/c3os-io/c3os/pkg/machine/systemd"
|
"github.com/kairos-io/kairos/pkg/machine/systemd"
|
||||||
|
|
||||||
"github.com/c3os-io/c3os/pkg/machine"
|
"github.com/kairos-io/kairos/pkg/machine"
|
||||||
"github.com/c3os-io/c3os/pkg/utils"
|
"github.com/kairos-io/kairos/pkg/utils"
|
||||||
)
|
)
|
||||||
|
|
||||||
const edgevpnOpenRC string = `#!/sbin/openrc-run
|
const edgevpnOpenRC string = `#!/sbin/openrc-run
|
||||||
@@ -23,7 +23,7 @@ pidfile="/run/edgevpn.pid"
|
|||||||
respawn_delay=5
|
respawn_delay=5
|
||||||
set -o allexport
|
set -o allexport
|
||||||
if [ -f /etc/environment ]; then source /etc/environment; fi
|
if [ -f /etc/environment ]; then source /etc/environment; fi
|
||||||
if [ -f /etc/systemd/system.conf.d/edgevpn-c3os.env ]; then source /etc/systemd/system.conf.d/edgevpn-c3os.env; fi
|
if [ -f /etc/systemd/system.conf.d/edgevpn-kairos.env ]; then source /etc/systemd/system.conf.d/edgevpn-kairos.env; fi
|
||||||
set +o allexport`
|
set +o allexport`
|
||||||
|
|
||||||
const edgevpnSystemd string = `[Unit]
|
const edgevpnSystemd string = `[Unit]
|
||||||
@@ -37,7 +37,7 @@ Restart=always
|
|||||||
[Install]
|
[Install]
|
||||||
WantedBy=multi-user.target`
|
WantedBy=multi-user.target`
|
||||||
|
|
||||||
const EdgeVPNDefaultInstance string = "c3os"
|
const EdgeVPNDefaultInstance string = "kairos"
|
||||||
|
|
||||||
func EdgeVPN(instance, rootDir string) (machine.Service, error) {
|
func EdgeVPN(instance, rootDir string) (machine.Service, error) {
|
||||||
if utils.IsOpenRCBased() {
|
if utils.IsOpenRCBased() {
|
||||||
|
6
main.go
6
main.go
@@ -4,10 +4,10 @@ import (
|
|||||||
"fmt"
|
"fmt"
|
||||||
"os"
|
"os"
|
||||||
|
|
||||||
"github.com/c3os-io/c3os/sdk/bus"
|
"github.com/kairos-io/kairos/sdk/bus"
|
||||||
cli "github.com/c3os-io/provider-c3os/internal/cli"
|
cli "github.com/kairos-io/provider-kairos/internal/cli"
|
||||||
|
|
||||||
"github.com/c3os-io/provider-c3os/internal/provider"
|
"github.com/kairos-io/provider-kairos/internal/provider"
|
||||||
)
|
)
|
||||||
|
|
||||||
func checkErr(err error) {
|
func checkErr(err error) {
|
||||||
|
@@ -1,17 +1,17 @@
|
|||||||
repositories:
|
repositories:
|
||||||
- &c3os
|
- &kairos
|
||||||
name: "c3os"
|
name: "kairos"
|
||||||
# https://github.com/c3os-io/packages
|
# https://github.com/kairos-io/packages
|
||||||
description: "c3os repository"
|
description: "kairos repository"
|
||||||
type: "docker"
|
type: "docker"
|
||||||
arch: amd64
|
arch: amd64
|
||||||
cached: true
|
cached: true
|
||||||
priority: 2
|
priority: 2
|
||||||
urls:
|
urls:
|
||||||
- "quay.io/c3os/packages"
|
- "quay.io/kairos/packages"
|
||||||
reference: 20220909205421-repository.yaml
|
reference: 20220909205421-repository.yaml
|
||||||
- !!merge <<: *c3os
|
- !!merge <<: *kairos
|
||||||
arch: arm64
|
arch: arm64
|
||||||
urls:
|
urls:
|
||||||
- "quay.io/c3os/packages-arm64"
|
- "quay.io/kairos/packages-arm64"
|
||||||
reference: 20220909211246-repository.yaml
|
reference: 20220909211246-repository.yaml
|
||||||
|
@@ -8,6 +8,6 @@ stages:
|
|||||||
initramfs:
|
initramfs:
|
||||||
- name: "Set user and password"
|
- name: "Set user and password"
|
||||||
users:
|
users:
|
||||||
c3os:
|
kairos:
|
||||||
passwd: "c3os"
|
passwd: "kairos"
|
||||||
hostname: c3os-{{ trunc 4 .Random }}
|
hostname: kairos-{{ trunc 4 .Random }}
|
@@ -4,6 +4,6 @@ stages:
|
|||||||
initramfs:
|
initramfs:
|
||||||
- name: "Set user and password"
|
- name: "Set user and password"
|
||||||
users:
|
users:
|
||||||
c3os:
|
kairos:
|
||||||
passwd: "c3os"
|
passwd: "kairos"
|
||||||
hostname: c3os-{{ trunc 4 .Random }}
|
hostname: kairos-{{ trunc 4 .Random }}
|
@@ -2,8 +2,8 @@ stages:
|
|||||||
initramfs:
|
initramfs:
|
||||||
- name: "Set user and password"
|
- name: "Set user and password"
|
||||||
users:
|
users:
|
||||||
c3os:
|
kairos:
|
||||||
passwd: "c3os"
|
passwd: "kairos"
|
||||||
hostname: c3os-{{ trunc 4 .Random }}
|
hostname: kairos-{{ trunc 4 .Random }}
|
||||||
c3os:
|
kairos:
|
||||||
network_token: "b3RwOgogIGRodDoKICAgIGludGVydmFsOiA5MDAwCiAgICBrZXk6IDI0SUpPS1pGS0g1R0tYUTNSNkdaQkNaS0lPTTNSWU9OT0pNRjIyRFFTM0VNT1BUWEdTTFEKICAgIGxlbmd0aDogMzIKICBjcnlwdG86CiAgICBpbnRlcnZhbDogOTAwMAogICAga2V5OiBQNklPMllEMzZaVFZRTkdUNk5ZREJNS0s0V09aQjJJN0RQMkRUQzRLVVU1UEhaTjRYSzVBCiAgICBsZW5ndGg6IDMyCnJvb206IEdPMkNRVDVYN080VFM3VEpFUVEyTDRXSTJZNURHNzZHUlNGU05FUVVZN1FBSjZSRzVUUFEKcmVuZGV6dm91czoga0taUE1pQU9TZWN6R1lDRXdTSEV0V21XUGZUaGxOa3QKbWRuczogT0FWY25LZXlPT3ZJQlhtQ0ZBYmhNSkxlbndJTEFxY2sKbWF4X21lc3NhZ2Vfc2l6ZTogMjA5NzE1MjAK"
|
network_token: "b3RwOgogIGRodDoKICAgIGludGVydmFsOiA5MDAwCiAgICBrZXk6IDI0SUpPS1pGS0g1R0tYUTNSNkdaQkNaS0lPTTNSWU9OT0pNRjIyRFFTM0VNT1BUWEdTTFEKICAgIGxlbmd0aDogMzIKICBjcnlwdG86CiAgICBpbnRlcnZhbDogOTAwMAogICAga2V5OiBQNklPMllEMzZaVFZRTkdUNk5ZREJNS0s0V09aQjJJN0RQMkRUQzRLVVU1UEhaTjRYSzVBCiAgICBsZW5ndGg6IDMyCnJvb206IEdPMkNRVDVYN080VFM3VEpFUVEyTDRXSTJZNURHNzZHUlNGU05FUVVZN1FBSjZSRzVUUFEKcmVuZGV6dm91czoga0taUE1pQU9TZWN6R1lDRXdTSEV0V21XUGZUaGxOa3QKbWRuczogT0FWY25LZXlPT3ZJQlhtQ0ZBYmhNSkxlbndJTEFxY2sKbWF4X21lc3NhZ2Vfc2l6ZTogMjA5NzE1MjAK"
|
@@ -2,8 +2,8 @@ stages:
|
|||||||
initramfs:
|
initramfs:
|
||||||
- name: "Set user and password"
|
- name: "Set user and password"
|
||||||
users:
|
users:
|
||||||
c3os:
|
kairos:
|
||||||
passwd: "c3os"
|
passwd: "kairos"
|
||||||
|
|
||||||
k3s:
|
k3s:
|
||||||
enabled: true
|
enabled: true
|
@@ -16,6 +16,6 @@ spec:
|
|||||||
serviceAccountName: system-upgrade
|
serviceAccountName: system-upgrade
|
||||||
cordon: false
|
cordon: false
|
||||||
upgrade:
|
upgrade:
|
||||||
image: quay.io/c3os/c3os
|
image: quay.io/kairos/kairos
|
||||||
command:
|
command:
|
||||||
- "/usr/sbin/suc-upgrade"
|
- "/usr/sbin/suc-upgrade"
|
||||||
|
@@ -7,13 +7,13 @@ import (
|
|||||||
"strings"
|
"strings"
|
||||||
"time"
|
"time"
|
||||||
|
|
||||||
"github.com/c3os-io/c3os/tests/machine"
|
"github.com/kairos-io/kairos/tests/machine"
|
||||||
. "github.com/onsi/ginkgo/v2"
|
. "github.com/onsi/ginkgo/v2"
|
||||||
. "github.com/onsi/gomega"
|
. "github.com/onsi/gomega"
|
||||||
"github.com/onsi/gomega/types"
|
"github.com/onsi/gomega/types"
|
||||||
)
|
)
|
||||||
|
|
||||||
var _ = Describe("c3os decentralized k8s test", Label("decentralized-k8s"), func() {
|
var _ = Describe("kairos decentralized k8s test", Label("decentralized-k8s"), func() {
|
||||||
BeforeEach(func() {
|
BeforeEach(func() {
|
||||||
machine.EventuallyConnects()
|
machine.EventuallyConnects()
|
||||||
})
|
})
|
||||||
@@ -28,16 +28,16 @@ var _ = Describe("c3os decentralized k8s test", Label("decentralized-k8s"), func
|
|||||||
It("has default service active", func() {
|
It("has default service active", func() {
|
||||||
if os.Getenv("FLAVOR") == "alpine" {
|
if os.Getenv("FLAVOR") == "alpine" {
|
||||||
out, _ := machine.SSHCommand("sudo rc-status")
|
out, _ := machine.SSHCommand("sudo rc-status")
|
||||||
Expect(out).Should(ContainSubstring("c3os"))
|
Expect(out).Should(ContainSubstring("kairos"))
|
||||||
Expect(out).Should(ContainSubstring("c3os-agent"))
|
Expect(out).Should(ContainSubstring("kairos-agent"))
|
||||||
} else {
|
} else {
|
||||||
// Eventually(func() string {
|
// Eventually(func() string {
|
||||||
// out, _ := machine.SSHCommand("sudo systemctl status c3os-agent")
|
// out, _ := machine.SSHCommand("sudo systemctl status kairos-agent")
|
||||||
// return out
|
// return out
|
||||||
// }, 30*time.Second, 10*time.Second).Should(ContainSubstring("no network token"))
|
// }, 30*time.Second, 10*time.Second).Should(ContainSubstring("no network token"))
|
||||||
|
|
||||||
out, _ := machine.SSHCommand("sudo systemctl status c3os")
|
out, _ := machine.SSHCommand("sudo systemctl status kairos")
|
||||||
Expect(out).Should(ContainSubstring("loaded (/etc/systemd/system/c3os.service; enabled; vendor preset: disabled)"))
|
Expect(out).Should(ContainSubstring("loaded (/etc/systemd/system/kairos.service; enabled; vendor preset: disabled)"))
|
||||||
}
|
}
|
||||||
})
|
})
|
||||||
})
|
})
|
||||||
@@ -61,16 +61,16 @@ var _ = Describe("c3os decentralized k8s test", Label("decentralized-k8s"), func
|
|||||||
It("has default services on", func() {
|
It("has default services on", func() {
|
||||||
if os.Getenv("FLAVOR") == "alpine" {
|
if os.Getenv("FLAVOR") == "alpine" {
|
||||||
out, _ := machine.SSHCommand("sudo rc-status")
|
out, _ := machine.SSHCommand("sudo rc-status")
|
||||||
Expect(out).Should(ContainSubstring("c3os"))
|
Expect(out).Should(ContainSubstring("kairos"))
|
||||||
Expect(out).Should(ContainSubstring("c3os-agent"))
|
Expect(out).Should(ContainSubstring("kairos-agent"))
|
||||||
} else {
|
} else {
|
||||||
// Eventually(func() string {
|
// Eventually(func() string {
|
||||||
// out, _ := machine.SSHCommand("sudo systemctl status c3os-agent")
|
// out, _ := machine.SSHCommand("sudo systemctl status kairos-agent")
|
||||||
// return out
|
// return out
|
||||||
// }, 30*time.Second, 10*time.Second).Should(ContainSubstring("no network token"))
|
// }, 30*time.Second, 10*time.Second).Should(ContainSubstring("no network token"))
|
||||||
|
|
||||||
out, _ := machine.SSHCommand("sudo systemctl status c3os-agent")
|
out, _ := machine.SSHCommand("sudo systemctl status kairos-agent")
|
||||||
Expect(out).Should(ContainSubstring("loaded (/etc/systemd/system/c3os-agent.service; enabled; vendor preset: disabled)"))
|
Expect(out).Should(ContainSubstring("loaded (/etc/systemd/system/kairos-agent.service; enabled; vendor preset: disabled)"))
|
||||||
|
|
||||||
out, _ = machine.SSHCommand("sudo systemctl status systemd-timesyncd")
|
out, _ = machine.SSHCommand("sudo systemctl status systemd-timesyncd")
|
||||||
Expect(out).Should(ContainSubstring("loaded (/usr/lib/systemd/system/systemd-timesyncd.service; enabled; vendor preset: disabled)"))
|
Expect(out).Should(ContainSubstring("loaded (/usr/lib/systemd/system/systemd-timesyncd.service; enabled; vendor preset: disabled)"))
|
||||||
@@ -92,10 +92,10 @@ var _ = Describe("c3os decentralized k8s test", Label("decentralized-k8s"), func
|
|||||||
out, _ = machine.SSHCommand("sudo mount " + state + " /tmp/mnt/STATE")
|
out, _ = machine.SSHCommand("sudo mount " + state + " /tmp/mnt/STATE")
|
||||||
fmt.Println(out)
|
fmt.Println(out)
|
||||||
out, _ = machine.SSHCommand("sudo cat /tmp/mnt/STATE/grubmenu")
|
out, _ = machine.SSHCommand("sudo cat /tmp/mnt/STATE/grubmenu")
|
||||||
Expect(out).Should(ContainSubstring("c3os remote recovery"))
|
Expect(out).Should(ContainSubstring("kairos remote recovery"))
|
||||||
|
|
||||||
grub, _ := machine.SSHCommand("sudo cat /tmp/mnt/STATE/grub_oem_env")
|
grub, _ := machine.SSHCommand("sudo cat /tmp/mnt/STATE/grub_oem_env")
|
||||||
Expect(grub).Should(ContainSubstring("default_menu_entry=c3os"))
|
Expect(grub).Should(ContainSubstring("default_menu_entry=kairos"))
|
||||||
|
|
||||||
machine.SSHCommand("sudo umount /tmp/mnt/STATE")
|
machine.SSHCommand("sudo umount /tmp/mnt/STATE")
|
||||||
})
|
})
|
||||||
@@ -113,7 +113,7 @@ var _ = Describe("c3os decentralized k8s test", Label("decentralized-k8s"), func
|
|||||||
Expect(err).To(HaveOccurred())
|
Expect(err).To(HaveOccurred())
|
||||||
if os.Getenv("FLAVOR") == "alpine" {
|
if os.Getenv("FLAVOR") == "alpine" {
|
||||||
Eventually(func() string {
|
Eventually(func() string {
|
||||||
out, _ := machine.SSHCommand("sudo cat /var/log/c3os/agent.log")
|
out, _ := machine.SSHCommand("sudo cat /var/log/kairos/agent.log")
|
||||||
fmt.Println(out)
|
fmt.Println(out)
|
||||||
return out
|
return out
|
||||||
}, 20*time.Minute, 1*time.Second).Should(
|
}, 20*time.Minute, 1*time.Second).Should(
|
||||||
@@ -123,7 +123,7 @@ var _ = Describe("c3os decentralized k8s test", Label("decentralized-k8s"), func
|
|||||||
))
|
))
|
||||||
} else {
|
} else {
|
||||||
Eventually(func() string {
|
Eventually(func() string {
|
||||||
out, _ := machine.SSHCommand("sudo systemctl status c3os-agent")
|
out, _ := machine.SSHCommand("sudo systemctl status kairos-agent")
|
||||||
return out
|
return out
|
||||||
}, 30*time.Minute, 1*time.Second).Should(
|
}, 30*time.Minute, 1*time.Second).Should(
|
||||||
Or(
|
Or(
|
||||||
@@ -135,7 +135,7 @@ var _ = Describe("c3os decentralized k8s test", Label("decentralized-k8s"), func
|
|||||||
|
|
||||||
PIt("configure edgevpn", func() {
|
PIt("configure edgevpn", func() {
|
||||||
Eventually(func() string {
|
Eventually(func() string {
|
||||||
out, _ := machine.SSHCommand("sudo cat /etc/systemd/system.conf.d/edgevpn-c3os.env")
|
out, _ := machine.SSHCommand("sudo cat /etc/systemd/system.conf.d/edgevpn-kairos.env")
|
||||||
return out
|
return out
|
||||||
}, 1*time.Minute, 1*time.Second).Should(
|
}, 1*time.Minute, 1*time.Second).Should(
|
||||||
And(
|
And(
|
||||||
@@ -145,22 +145,22 @@ var _ = Describe("c3os decentralized k8s test", Label("decentralized-k8s"), func
|
|||||||
|
|
||||||
It("propagate kubeconfig", func() {
|
It("propagate kubeconfig", func() {
|
||||||
Eventually(func() string {
|
Eventually(func() string {
|
||||||
out, _ := machine.SSHCommand("c3os get-kubeconfig")
|
out, _ := machine.SSHCommand("kairos get-kubeconfig")
|
||||||
return out
|
return out
|
||||||
}, 900*time.Second, 10*time.Second).Should(ContainSubstring("https:"))
|
}, 900*time.Second, 10*time.Second).Should(ContainSubstring("https:"))
|
||||||
|
|
||||||
Eventually(func() string {
|
Eventually(func() string {
|
||||||
machine.SSHCommand("c3os get-kubeconfig > kubeconfig")
|
machine.SSHCommand("kairos get-kubeconfig > kubeconfig")
|
||||||
out, _ := machine.SSHCommand("KUBECONFIG=kubeconfig kubectl get nodes -o wide")
|
out, _ := machine.SSHCommand("KUBECONFIG=kubeconfig kubectl get nodes -o wide")
|
||||||
return out
|
return out
|
||||||
}, 900*time.Second, 10*time.Second).Should(ContainSubstring("Ready"))
|
}, 900*time.Second, 10*time.Second).Should(ContainSubstring("Ready"))
|
||||||
})
|
})
|
||||||
|
|
||||||
It("has roles", func() {
|
It("has roles", func() {
|
||||||
uuid, _ := machine.SSHCommand("c3os-agent uuid")
|
uuid, _ := machine.SSHCommand("kairos-agent uuid")
|
||||||
Expect(uuid).ToNot(Equal(""))
|
Expect(uuid).ToNot(Equal(""))
|
||||||
Eventually(func() string {
|
Eventually(func() string {
|
||||||
out, _ := machine.SSHCommand("c3os role list")
|
out, _ := machine.SSHCommand("kairos role list")
|
||||||
return out
|
return out
|
||||||
}, 900*time.Second, 10*time.Second).Should(And(
|
}, 900*time.Second, 10*time.Second).Should(And(
|
||||||
ContainSubstring(uuid),
|
ContainSubstring(uuid),
|
||||||
@@ -203,7 +203,7 @@ var _ = Describe("c3os decentralized k8s test", Label("decentralized-k8s"), func
|
|||||||
It("upgrades to a specific version", func() {
|
It("upgrades to a specific version", func() {
|
||||||
version, _ := machine.SSHCommand("source /etc/os-release; echo $VERSION")
|
version, _ := machine.SSHCommand("source /etc/os-release; echo $VERSION")
|
||||||
|
|
||||||
out, _ := machine.SSHCommand("sudo c3os-agent upgrade --image quay.io/c3os/c3os:opensuse-v1.21.4-32")
|
out, _ := machine.SSHCommand("sudo kairos-agent upgrade --image quay.io/kairos/kairos:opensuse-v1.21.4-32")
|
||||||
Expect(out).To(ContainSubstring("Upgrade completed"))
|
Expect(out).To(ContainSubstring("Upgrade completed"))
|
||||||
|
|
||||||
machine.SSHCommand("sudo sync")
|
machine.SSHCommand("sudo sync")
|
||||||
|
@@ -6,13 +6,13 @@ import (
|
|||||||
"os"
|
"os"
|
||||||
"time"
|
"time"
|
||||||
|
|
||||||
"github.com/c3os-io/c3os/pkg/utils"
|
"github.com/kairos-io/kairos/pkg/utils"
|
||||||
"github.com/c3os-io/c3os/tests/machine"
|
"github.com/kairos-io/kairos/tests/machine"
|
||||||
. "github.com/onsi/ginkgo/v2"
|
. "github.com/onsi/ginkgo/v2"
|
||||||
. "github.com/onsi/gomega"
|
. "github.com/onsi/gomega"
|
||||||
)
|
)
|
||||||
|
|
||||||
var _ = Describe("c3os qr code install", Label("qrcode-install"), func() {
|
var _ = Describe("kairos qr code install", Label("qrcode-install"), func() {
|
||||||
BeforeEach(func() {
|
BeforeEach(func() {
|
||||||
machine.EventuallyConnects()
|
machine.EventuallyConnects()
|
||||||
})
|
})
|
||||||
@@ -27,16 +27,16 @@ var _ = Describe("c3os qr code install", Label("qrcode-install"), func() {
|
|||||||
It("has default service active", func() {
|
It("has default service active", func() {
|
||||||
if os.Getenv("FLAVOR") == "alpine" {
|
if os.Getenv("FLAVOR") == "alpine" {
|
||||||
out, _ := machine.Sudo("rc-status")
|
out, _ := machine.Sudo("rc-status")
|
||||||
Expect(out).Should(ContainSubstring("c3os"))
|
Expect(out).Should(ContainSubstring("kairos"))
|
||||||
Expect(out).Should(ContainSubstring("c3os-agent"))
|
Expect(out).Should(ContainSubstring("kairos-agent"))
|
||||||
} else {
|
} else {
|
||||||
// Eventually(func() string {
|
// Eventually(func() string {
|
||||||
// out, _ := machine.SSHCommand("sudo systemctl status c3os-agent")
|
// out, _ := machine.SSHCommand("sudo systemctl status kairos-agent")
|
||||||
// return out
|
// return out
|
||||||
// }, 30*time.Second, 10*time.Second).Should(ContainSubstring("no network token"))
|
// }, 30*time.Second, 10*time.Second).Should(ContainSubstring("no network token"))
|
||||||
|
|
||||||
out, _ := machine.Sudo("systemctl status c3os")
|
out, _ := machine.Sudo("systemctl status kairos")
|
||||||
Expect(out).Should(ContainSubstring("loaded (/etc/systemd/system/c3os.service; enabled; vendor preset: disabled)"))
|
Expect(out).Should(ContainSubstring("loaded (/etc/systemd/system/kairos.service; enabled; vendor preset: disabled)"))
|
||||||
}
|
}
|
||||||
})
|
})
|
||||||
})
|
})
|
||||||
|
@@ -5,12 +5,12 @@ import (
|
|||||||
"os"
|
"os"
|
||||||
"time"
|
"time"
|
||||||
|
|
||||||
"github.com/c3os-io/c3os/pkg/utils"
|
"github.com/kairos-io/kairos/pkg/utils"
|
||||||
. "github.com/onsi/ginkgo/v2"
|
. "github.com/onsi/ginkgo/v2"
|
||||||
. "github.com/onsi/gomega"
|
. "github.com/onsi/gomega"
|
||||||
)
|
)
|
||||||
|
|
||||||
var _ = Describe("c3os qr code register", Label("qrcode-register"), func() {
|
var _ = Describe("kairos qr code register", Label("qrcode-register"), func() {
|
||||||
|
|
||||||
Context("register", func() {
|
Context("register", func() {
|
||||||
It("sends config over", func() {
|
It("sends config over", func() {
|
||||||
@@ -23,7 +23,7 @@ var _ = Describe("c3os qr code register", Label("qrcode-register"), func() {
|
|||||||
return err
|
return err
|
||||||
}
|
}
|
||||||
|
|
||||||
out, err = utils.SH(fmt.Sprintf("c3os register --device /dev/sda --config %s %s", os.Getenv("CLOUD_INIT"), "screenshot.png"))
|
out, err = utils.SH(fmt.Sprintf("kairos register --device /dev/sda --config %s %s", os.Getenv("CLOUD_INIT"), "screenshot.png"))
|
||||||
fmt.Println(out)
|
fmt.Println(out)
|
||||||
return err
|
return err
|
||||||
|
|
||||||
|
@@ -10,15 +10,15 @@ import (
|
|||||||
"path/filepath"
|
"path/filepath"
|
||||||
"testing"
|
"testing"
|
||||||
|
|
||||||
"github.com/c3os-io/c3os/pkg/utils"
|
"github.com/kairos-io/kairos/pkg/utils"
|
||||||
"github.com/c3os-io/c3os/tests/machine"
|
"github.com/kairos-io/kairos/tests/machine"
|
||||||
. "github.com/onsi/ginkgo/v2"
|
. "github.com/onsi/ginkgo/v2"
|
||||||
. "github.com/onsi/gomega"
|
. "github.com/onsi/gomega"
|
||||||
)
|
)
|
||||||
|
|
||||||
func TestSuite(t *testing.T) {
|
func TestSuite(t *testing.T) {
|
||||||
RegisterFailHandler(Fail)
|
RegisterFailHandler(Fail)
|
||||||
RunSpecs(t, "c3os Test Suite")
|
RunSpecs(t, "kairos Test Suite")
|
||||||
}
|
}
|
||||||
|
|
||||||
var tempDir string
|
var tempDir string
|
||||||
@@ -106,17 +106,17 @@ func gatherLogs() {
|
|||||||
|
|
||||||
machine.GatherAllLogs(
|
machine.GatherAllLogs(
|
||||||
[]string{
|
[]string{
|
||||||
"edgevpn@c3os",
|
"edgevpn@kairos",
|
||||||
"c3os-agent",
|
"kairos-agent",
|
||||||
"cos-setup-boot",
|
"cos-setup-boot",
|
||||||
"cos-setup-network",
|
"cos-setup-network",
|
||||||
"c3os",
|
"kairos",
|
||||||
"k3s",
|
"k3s",
|
||||||
},
|
},
|
||||||
[]string{
|
[]string{
|
||||||
"/var/log/edgevpn.log",
|
"/var/log/edgevpn.log",
|
||||||
"/var/log/c3os-agent.log",
|
"/var/log/kairos-agent.log",
|
||||||
"/var/log/c3os/agent.log",
|
"/var/log/kairos/agent.log",
|
||||||
"/run/pods.json",
|
"/run/pods.json",
|
||||||
"/run/disk",
|
"/run/disk",
|
||||||
"/run/mounts",
|
"/run/mounts",
|
||||||
|
@@ -10,7 +10,7 @@ import (
|
|||||||
"os"
|
"os"
|
||||||
"time"
|
"time"
|
||||||
|
|
||||||
"github.com/c3os-io/c3os/tests/machine"
|
"github.com/kairos-io/kairos/tests/machine"
|
||||||
. "github.com/onsi/ginkgo/v2"
|
. "github.com/onsi/ginkgo/v2"
|
||||||
. "github.com/onsi/gomega"
|
. "github.com/onsi/gomega"
|
||||||
)
|
)
|
||||||
@@ -30,17 +30,17 @@ var _ = Describe("k3s upgrade test", Label("upgrade-k8s"), func() {
|
|||||||
It("has default service active", func() {
|
It("has default service active", func() {
|
||||||
if os.Getenv("FLAVOR") == "alpine" {
|
if os.Getenv("FLAVOR") == "alpine" {
|
||||||
out, _ := machine.Sudo("rc-status")
|
out, _ := machine.Sudo("rc-status")
|
||||||
Expect(out).Should(ContainSubstring("c3os"))
|
Expect(out).Should(ContainSubstring("kairos"))
|
||||||
Expect(out).Should(ContainSubstring("c3os-agent"))
|
Expect(out).Should(ContainSubstring("kairos-agent"))
|
||||||
Expect(out).Should(ContainSubstring("crond"))
|
Expect(out).Should(ContainSubstring("crond"))
|
||||||
} else {
|
} else {
|
||||||
// Eventually(func() string {
|
// Eventually(func() string {
|
||||||
// out, _ := machine.SSHCommand("sudo systemctl status c3os-agent")
|
// out, _ := machine.SSHCommand("sudo systemctl status kairos-agent")
|
||||||
// return out
|
// return out
|
||||||
// }, 30*time.Second, 10*time.Second).Should(ContainSubstring("no network token"))
|
// }, 30*time.Second, 10*time.Second).Should(ContainSubstring("no network token"))
|
||||||
|
|
||||||
out, _ := machine.Sudo("systemctl status c3os")
|
out, _ := machine.Sudo("systemctl status kairos")
|
||||||
Expect(out).Should(ContainSubstring("loaded (/etc/systemd/system/c3os.service; enabled; vendor preset: disabled)"))
|
Expect(out).Should(ContainSubstring("loaded (/etc/systemd/system/kairos.service; enabled; vendor preset: disabled)"))
|
||||||
|
|
||||||
out, _ = machine.Sudo("systemctl status logrotate.timer")
|
out, _ = machine.Sudo("systemctl status logrotate.timer")
|
||||||
Expect(out).Should(ContainSubstring("active (waiting)"))
|
Expect(out).Should(ContainSubstring("active (waiting)"))
|
||||||
@@ -67,11 +67,11 @@ var _ = Describe("k3s upgrade test", Label("upgrade-k8s"), func() {
|
|||||||
It("has default services on", func() {
|
It("has default services on", func() {
|
||||||
if os.Getenv("FLAVOR") == "alpine" {
|
if os.Getenv("FLAVOR") == "alpine" {
|
||||||
out, _ := machine.Sudo("rc-status")
|
out, _ := machine.Sudo("rc-status")
|
||||||
Expect(out).Should(ContainSubstring("c3os"))
|
Expect(out).Should(ContainSubstring("kairos"))
|
||||||
Expect(out).Should(ContainSubstring("c3os-agent"))
|
Expect(out).Should(ContainSubstring("kairos-agent"))
|
||||||
} else {
|
} else {
|
||||||
out, _ := machine.Sudo("systemctl status c3os-agent")
|
out, _ := machine.Sudo("systemctl status kairos-agent")
|
||||||
Expect(out).Should(ContainSubstring("loaded (/etc/systemd/system/c3os-agent.service; enabled; vendor preset: disabled)"))
|
Expect(out).Should(ContainSubstring("loaded (/etc/systemd/system/kairos-agent.service; enabled; vendor preset: disabled)"))
|
||||||
|
|
||||||
out, _ = machine.Sudo("systemctl status systemd-timesyncd")
|
out, _ = machine.Sudo("systemctl status systemd-timesyncd")
|
||||||
Expect(out).Should(ContainSubstring("loaded (/usr/lib/systemd/system/systemd-timesyncd.service; enabled; vendor preset: disabled)"))
|
Expect(out).Should(ContainSubstring("loaded (/usr/lib/systemd/system/systemd-timesyncd.service; enabled; vendor preset: disabled)"))
|
||||||
@@ -82,15 +82,15 @@ var _ = Describe("k3s upgrade test", Label("upgrade-k8s"), func() {
|
|||||||
Eventually(func() string {
|
Eventually(func() string {
|
||||||
var out string
|
var out string
|
||||||
if os.Getenv("FLAVOR") == "alpine" {
|
if os.Getenv("FLAVOR") == "alpine" {
|
||||||
out, _ = machine.Sudo("cat /var/log/c3os/agent.log;cat /var/log/c3os-agent.log")
|
out, _ = machine.Sudo("cat /var/log/kairos/agent.log;cat /var/log/kairos-agent.log")
|
||||||
} else {
|
} else {
|
||||||
out, _ = machine.Sudo("systemctl status c3os-agent")
|
out, _ = machine.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(ContainSubstring("One time bootstrap starting"))
|
||||||
|
|
||||||
Eventually(func() string {
|
Eventually(func() string {
|
||||||
out, _ := machine.Sudo("cat /var/log/c3os/agent-provider.log")
|
out, _ := machine.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")))
|
||||||
|
|
||||||
@@ -101,10 +101,10 @@ var _ = Describe("k3s upgrade test", Label("upgrade-k8s"), func() {
|
|||||||
})
|
})
|
||||||
|
|
||||||
It("rotates logs", func() {
|
It("rotates logs", func() {
|
||||||
out, err := machine.Sudo("logrotate -vf /etc/logrotate.d/c3os")
|
out, err := machine.Sudo("logrotate -vf /etc/logrotate.d/kairos")
|
||||||
Expect(err).ToNot(HaveOccurred())
|
Expect(err).ToNot(HaveOccurred())
|
||||||
Expect(out).To(ContainSubstring("log needs rotating"))
|
Expect(out).To(ContainSubstring("log needs rotating"))
|
||||||
_, err = machine.Sudo("ls /var/log/c3os/agent-provider.log.1.gz")
|
_, err = machine.Sudo("ls /var/log/kairos/agent-provider.log.1.gz")
|
||||||
Expect(err).ToNot(HaveOccurred())
|
Expect(err).ToNot(HaveOccurred())
|
||||||
})
|
})
|
||||||
|
|
||||||
|
@@ -11,7 +11,7 @@ import (
|
|||||||
"strings"
|
"strings"
|
||||||
"time"
|
"time"
|
||||||
|
|
||||||
"github.com/c3os-io/c3os/tests/machine"
|
"github.com/kairos-io/kairos/tests/machine"
|
||||||
. "github.com/onsi/ginkgo/v2"
|
. "github.com/onsi/ginkgo/v2"
|
||||||
. "github.com/onsi/gomega"
|
. "github.com/onsi/gomega"
|
||||||
)
|
)
|
||||||
@@ -62,16 +62,16 @@ var _ = Describe("k3s upgrade test from k8s", Label("upgrade-latest-with-kuberne
|
|||||||
}
|
}
|
||||||
if os.Getenv("FLAVOR") == "alpine" {
|
if os.Getenv("FLAVOR") == "alpine" {
|
||||||
out, _ := machine.Sudo("rc-status")
|
out, _ := machine.Sudo("rc-status")
|
||||||
Expect(out).Should(ContainSubstring("c3os"))
|
Expect(out).Should(ContainSubstring("kairos"))
|
||||||
Expect(out).Should(ContainSubstring("c3os-agent"))
|
Expect(out).Should(ContainSubstring("kairos-agent"))
|
||||||
} else {
|
} else {
|
||||||
// Eventually(func() string {
|
// Eventually(func() string {
|
||||||
// out, _ := machine.SSHCommand("sudo systemctl status c3os-agent")
|
// out, _ := machine.SSHCommand("sudo systemctl status kairos-agent")
|
||||||
// return out
|
// return out
|
||||||
// }, 30*time.Second, 10*time.Second).Should(ContainSubstring("no network token"))
|
// }, 30*time.Second, 10*time.Second).Should(ContainSubstring("no network token"))
|
||||||
|
|
||||||
out, _ := machine.Sudo("systemctl status c3os")
|
out, _ := machine.Sudo("systemctl status kairos")
|
||||||
Expect(out).Should(ContainSubstring("loaded (/etc/systemd/system/c3os.service; enabled; vendor preset: disabled)"))
|
Expect(out).Should(ContainSubstring("loaded (/etc/systemd/system/kairos.service; enabled; vendor preset: disabled)"))
|
||||||
}
|
}
|
||||||
})
|
})
|
||||||
})
|
})
|
||||||
@@ -95,16 +95,16 @@ var _ = Describe("k3s upgrade test from k8s", Label("upgrade-latest-with-kuberne
|
|||||||
It("has default services on", func() {
|
It("has default services on", func() {
|
||||||
if os.Getenv("FLAVOR") == "alpine" {
|
if os.Getenv("FLAVOR") == "alpine" {
|
||||||
out, _ := machine.Sudo("rc-status")
|
out, _ := machine.Sudo("rc-status")
|
||||||
Expect(out).Should(ContainSubstring("c3os"))
|
Expect(out).Should(ContainSubstring("kairos"))
|
||||||
Expect(out).Should(ContainSubstring("c3os-agent"))
|
Expect(out).Should(ContainSubstring("kairos-agent"))
|
||||||
} else {
|
} else {
|
||||||
// Eventually(func() string {
|
// Eventually(func() string {
|
||||||
// out, _ := machine.SSHCommand("sudo systemctl status c3os-agent")
|
// out, _ := machine.SSHCommand("sudo systemctl status kairos-agent")
|
||||||
// return out
|
// return out
|
||||||
// }, 30*time.Second, 10*time.Second).Should(ContainSubstring("no network token"))
|
// }, 30*time.Second, 10*time.Second).Should(ContainSubstring("no network token"))
|
||||||
|
|
||||||
out, _ := machine.Sudo("systemctl status c3os-agent")
|
out, _ := machine.Sudo("systemctl status kairos-agent")
|
||||||
Expect(out).Should(ContainSubstring("loaded (/etc/systemd/system/c3os-agent.service; enabled; vendor preset: disabled)"))
|
Expect(out).Should(ContainSubstring("loaded (/etc/systemd/system/kairos-agent.service; enabled; vendor preset: disabled)"))
|
||||||
|
|
||||||
out, _ = machine.Sudo("systemctl status systemd-timesyncd")
|
out, _ = machine.Sudo("systemctl status systemd-timesyncd")
|
||||||
Expect(out).Should(ContainSubstring("loaded (/usr/lib/systemd/system/systemd-timesyncd.service; enabled; vendor preset: disabled)"))
|
Expect(out).Should(ContainSubstring("loaded (/usr/lib/systemd/system/systemd-timesyncd.service; enabled; vendor preset: disabled)"))
|
||||||
@@ -115,9 +115,9 @@ var _ = Describe("k3s upgrade test from k8s", Label("upgrade-latest-with-kuberne
|
|||||||
Eventually(func() string {
|
Eventually(func() string {
|
||||||
var out string
|
var out string
|
||||||
if os.Getenv("FLAVOR") == "alpine" {
|
if os.Getenv("FLAVOR") == "alpine" {
|
||||||
out, _ = machine.Sudo("cat /var/log/c3os/agent.log;cat /var/log/c3os-agent.log")
|
out, _ = machine.Sudo("cat /var/log/kairos/agent.log;cat /var/log/kairos-agent.log")
|
||||||
} else {
|
} else {
|
||||||
out, _ = machine.Sudo("systemctl status c3os-agent")
|
out, _ = machine.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(ContainSubstring("One time bootstrap starting"))
|
||||||
|
Reference in New Issue
Block a user