mirror of
https://github.com/kairos-io/provider-kairos.git
synced 2025-08-18 23:37:06 +00:00
This PR extracts the registration command into a `kairos-register` binary of its own. The old sub command is kept so users can see a deprecation notice and adapt for a future release when it's removed. The version number is shared between binaries. ⚠️ I'm not entirely sure about the gorelease, and would benefit from a couple of extra 👀 on this, thanks! relates to kairos-io/kairos#1211 --------- Signed-off-by: Mauro Morales <mauro.morales@spectrocloud.com> Signed-off-by: Mauro Morales <contact@mauromorales.com> Signed-off-by: Itxaka <itxaka.garcia@spectrocloud.com> Signed-off-by: GitHub <noreply@github.com> Co-authored-by: Dimitris Karakasilis <dimitris@karakasilis.me> Co-authored-by: Itxaka <itxaka.garcia@spectrocloud.com> Co-authored-by: ci-robbot [bot] <105103991+ci-robbot@users.noreply.github.com> Co-authored-by: mudler <mudler@users.noreply.github.com> Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
34 lines
848 B
Go
34 lines
848 B
Go
package mos
|
|
|
|
import (
|
|
"fmt"
|
|
"os"
|
|
"time"
|
|
|
|
"github.com/kairos-io/kairos-sdk/utils"
|
|
. "github.com/onsi/ginkgo/v2"
|
|
. "github.com/onsi/gomega"
|
|
)
|
|
|
|
var _ = Describe("kairos qr code register", Label("qrcode-register"), func() {
|
|
|
|
Context("register", func() {
|
|
It("sends config over", func() {
|
|
download("https://github.com/schollz/croc/releases/download/v9.6.0/croc_9.6.0_Linux-64bit.tar.gz")
|
|
Eventually(func() error {
|
|
os.RemoveAll("screenshot.png")
|
|
out, err := utils.SH(fmt.Sprintf("./croc --yes %s", os.Getenv("SENDKEY")))
|
|
fmt.Println(out)
|
|
if err != nil {
|
|
return err
|
|
}
|
|
|
|
out, err = utils.SH(fmt.Sprintf("kairosctl register--device /dev/sda --config %s %s", os.Getenv("CLOUD_INIT"), "screenshot.png"))
|
|
fmt.Println(out)
|
|
return err
|
|
|
|
}, 20*time.Minute, 10*time.Second).ShouldNot(HaveOccurred())
|
|
})
|
|
})
|
|
})
|