🎨 Rebrand

See: https://github.com/c3os-io/c3os/issues/88
This commit is contained in:
Ettore Di Giacinto
2022-09-16 15:42:45 +00:00
parent 68e318e664
commit 359ed271c7
44 changed files with 279 additions and 279 deletions

View File

@@ -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")
}
latest_tag=$(last_commit_snapshot quay.io/c3os/packages)
latest_tag_arm64=$(last_commit_snapshot quay.io/c3os/packages-arm64)
latest_tag=$(last_commit_snapshot quay.io/kairosos/packages)
latest_tag_arm64=$(last_commit_snapshot quay.io/kairos/packages-arm64)
$YQ eval "$(reference 0 $latest_tag)" -i repository.yaml
$YQ eval "$(reference 1 $latest_tag_arm64)" -i repository.yaml

View File

@@ -41,7 +41,7 @@ jobs:
MODEL: ${{ matrix.model }}
run: |
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
uses: actions/upload-artifact@v2
with:

View File

@@ -42,40 +42,40 @@ jobs:
- name: Build 🔧
env:
FLAVOR: ${{ matrix.flavor }}
IMAGE: quay.io/c3os/c3os-${{ matrix.flavor }}:latest
IMAGE: quay.io/kairos/kairos-${{ matrix.flavor }}:latest
run: |
./earthly.sh +all --IMAGE=$IMAGE --FLAVOR=$FLAVOR
sudo mv build/* .
sudo rm -rf build
- uses: actions/upload-artifact@v2
with:
name: c3os-${{ matrix.flavor }}.iso.zip
name: kairos-${{ matrix.flavor }}.iso.zip
path: |
*.iso
*.sha256
if-no-files-found: error
- uses: actions/upload-artifact@v2
with:
name: c3os-${{ matrix.flavor }}.initrd.zip
name: kairos-${{ matrix.flavor }}.initrd.zip
path: |
*-initrd
if-no-files-found: error
- uses: actions/upload-artifact@v2
with:
name: c3os-${{ matrix.flavor }}.squashfs.zip
name: kairos-${{ matrix.flavor }}.squashfs.zip
path: |
*.squashfs
if-no-files-found: error
- uses: actions/upload-artifact@v2
with:
name: c3os-${{ matrix.flavor }}.kernel.zip
name: kairos-${{ matrix.flavor }}.kernel.zip
path: |
*-kernel
*-initrd
if-no-files-found: error
- uses: actions/upload-artifact@v2
with:
name: c3os-${{ matrix.flavor }}.ipxe.zip
name: kairos-${{ matrix.flavor }}.ipxe.zip
path: |
*.ipxe
if-no-files-found: error
@@ -84,12 +84,12 @@ jobs:
env:
COSIGN_EXPERIMENTAL: 1
run: |
docker push quay.io/c3os/c3os-${{ matrix.flavor }}:latest
cosign sign quay.io/c3os/c3os-${{ matrix.flavor }}:latest
docker push quay.io/kairos/kairos-${{ matrix.flavor }}:latest
cosign sign quay.io/kairos/kairos-${{ matrix.flavor }}:latest
- name: Push to testing
run: |
docker tag quay.io/c3os/c3os-${{ matrix.flavor }}:latest ttl.sh/c3os-${{ matrix.flavor }}-${{ github.sha }}:8h
docker push 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/kairos-${{ matrix.flavor }}-${{ github.sha }}:8h
# Test start
build-vm-images:
needs:
@@ -113,20 +113,20 @@ jobs:
- name: Download artifacts
uses: actions/download-artifact@v2
with:
name: c3os-${{ matrix.flavor }}.iso.zip
name: kairos-${{ matrix.flavor }}.iso.zip
- run: |
git clone https://github.com/c3os-io/c3os
git clone https://github.com/kairos-io/kairos
ls -liah
iso=$(ls *.iso)
bash c3os/scripts/build_vm.sh $iso
bash kairos/scripts/build_vm.sh $iso
- uses: actions/upload-artifact@v2
with:
name: c3os-${{ matrix.flavor }}.qcow2.tar.xz
name: kairos-${{ matrix.flavor }}.qcow2.tar.xz
path: |
*.qcow2.tar.xz
- uses: actions/upload-artifact@v2
with:
name: c3os-${{ matrix.flavor }}.ova
name: kairos-${{ matrix.flavor }}.ova
path: |
*.ova
if-no-files-found: error
@@ -172,7 +172,7 @@ jobs:
- name: Download artifacts
uses: actions/download-artifact@v2
with:
name: c3os-${{ matrix.flavor }}.iso.zip
name: kairos-${{ matrix.flavor }}.iso.zip
- name: Download artifacts
uses: actions/download-artifact@v2
with:
@@ -221,7 +221,7 @@ jobs:
- name: Download artifacts
uses: actions/download-artifact@v2
with:
name: c3os-${{ matrix.flavor }}.iso.zip
name: kairos-${{ matrix.flavor }}.iso.zip
- name: Download artifacts
uses: actions/download-artifact@v2
with:
@@ -291,7 +291,7 @@ jobs:
- name: Download artifacts
uses: actions/download-artifact@v2
with:
name: c3os-${{ matrix.flavor }}.iso.zip
name: kairos-${{ matrix.flavor }}.iso.zip
- name: Download artifacts
uses: actions/download-artifact@v2
with:
@@ -327,7 +327,7 @@ jobs:
# A flag to set the download target as latest release
# The default value is 'false'
latest: true
repository: "c3os-io/provider-c3os"
repository: "kairos-io/provider-kairos"
fileName: "*.iso"
out-file-path: "last-release"
- uses: actions/upload-artifact@v2
@@ -354,8 +354,8 @@ jobs:
with:
go-version: '^1.16'
- run: |
./earthly.sh +build-c3os-agent-provider
sudo cp -rfv build/agent-provider-c3os /usr/bin/c3os
./earthly.sh +build-kairos-agent-provider
sudo cp -rfv build/agent-provider-kairos /usr/bin/kairos
export CLOUD_INIT=$PWD/tests/assets/qrcode.yaml
export FLAVOR=${{ matrix.flavor }}
./.github/run_test.sh "qrcode-register"
@@ -390,7 +390,7 @@ jobs:
- name: Download artifacts
uses: actions/download-artifact@v2
with:
name: c3os-${{ matrix.flavor }}.iso.zip
name: kairos-${{ matrix.flavor }}.iso.zip
- name: Install deps
run: |
brew install cdrtools jq
@@ -447,9 +447,9 @@ jobs:
go-version: '^1.16'
- run: |
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 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 CLOUD_INIT=$PWD/tests/assets/config.yaml
export CREATE_VM=true

View File

@@ -71,7 +71,7 @@ jobs:
sudo mv release/*.sha256 ./
- uses: actions/upload-artifact@v2
with:
name: c3os-${{ matrix.flavor }}${{ matrix.k3s_version }}.iso.zip
name: kairos-${{ matrix.flavor }}${{ matrix.k3s_version }}.iso.zip
path: |
*.iso
*.sha256
@@ -95,20 +95,20 @@ jobs:
- name: Download artifacts
uses: actions/download-artifact@v2
with:
name: c3os-${{ matrix.flavor }}${{ matrix.k3s_version }}.iso.zip
name: kairos-${{ matrix.flavor }}${{ matrix.k3s_version }}.iso.zip
- run: |
git clone https://github.com/c3os-io/c3os
git clone https://github.com/kairos-io/kairos
ls -liah
iso=$(ls *.iso)
bash c3os/scripts/build_vm.sh $iso
bash kairos/scripts/build_vm.sh $iso
- uses: actions/upload-artifact@v2
with:
name: c3os-${{ matrix.flavor }}${{ matrix.k3s_version }}.qcow2.tar.xz
name: kairos-${{ matrix.flavor }}${{ matrix.k3s_version }}.qcow2.tar.xz
path: |
*.qcow2.tar.xz
- uses: actions/upload-artifact@v2
with:
name: c3os-${{ matrix.flavor }}${{ matrix.k3s_version }}.ova
name: kairos-${{ matrix.flavor }}${{ matrix.k3s_version }}.ova
path: |
*.ova
if-no-files-found: error
@@ -127,11 +127,11 @@ jobs:
- name: Download artifacts
uses: actions/download-artifact@v2
with:
name: c3os-${{ matrix.flavor }}${{ matrix.k3s_version }}.qcow2.tar.xz
name: kairos-${{ matrix.flavor }}${{ matrix.k3s_version }}.qcow2.tar.xz
- name: Download artifacts
uses: actions/download-artifact@v2
with:
name: c3os-${{ matrix.flavor }}${{ matrix.k3s_version }}.ova
name: kairos-${{ matrix.flavor }}${{ matrix.k3s_version }}.ova
- run: |
mkdir release
mv *.qcow2.tar.xz release/
@@ -143,7 +143,7 @@ jobs:
path_to_add: 'release'
- run: |
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
uses: softprops/action-gh-release@v1
if: startsWith(github.ref, 'refs/tags/')

View File

@@ -11,14 +11,14 @@ builds:
- amd64
- 386
main: ./
id: "c3os-cli"
binary: "c3os-cli"
id: "kairos-cli"
binary: "kairos-cli"
source:
enabled: true
name_template: 'c3os-cli-{{ .Tag }}-source'
name_template: 'kairos-cli-{{ .Tag }}-source'
archives:
# 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:
darwin: Darwin
linux: Linux
@@ -26,7 +26,7 @@ archives:
386: i386
amd64: x86_64
checksum:
name_template: 'c3os-cli-{{ .Tag }}-checksums.txt'
name_template: 'kairos-cli-{{ .Tag }}-checksums.txt'
snapshot:
name_template: "{{ .Tag }}-next"
changelog:

View File

@@ -1,9 +1,9 @@
VERSION 0.6
IMPORT github.com/c3os-io/c3os
IMPORT github.com/kairos-io/kairos
FROM alpine
ARG VARIANT=c3os # core, lite, framework
ARG VARIANT=kairos # core, lite, framework
ARG FLAVOR=opensuse
## Versioning
@@ -16,8 +16,8 @@ ARG VERSION=$(cat VERSION)
RUN echo "version ${VERSION}"
ARG K3S_VERSION_TAG=$(echo $K3S_VERSION | sed s/+/-/)
ARG TAG=${VERSION}-k3s${K3S_VERSION_TAG}
ARG IMAGE=quay.io/c3os/${VARIANT}-${FLAVOR}:$TAG
ARG BASE_IMAGE=quay.io/c3os/core-${FLAVOR}:${CORE_VERSION}
ARG IMAGE=quay.io/kairos/${VARIANT}-${FLAVOR}:$TAG
ARG BASE_IMAGE=quay.io/kairos/core-${FLAVOR}:${CORE_VERSION}
ARG ISO_NAME=${VARIANT}-${FLAVOR}-${VERSION}-k3s${K3S_VERSION}
## 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 GO_VERSION=1.18
ARG OS_ID=c3os
ARG OS_ID=kairos
ARG CGO_ENABLED=0
RELEASEVERSION:
@@ -83,12 +83,12 @@ BUILD_GOLANG:
RUN go build -ldflags "-s -w" -o ${BIN} ${SRC} && upx ${BIN}
SAVE ARTIFACT ${BIN} ${BIN} AS LOCAL build/${BIN}
build-c3os-agent-provider:
build-kairos-agent-provider:
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-c3os-agent-provider
BUILD +build-kairos-agent-provider
dist:
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
END
COPY +build-c3os-agent-provider/agent-provider-c3os /system/providers/agent-provider-c3os
RUN ln -s /system/providers/agent-provider-c3os /usr/bin/c3os
COPY +build-kairos-agent-provider/agent-provider-kairos /system/providers/agent-provider-kairos
RUN ln -s /system/providers/agent-provider-kairos /usr/bin/kairos
ARG C3OS_VERSION
IF [ "$C3OS_VERSION" = "" ]
@@ -146,10 +146,10 @@ docker:
ARG OS_ID
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
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
@@ -162,18 +162,18 @@ elemental:
FROM ${ELEMENTAL_IMAGE}
SAVE ARTIFACT /usr/bin/elemental elemental
c3os:
kairos:
ARG C3OS_VERSION=master
FROM alpine
RUN apk add git
WORKDIR /c3os
RUN git clone https://github.com/c3os-io/c3os /c3os && cd /c3os && git checkout "$C3OS_VERSION"
SAVE ARTIFACT /c3os/
WORKDIR /kairos
RUN git clone https://github.com/kairos-io/kairos /kairos && cd /kairos && git checkout "$C3OS_VERSION"
SAVE ARTIFACT /kairos/
get-c3os-scripts:
get-kairos-scripts:
FROM alpine
WORKDIR /build
COPY +c3os/c3os/ ./
COPY +kairos/kairos/ ./
SAVE ARTIFACT /build/scripts AS LOCAL scripts
iso:
@@ -189,27 +189,27 @@ iso:
COPY . ./
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)
RUN elemental --repo $TOOLKIT_REPOSITORY --name $ISO_NAME --debug build-iso --date=false --local --overlay-iso /build/${overlay} $IMAGE --output /build/
END
# See: https://github.com/rancher/elemental-cli/issues/228
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.sha256 c3os.iso.sha256 AS LOCAL build/$ISO_NAME.iso.sha256
SAVE ARTIFACT /build/$ISO_NAME.iso kairos.iso AS LOCAL build/$ISO_NAME.iso
SAVE ARTIFACT /build/$ISO_NAME.iso.sha256 kairos.iso.sha256 AS LOCAL build/$ISO_NAME.iso.sha256
netboot:
FROM opensuse/leap
ARG VERSION
ARG ISO_NAME
WORKDIR /build
COPY +iso/c3os.iso c3os.iso
COPY +iso/kairos.iso kairos.iso
COPY . .
RUN zypper in -y cdrtools
COPY +c3os/c3os/scripts/netboot.sh ./
RUN sh netboot.sh c3os.iso $ISO_NAME $VERSION
COPY +kairos/kairos/scripts/netboot.sh ./
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-kernel kernel AS LOCAL build/$ISO_NAME-kernel
@@ -323,13 +323,13 @@ run-qemu-tests:
IF [ "$FROM_ARTIFACTS" = "true" ]
COPY . .
ENV ISO=/test/build/c3os.iso
ENV ISO=/test/build/kairos.iso
ENV DATASOURCE=/test/build/datasource.iso
ELSE
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
ENV ISO=/test/c3os.iso
ENV ISO=/test/kairos.iso
ENV DATASOURCE=/test/datasource.iso
END
@@ -340,12 +340,12 @@ run-qemu-tests:
test-create-config:
FROM alpine
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 . .
RUN ./agent-provider-c3os create-config > config.yaml
RUN ./agent-provider-kairos create-config > config.yaml
RUN cat tests/assets/config.yaml >> config.yaml
IF [ "$WITH_DNS" == "true" ]
RUN apk add yq
RUN yq -i '.c3os.dns = true' 'config.yaml'
RUN yq -i '.kairos.dns = true' 'config.yaml'
END
SAVE ARTIFACT config.yaml AS LOCAL config.yaml

View File

@@ -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.
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
#node-config
@@ -19,11 +19,11 @@ bundles:
## 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:
- [OpenSUSE based](https://quay.io/repository/c3os/c3os-opensuse)
- [Alpine based](https://quay.io/repository/c3os/c3os-alpine)
- [OpenSUSE RaspberryPi 3/4](https://quay.io/repository/c3os/c3os-opensuse-arm-rpi)
- [Alpine RaspberryPi 3/4](https://quay.io/repository/c3os/c3os-alpine-arm-rpi)
- [OpenSUSE based](https://quay.io/repository/kairos/kairos-opensuse)
- [Alpine based](https://quay.io/repository/kairos/kairos-alpine)
- [OpenSUSE RaspberryPi 3/4](https://quay.io/repository/kairos/kairos-opensuse-arm-rpi)
- [Alpine RaspberryPi 3/4](https://quay.io/repository/kairos/kairos-alpine-arm-rpi)

4
go.mod
View File

@@ -1,11 +1,11 @@
module github.com/c3os-io/provider-c3os
module github.com/kairos-io/provider-kairos
go 1.18
replace github.com/elastic/gosigar => github.com/mudler/gosigar v0.14.3-0.20220502202347-34be910bdaaf
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/gliderlabs/ssh v0.2.2
github.com/google/go-containerregistry v0.11.0

8
go.sum
View File

@@ -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/c-robinson/iplib v1.0.3 h1:NG0UF0GoEsrC1/vyfX1Lx2Ss7CySWl3KqqXh3q4DdPU=
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/c3os-io/c3os 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/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.20220812161215-f983eeb2bf4f h1:sYDd9y7rn3BvE5iKaxBJqhr3kZQNDhbJSc8WRMemB8I=
github.com/kairos-io/kairos v1.24.3-56.0.20220812161215-f983eeb2bf4f/go.mod h1:YvuC8j7UNOKlYgOWJIBGw0iK+wZqqnYT1aMpTvaDAvE=
github.com/kairos-io/kairos v1.24.3-56.0.20220818151915-d719856bd7c3 h1:6WPdTiAWhxVyF2SecI5y9COscCll0W93UoJmtu9nrbU=
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/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=

View File

@@ -6,8 +6,8 @@ import (
"net"
"time"
"github.com/c3os-io/c3os/pkg/utils"
"github.com/ipfs/go-log"
"github.com/kairos-io/kairos/pkg/utils"
"github.com/mudler/edgevpn/api"
"github.com/mudler/edgevpn/pkg/logger"
"github.com/mudler/edgevpn/pkg/node"
@@ -51,7 +51,7 @@ func bridge(c *cli.Context) error {
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)
if err != nil {

View File

@@ -5,8 +5,8 @@ import (
"os"
"path/filepath"
"github.com/c3os-io/c3os/pkg/config"
. "github.com/c3os-io/provider-c3os/internal/cli"
"github.com/kairos-io/kairos/pkg/config"
. "github.com/kairos-io/provider-kairos/internal/cli"
. "github.com/onsi/ginkgo/v2"
. "github.com/onsi/gomega"
"gopkg.in/yaml.v2"
@@ -15,7 +15,7 @@ import (
type TConfig struct {
C3OS struct {
NetworkToken string `yaml:"network_token"`
} `yaml:"c3os"`
} `yaml:"kairos"`
}
var _ = Describe("Get config", func() {
@@ -24,7 +24,7 @@ var _ = Describe("Get config", func() {
It("replace token in config files", func() {
var cc string = `#node-config
c3os:
kairos:
network_token: "foo"
bb:
@@ -54,8 +54,8 @@ fooz:
Expect(hasHeader).To(BeTrue())
Expect(res).To(Equal(map[interface{}]interface{}{
"c3os": map[interface{}]interface{}{"network_token": "baz"},
"bb": map[interface{}]interface{}{"nothing": "foo"},
"kairos": map[interface{}]interface{}{"network_token": "baz"},
"bb": map[interface{}]interface{}{"nothing": "foo"},
}))
})

View File

@@ -64,7 +64,7 @@ func networkConfig(token, address, loglevel, i string) *edgevpnConfig.Config {
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)
if err != nil {

View File

@@ -6,10 +6,10 @@ import (
"io/ioutil"
"os"
config "github.com/c3os-io/c3os/pkg/config"
"github.com/c3os-io/provider-c3os/internal/provider"
providerConfig "github.com/c3os-io/provider-c3os/internal/provider/config"
"github.com/c3os-io/provider-c3os/internal/services"
config "github.com/kairos-io/kairos/pkg/config"
"github.com/kairos-io/provider-kairos/internal/provider"
providerConfig "github.com/kairos-io/provider-kairos/internal/provider/config"
"github.com/kairos-io/provider-kairos/internal/services"
"gopkg.in/yaml.v3"
)
@@ -63,9 +63,9 @@ func ReplaceToken(dir []string, token string) (err error) {
return err
}
section, exists := content["c3os"]
section, exists := content["kairos"]
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)
@@ -80,7 +80,7 @@ func ReplaceToken(dir []string, token string) (err error) {
}
piece["network_token"] = token
content["c3os"] = piece
content["kairos"] = piece
d, err := yaml.Marshal(content)
if err != nil {

View File

@@ -9,7 +9,7 @@ import (
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"
"gopkg.in/yaml.v1"
@@ -25,7 +25,7 @@ var networkAPI = []cli.Flag{
},
&cli.StringFlag{
Name: "network-id",
Value: "c3os",
Value: "kairos",
Usage: "Kubernetes Network Deployment ID",
},
}
@@ -34,12 +34,12 @@ const recoveryAddr = "127.0.0.1:2222"
func Start() error {
app := &cli.App{
Name: "c3os",
Name: "kairos",
Version: "0.1",
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: `
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
- connect to a node in recovery mode
- 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.
For all the example cases, see: https://docs.c3os.io .
For all the example cases, see: https://docs.kairos.io .
`,
UsageText: ``,
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",
Usage: "Registers and bootstraps a node",
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:
$ 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.
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",
Flags: []cli.Flag{
@@ -137,9 +137,9 @@ For all the example cases, see: https://docs.c3os.io .
{
Name: "bridge",
UsageText: "bridge --network-token XXX",
Usage: "Connect to a c3os VPN network",
Usage: "Connect to a kairos VPN network",
Description: `
Starts a bridge with a c3os network or a node.
Starts a bridge with a kairos network or a node.
# With a network
@@ -147,7 +147,7 @@ For all the example cases, see: https://docs.c3os.io .
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).
@@ -155,16 +155,16 @@ For all the example cases, see: https://docs.c3os.io .
# 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.
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.
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{
@@ -210,7 +210,7 @@ For all the example cases, see: https://docs.c3os.io .
Usage: "Specify an address for the bridge",
},
&cli.StringFlag{
Value: "/tmp/c3os",
Value: "/tmp/kairos",
Name: "lease-dir",
EnvVar: "lease-dir",
Usage: "DHCP Lease directory",
@@ -221,7 +221,7 @@ For all the example cases, see: https://docs.c3os.io .
{
Name: "get-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: `
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:
$ c3os get-kubeconfig --network-id c3os
$ kairos get-kubeconfig --network-id kairos
`,
Flags: networkAPI,
Action: func(c *cli.Context) error {
@@ -251,16 +251,16 @@ For all the example cases, see: https://docs.c3os.io .
Flags: networkAPI,
Name: "set",
Usage: "Set a node role",
UsageText: "c3os role set <UUID> master",
UsageText: "kairos role set <UUID> master",
Description: `
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:
$ (node A) c3os uuid
$ (node B) c3os role set <UUID of node A> master
$ (node A) kairos uuid
$ (node B) kairos role set <UUID of node A> master
`,
Action: func(c *cli.Context) error {
cc := service.NewClient(
@@ -295,7 +295,7 @@ For all the example cases, see: https://docs.c3os.io .
Usage: "Creates a pristine config file",
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)",
@@ -319,7 +319,7 @@ For all the example cases, see: https://docs.c3os.io .
UsageText: "Generate a network token",
Usage: "Creates a new token",
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)",

View File

@@ -6,22 +6,22 @@ import (
"fmt"
"strings"
"github.com/c3os-io/c3os/sdk/bus"
"github.com/kairos-io/kairos/sdk/bus"
logging "github.com/ipfs/go-log"
edgeVPNClient "github.com/mudler/edgevpn/api/client"
"go.uber.org/zap"
"github.com/c3os-io/c3os/pkg/machine"
"github.com/c3os-io/c3os/pkg/machine/openrc"
"github.com/c3os-io/c3os/pkg/machine/systemd"
"github.com/c3os-io/c3os/pkg/utils"
sdk "github.com/c3os-io/c3os/sdk/bus"
providerConfig "github.com/c3os-io/provider-c3os/internal/provider/config"
"github.com/c3os-io/provider-c3os/internal/role"
"github.com/c3os-io/provider-c3os/internal/services"
"github.com/kairos-io/kairos/pkg/machine"
"github.com/kairos-io/kairos/pkg/machine/openrc"
"github.com/kairos-io/kairos/pkg/machine/systemd"
"github.com/kairos-io/kairos/pkg/utils"
sdk "github.com/kairos-io/kairos/sdk/bus"
providerConfig "github.com/kairos-io/provider-kairos/internal/provider/config"
"github.com/kairos-io/provider-kairos/internal/role"
"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/go-pluggable"
)
@@ -49,11 +49,11 @@ func Bootstrap(e *pluggable.Event) pluggable.EventResponse {
tokenNotDefined := (providerConfig.C3OS != nil && providerConfig.C3OS.NetworkToken == "")
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
sdk.RunHookScript("/usr/bin/c3os-agent.bootstrap.hook") //nolint:errcheck
utils.SH("elemental run-stage kairos-agent.bootstrap") //nolint:errcheck
sdk.RunHookScript("/usr/bin/kairos-agent.bootstrap.hook") //nolint:errcheck
logLevel := "debug"
@@ -81,7 +81,7 @@ func Bootstrap(e *pluggable.Event) pluggable.EventResponse {
log := &logging.ZapEventLogger{SugaredLogger: *logger.Sugar()}
// 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.
if providerConfig.K3s.Enabled || providerConfig.K3sAgent.Enabled {
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())
}
networkID := "c3os"
networkID := "kairos"
if providerConfig.C3OS != nil && providerConfig.C3OS.NetworkID != "" {
networkID = providerConfig.C3OS.NetworkID
@@ -114,7 +114,7 @@ func Bootstrap(e *pluggable.Event) pluggable.EventResponse {
service.WithLogger(log),
service.WithClient(cc),
service.WithUUID(machine.UUID()),
service.WithStateDir("/usr/local/.c3os/state"),
service.WithStateDir("/usr/local/.kairos/state"),
service.WithNetworkToken(providerConfig.C3OS.NetworkToken),
service.WithPersistentRoles("auto"),
service.WithRoles(

View File

@@ -5,10 +5,10 @@ import (
"io/ioutil"
"os"
"github.com/c3os-io/c3os/sdk/bus"
"github.com/kairos-io/kairos/sdk/bus"
. "github.com/c3os-io/provider-c3os/internal/provider"
providerConfig "github.com/c3os-io/provider-c3os/internal/provider/config"
. "github.com/kairos-io/provider-kairos/internal/provider"
providerConfig "github.com/kairos-io/provider-kairos/internal/provider/config"
"github.com/mudler/go-pluggable"
. "github.com/onsi/ginkgo/v2"
. "github.com/onsi/gomega"

View File

@@ -3,10 +3,10 @@ package provider
import (
"encoding/json"
"github.com/c3os-io/c3os/sdk/bus"
"github.com/kairos-io/kairos/sdk/bus"
"github.com/c3os-io/c3os/pkg/config"
providerConfig "github.com/c3os-io/provider-c3os/internal/provider/config"
"github.com/kairos-io/kairos/pkg/config"
providerConfig "github.com/kairos-io/provider-kairos/internal/provider/config"
"github.com/mudler/go-nodepair"
"github.com/mudler/go-pluggable"

View File

@@ -5,11 +5,11 @@ import (
"io/ioutil"
"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/onsi/ginkgo/v2"
. "github.com/onsi/gomega"

View File

@@ -9,7 +9,7 @@ type C3OS struct {
}
type Config struct {
C3OS *C3OS `yaml:"c3os,omitempty"`
C3OS *C3OS `yaml:"kairos,omitempty"`
K3sAgent K3s `yaml:"k3s-agent,omitempty"`
K3s K3s `yaml:"k3s,omitempty"`
VPN map[string]string `yaml:"vpn,omitempty"`

View File

@@ -4,7 +4,7 @@ import (
"context"
"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-pluggable"

View File

@@ -3,7 +3,7 @@ package provider
import (
"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/go-pluggable"
@@ -12,7 +12,7 @@ import (
func InteractiveInstall(e *pluggable.Event) pluggable.EventResponse {
prompts := []bus.YAMLPrompt{
{
YAMLSection: "c3os.network_token",
YAMLSection: "kairos.network_token",
Prompt: "Insert a network token, leave empty to autogenerate",
AskFirst: true,
AskPrompt: "Do you want to setup a full mesh-support?",

View File

@@ -4,7 +4,7 @@ import (
"fmt"
"os"
"github.com/c3os-io/c3os/pkg/utils"
"github.com/kairos-io/kairos/pkg/utils"
nodepair "github.com/mudler/go-nodepair"
"github.com/mudler/go-pluggable"

View File

@@ -3,7 +3,7 @@ package provider
import (
"os"
"github.com/c3os-io/c3os/sdk/bus"
"github.com/kairos-io/kairos/sdk/bus"
"github.com/mudler/go-pluggable"
)

View File

@@ -4,7 +4,7 @@ import (
"encoding/json"
"strings"
"github.com/c3os-io/c3os/pkg/utils"
"github.com/kairos-io/kairos/pkg/utils"
"github.com/google/go-containerregistry/pkg/crane"
"github.com/mudler/go-pluggable"
)

View File

@@ -6,11 +6,11 @@ import (
"path/filepath"
"strings"
"github.com/c3os-io/c3os/pkg/config"
"github.com/c3os-io/c3os/pkg/machine/systemd"
"github.com/c3os-io/c3os/pkg/utils"
providerConfig "github.com/c3os-io/provider-c3os/internal/provider/config"
"github.com/c3os-io/provider-c3os/internal/services"
"github.com/kairos-io/kairos/pkg/config"
"github.com/kairos-io/kairos/pkg/machine/systemd"
"github.com/kairos-io/kairos/pkg/utils"
providerConfig "github.com/kairos-io/provider-kairos/internal/provider/config"
"github.com/kairos-io/provider-kairos/internal/services"
yip "github.com/mudler/yip/pkg/schema"
)
@@ -35,7 +35,7 @@ func SetupVPN(instance, apiAddress, rootDir string, start bool, c *providerConfi
"APILISTEN": apiAddress,
"EDGEVPNLOWPROFILEVPN": "true",
"DHCP": "true",
"DHCPLEASEDIR": "/usr/local/.c3os/lease",
"DHCPLEASEDIR": "/usr/local/.kairos/lease",
}
// Override opts with user-supplied
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
// 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 {
return fmt.Errorf("could not create write env file: %w", err)
}

View File

@@ -1,9 +1,9 @@
package role
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"
service "github.com/mudler/edgevpn/api/client/service"

View File

@@ -10,12 +10,12 @@ import (
type Role func(*service.RoleConfig) error
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 false
}
func CreateSentinel() error {
return ioutil.WriteFile("/usr/local/.c3os/deployed", []byte{}, os.ModePerm)
return ioutil.WriteFile("/usr/local/.kairos/deployed", []byte{}, os.ModePerm)
}

View File

@@ -8,11 +8,11 @@ import (
"strings"
"time"
"github.com/c3os-io/c3os/pkg/config"
"github.com/c3os-io/c3os/pkg/machine"
"github.com/kairos-io/kairos/pkg/config"
"github.com/kairos-io/kairos/pkg/machine"
"github.com/c3os-io/c3os/pkg/utils"
providerConfig "github.com/c3os-io/provider-c3os/internal/provider/config"
"github.com/kairos-io/kairos/pkg/utils"
providerConfig "github.com/kairos-io/provider-kairos/internal/provider/config"
service "github.com/mudler/edgevpn/api/client/service"
)

View File

@@ -4,9 +4,9 @@ import (
"math/rand"
"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"
)

View File

@@ -5,11 +5,11 @@ import (
"fmt"
"strings"
"github.com/c3os-io/c3os/pkg/config"
"github.com/c3os-io/c3os/pkg/machine"
"github.com/c3os-io/c3os/pkg/utils"
"github.com/kairos-io/kairos/pkg/config"
"github.com/kairos-io/kairos/pkg/machine"
"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"
)

View File

@@ -1,11 +1,11 @@
package services
import (
"github.com/c3os-io/c3os/pkg/machine/openrc"
"github.com/c3os-io/c3os/pkg/machine/systemd"
"github.com/kairos-io/kairos/pkg/machine/openrc"
"github.com/kairos-io/kairos/pkg/machine/systemd"
"github.com/c3os-io/c3os/pkg/machine"
"github.com/c3os-io/c3os/pkg/utils"
"github.com/kairos-io/kairos/pkg/machine"
"github.com/kairos-io/kairos/pkg/utils"
)
const edgevpnOpenRC string = `#!/sbin/openrc-run
@@ -23,7 +23,7 @@ pidfile="/run/edgevpn.pid"
respawn_delay=5
set -o allexport
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`
const edgevpnSystemd string = `[Unit]
@@ -37,7 +37,7 @@ Restart=always
[Install]
WantedBy=multi-user.target`
const EdgeVPNDefaultInstance string = "c3os"
const EdgeVPNDefaultInstance string = "kairos"
func EdgeVPN(instance, rootDir string) (machine.Service, error) {
if utils.IsOpenRCBased() {

View File

@@ -4,10 +4,10 @@ import (
"fmt"
"os"
"github.com/c3os-io/c3os/sdk/bus"
cli "github.com/c3os-io/provider-c3os/internal/cli"
"github.com/kairos-io/kairos/sdk/bus"
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) {

View File

@@ -1,17 +1,17 @@
repositories:
- &c3os
name: "c3os"
# https://github.com/c3os-io/packages
description: "c3os repository"
- &kairos
name: "kairos"
# https://github.com/kairos-io/packages
description: "kairos repository"
type: "docker"
arch: amd64
cached: true
priority: 2
urls:
- "quay.io/c3os/packages"
- "quay.io/kairos/packages"
reference: 20220909205421-repository.yaml
- !!merge <<: *c3os
- !!merge <<: *kairos
arch: arm64
urls:
- "quay.io/c3os/packages-arm64"
- "quay.io/kairos/packages-arm64"
reference: 20220909211246-repository.yaml

View File

@@ -8,6 +8,6 @@ stages:
initramfs:
- name: "Set user and password"
users:
c3os:
passwd: "c3os"
hostname: c3os-{{ trunc 4 .Random }}
kairos:
passwd: "kairos"
hostname: kairos-{{ trunc 4 .Random }}

View File

@@ -4,6 +4,6 @@ stages:
initramfs:
- name: "Set user and password"
users:
c3os:
passwd: "c3os"
hostname: c3os-{{ trunc 4 .Random }}
kairos:
passwd: "kairos"
hostname: kairos-{{ trunc 4 .Random }}

View File

@@ -2,8 +2,8 @@ stages:
initramfs:
- name: "Set user and password"
users:
c3os:
passwd: "c3os"
hostname: c3os-{{ trunc 4 .Random }}
c3os:
kairos:
passwd: "kairos"
hostname: kairos-{{ trunc 4 .Random }}
kairos:
network_token: "b3RwOgogIGRodDoKICAgIGludGVydmFsOiA5MDAwCiAgICBrZXk6IDI0SUpPS1pGS0g1R0tYUTNSNkdaQkNaS0lPTTNSWU9OT0pNRjIyRFFTM0VNT1BUWEdTTFEKICAgIGxlbmd0aDogMzIKICBjcnlwdG86CiAgICBpbnRlcnZhbDogOTAwMAogICAga2V5OiBQNklPMllEMzZaVFZRTkdUNk5ZREJNS0s0V09aQjJJN0RQMkRUQzRLVVU1UEhaTjRYSzVBCiAgICBsZW5ndGg6IDMyCnJvb206IEdPMkNRVDVYN080VFM3VEpFUVEyTDRXSTJZNURHNzZHUlNGU05FUVVZN1FBSjZSRzVUUFEKcmVuZGV6dm91czoga0taUE1pQU9TZWN6R1lDRXdTSEV0V21XUGZUaGxOa3QKbWRuczogT0FWY25LZXlPT3ZJQlhtQ0ZBYmhNSkxlbndJTEFxY2sKbWF4X21lc3NhZ2Vfc2l6ZTogMjA5NzE1MjAK"

View File

@@ -2,8 +2,8 @@ stages:
initramfs:
- name: "Set user and password"
users:
c3os:
passwd: "c3os"
kairos:
passwd: "kairos"
k3s:
enabled: true

View File

@@ -16,6 +16,6 @@ spec:
serviceAccountName: system-upgrade
cordon: false
upgrade:
image: quay.io/c3os/c3os
image: quay.io/kairos/kairos
command:
- "/usr/sbin/suc-upgrade"

View File

@@ -1,4 +1,4 @@
//nolint
// nolint
package mos_test
import (
@@ -7,13 +7,13 @@ import (
"strings"
"time"
"github.com/c3os-io/c3os/tests/machine"
"github.com/kairos-io/kairos/tests/machine"
. "github.com/onsi/ginkgo/v2"
. "github.com/onsi/gomega"
"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() {
machine.EventuallyConnects()
})
@@ -28,16 +28,16 @@ var _ = Describe("c3os decentralized k8s test", Label("decentralized-k8s"), func
It("has default service active", func() {
if os.Getenv("FLAVOR") == "alpine" {
out, _ := machine.SSHCommand("sudo rc-status")
Expect(out).Should(ContainSubstring("c3os"))
Expect(out).Should(ContainSubstring("c3os-agent"))
Expect(out).Should(ContainSubstring("kairos"))
Expect(out).Should(ContainSubstring("kairos-agent"))
} else {
// Eventually(func() string {
// out, _ := machine.SSHCommand("sudo systemctl status c3os-agent")
// out, _ := machine.SSHCommand("sudo systemctl status kairos-agent")
// return out
// }, 30*time.Second, 10*time.Second).Should(ContainSubstring("no network token"))
out, _ := machine.SSHCommand("sudo systemctl status c3os")
Expect(out).Should(ContainSubstring("loaded (/etc/systemd/system/c3os.service; enabled; vendor preset: disabled)"))
out, _ := machine.SSHCommand("sudo systemctl status kairos")
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() {
if os.Getenv("FLAVOR") == "alpine" {
out, _ := machine.SSHCommand("sudo rc-status")
Expect(out).Should(ContainSubstring("c3os"))
Expect(out).Should(ContainSubstring("c3os-agent"))
Expect(out).Should(ContainSubstring("kairos"))
Expect(out).Should(ContainSubstring("kairos-agent"))
} else {
// Eventually(func() string {
// out, _ := machine.SSHCommand("sudo systemctl status c3os-agent")
// out, _ := machine.SSHCommand("sudo systemctl status kairos-agent")
// return out
// }, 30*time.Second, 10*time.Second).Should(ContainSubstring("no network token"))
out, _ := machine.SSHCommand("sudo systemctl status c3os-agent")
Expect(out).Should(ContainSubstring("loaded (/etc/systemd/system/c3os-agent.service; enabled; vendor preset: disabled)"))
out, _ := machine.SSHCommand("sudo systemctl status kairos-agent")
Expect(out).Should(ContainSubstring("loaded (/etc/systemd/system/kairos-agent.service; enabled; vendor preset: disabled)"))
out, _ = machine.SSHCommand("sudo systemctl status systemd-timesyncd")
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")
fmt.Println(out)
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")
Expect(grub).Should(ContainSubstring("default_menu_entry=c3os"))
Expect(grub).Should(ContainSubstring("default_menu_entry=kairos"))
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())
if os.Getenv("FLAVOR") == "alpine" {
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)
return out
}, 20*time.Minute, 1*time.Second).Should(
@@ -123,7 +123,7 @@ var _ = Describe("c3os decentralized k8s test", Label("decentralized-k8s"), func
))
} else {
Eventually(func() string {
out, _ := machine.SSHCommand("sudo systemctl status c3os-agent")
out, _ := machine.SSHCommand("sudo systemctl status kairos-agent")
return out
}, 30*time.Minute, 1*time.Second).Should(
Or(
@@ -135,7 +135,7 @@ var _ = Describe("c3os decentralized k8s test", Label("decentralized-k8s"), func
PIt("configure edgevpn", func() {
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
}, 1*time.Minute, 1*time.Second).Should(
And(
@@ -145,22 +145,22 @@ var _ = Describe("c3os decentralized k8s test", Label("decentralized-k8s"), func
It("propagate kubeconfig", func() {
Eventually(func() string {
out, _ := machine.SSHCommand("c3os get-kubeconfig")
out, _ := machine.SSHCommand("kairos get-kubeconfig")
return out
}, 900*time.Second, 10*time.Second).Should(ContainSubstring("https:"))
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")
return out
}, 900*time.Second, 10*time.Second).Should(ContainSubstring("Ready"))
})
It("has roles", func() {
uuid, _ := machine.SSHCommand("c3os-agent uuid")
uuid, _ := machine.SSHCommand("kairos-agent uuid")
Expect(uuid).ToNot(Equal(""))
Eventually(func() string {
out, _ := machine.SSHCommand("c3os role list")
out, _ := machine.SSHCommand("kairos role list")
return out
}, 900*time.Second, 10*time.Second).Should(And(
ContainSubstring(uuid),
@@ -203,7 +203,7 @@ var _ = Describe("c3os decentralized k8s test", Label("decentralized-k8s"), func
It("upgrades to a specific version", func() {
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"))
machine.SSHCommand("sudo sync")

View File

@@ -1,4 +1,4 @@
//nolint
// nolint
package mos_test
import (
@@ -6,13 +6,13 @@ import (
"os"
"time"
"github.com/c3os-io/c3os/pkg/utils"
"github.com/c3os-io/c3os/tests/machine"
"github.com/kairos-io/kairos/pkg/utils"
"github.com/kairos-io/kairos/tests/machine"
. "github.com/onsi/ginkgo/v2"
. "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() {
machine.EventuallyConnects()
})
@@ -27,16 +27,16 @@ var _ = Describe("c3os qr code install", Label("qrcode-install"), func() {
It("has default service active", func() {
if os.Getenv("FLAVOR") == "alpine" {
out, _ := machine.Sudo("rc-status")
Expect(out).Should(ContainSubstring("c3os"))
Expect(out).Should(ContainSubstring("c3os-agent"))
Expect(out).Should(ContainSubstring("kairos"))
Expect(out).Should(ContainSubstring("kairos-agent"))
} else {
// Eventually(func() string {
// out, _ := machine.SSHCommand("sudo systemctl status c3os-agent")
// out, _ := machine.SSHCommand("sudo systemctl status kairos-agent")
// return out
// }, 30*time.Second, 10*time.Second).Should(ContainSubstring("no network token"))
out, _ := machine.Sudo("systemctl status c3os")
Expect(out).Should(ContainSubstring("loaded (/etc/systemd/system/c3os.service; enabled; vendor preset: disabled)"))
out, _ := machine.Sudo("systemctl status kairos")
Expect(out).Should(ContainSubstring("loaded (/etc/systemd/system/kairos.service; enabled; vendor preset: disabled)"))
}
})
})

View File

@@ -5,12 +5,12 @@ import (
"os"
"time"
"github.com/c3os-io/c3os/pkg/utils"
"github.com/kairos-io/kairos/pkg/utils"
. "github.com/onsi/ginkgo/v2"
. "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() {
It("sends config over", func() {
@@ -23,7 +23,7 @@ var _ = Describe("c3os qr code register", Label("qrcode-register"), func() {
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)
return err

View File

@@ -1,4 +1,4 @@
//nolint
// nolint
package mos_test
import (
@@ -10,15 +10,15 @@ import (
"path/filepath"
"testing"
"github.com/c3os-io/c3os/pkg/utils"
"github.com/c3os-io/c3os/tests/machine"
"github.com/kairos-io/kairos/pkg/utils"
"github.com/kairos-io/kairos/tests/machine"
. "github.com/onsi/ginkgo/v2"
. "github.com/onsi/gomega"
)
func TestSuite(t *testing.T) {
RegisterFailHandler(Fail)
RunSpecs(t, "c3os Test Suite")
RunSpecs(t, "kairos Test Suite")
}
var tempDir string
@@ -106,17 +106,17 @@ func gatherLogs() {
machine.GatherAllLogs(
[]string{
"edgevpn@c3os",
"c3os-agent",
"edgevpn@kairos",
"kairos-agent",
"cos-setup-boot",
"cos-setup-network",
"c3os",
"kairos",
"k3s",
},
[]string{
"/var/log/edgevpn.log",
"/var/log/c3os-agent.log",
"/var/log/c3os/agent.log",
"/var/log/kairos-agent.log",
"/var/log/kairos/agent.log",
"/run/pods.json",
"/run/disk",
"/run/mounts",

View File

@@ -1,4 +1,4 @@
//nolint
// nolint
package mos_test
import (
@@ -10,7 +10,7 @@ import (
"os"
"time"
"github.com/c3os-io/c3os/tests/machine"
"github.com/kairos-io/kairos/tests/machine"
. "github.com/onsi/ginkgo/v2"
. "github.com/onsi/gomega"
)
@@ -30,17 +30,17 @@ var _ = Describe("k3s upgrade test", Label("upgrade-k8s"), func() {
It("has default service active", func() {
if os.Getenv("FLAVOR") == "alpine" {
out, _ := machine.Sudo("rc-status")
Expect(out).Should(ContainSubstring("c3os"))
Expect(out).Should(ContainSubstring("c3os-agent"))
Expect(out).Should(ContainSubstring("kairos"))
Expect(out).Should(ContainSubstring("kairos-agent"))
Expect(out).Should(ContainSubstring("crond"))
} else {
// Eventually(func() string {
// out, _ := machine.SSHCommand("sudo systemctl status c3os-agent")
// out, _ := machine.SSHCommand("sudo systemctl status kairos-agent")
// return out
// }, 30*time.Second, 10*time.Second).Should(ContainSubstring("no network token"))
out, _ := machine.Sudo("systemctl status c3os")
Expect(out).Should(ContainSubstring("loaded (/etc/systemd/system/c3os.service; enabled; vendor preset: disabled)"))
out, _ := machine.Sudo("systemctl status kairos")
Expect(out).Should(ContainSubstring("loaded (/etc/systemd/system/kairos.service; enabled; vendor preset: disabled)"))
out, _ = machine.Sudo("systemctl status logrotate.timer")
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() {
if os.Getenv("FLAVOR") == "alpine" {
out, _ := machine.Sudo("rc-status")
Expect(out).Should(ContainSubstring("c3os"))
Expect(out).Should(ContainSubstring("c3os-agent"))
Expect(out).Should(ContainSubstring("kairos"))
Expect(out).Should(ContainSubstring("kairos-agent"))
} else {
out, _ := machine.Sudo("systemctl status c3os-agent")
Expect(out).Should(ContainSubstring("loaded (/etc/systemd/system/c3os-agent.service; enabled; vendor preset: disabled)"))
out, _ := machine.Sudo("systemctl status kairos-agent")
Expect(out).Should(ContainSubstring("loaded (/etc/systemd/system/kairos-agent.service; enabled; vendor preset: disabled)"))
out, _ = machine.Sudo("systemctl status systemd-timesyncd")
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 {
var out string
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 {
out, _ = machine.Sudo("systemctl status c3os-agent")
out, _ = machine.Sudo("systemctl status kairos-agent")
}
return out
}, 900*time.Second, 10*time.Second).Should(ContainSubstring("One time bootstrap starting"))
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
}, 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() {
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(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())
})

View File

@@ -1,4 +1,4 @@
//nolint
// nolint
package mos_test
import (
@@ -11,7 +11,7 @@ import (
"strings"
"time"
"github.com/c3os-io/c3os/tests/machine"
"github.com/kairos-io/kairos/tests/machine"
. "github.com/onsi/ginkgo/v2"
. "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" {
out, _ := machine.Sudo("rc-status")
Expect(out).Should(ContainSubstring("c3os"))
Expect(out).Should(ContainSubstring("c3os-agent"))
Expect(out).Should(ContainSubstring("kairos"))
Expect(out).Should(ContainSubstring("kairos-agent"))
} else {
// Eventually(func() string {
// out, _ := machine.SSHCommand("sudo systemctl status c3os-agent")
// out, _ := machine.SSHCommand("sudo systemctl status kairos-agent")
// return out
// }, 30*time.Second, 10*time.Second).Should(ContainSubstring("no network token"))
out, _ := machine.Sudo("systemctl status c3os")
Expect(out).Should(ContainSubstring("loaded (/etc/systemd/system/c3os.service; enabled; vendor preset: disabled)"))
out, _ := machine.Sudo("systemctl status kairos")
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() {
if os.Getenv("FLAVOR") == "alpine" {
out, _ := machine.Sudo("rc-status")
Expect(out).Should(ContainSubstring("c3os"))
Expect(out).Should(ContainSubstring("c3os-agent"))
Expect(out).Should(ContainSubstring("kairos"))
Expect(out).Should(ContainSubstring("kairos-agent"))
} else {
// Eventually(func() string {
// out, _ := machine.SSHCommand("sudo systemctl status c3os-agent")
// out, _ := machine.SSHCommand("sudo systemctl status kairos-agent")
// return out
// }, 30*time.Second, 10*time.Second).Should(ContainSubstring("no network token"))
out, _ := machine.Sudo("systemctl status c3os-agent")
Expect(out).Should(ContainSubstring("loaded (/etc/systemd/system/c3os-agent.service; enabled; vendor preset: disabled)"))
out, _ := machine.Sudo("systemctl status kairos-agent")
Expect(out).Should(ContainSubstring("loaded (/etc/systemd/system/kairos-agent.service; enabled; vendor preset: disabled)"))
out, _ = machine.Sudo("systemctl status systemd-timesyncd")
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 {
var out string
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 {
out, _ = machine.Sudo("systemctl status c3os-agent")
out, _ = machine.Sudo("systemctl status kairos-agent")
}
return out
}, 900*time.Second, 10*time.Second).Should(ContainSubstring("One time bootstrap starting"))