From 7c6fa7df06e12671c74fff2ac7765e009d6d1a2c Mon Sep 17 00:00:00 2001 From: Ettore Di Giacinto Date: Thu, 13 Oct 2022 21:35:26 +0000 Subject: [PATCH] :art: Small fixups --- cmd/discovery/main.go | 9 ++++++++- go.mod | 3 +-- go.sum | 5 ++--- 3 files changed, 11 insertions(+), 6 deletions(-) diff --git a/cmd/discovery/main.go b/cmd/discovery/main.go index 1fd214f..d741059 100644 --- a/cmd/discovery/main.go +++ b/cmd/discovery/main.go @@ -36,7 +36,7 @@ func start() error { factory := pluggable.NewPluginFactory() connectionDetails := &struct { - Server string + Server string `yaml:"challenger_server"` }{} var server string @@ -52,6 +52,13 @@ func start() error { // Input: bus.EventInstallPayload // Expected output: map[string]string{} factory.Add(bus.EventDiscoveryPassword, func(e *pluggable.Event) pluggable.EventResponse { + + if server == "" { + return pluggable.EventResponse{ + Error: "no server configured", + } + } + b := &block.Partition{} err := json.Unmarshal([]byte(e.Data), b) if err != nil { diff --git a/go.mod b/go.mod index ecdf173..8939004 100644 --- a/go.mod +++ b/go.mod @@ -5,7 +5,7 @@ go 1.18 require ( github.com/gorilla/websocket v1.5.0 github.com/jaypipes/ghw v0.9.0 - github.com/kairos-io/go-tpm v0.0.0-20221007215323-700d855876c5 + github.com/kairos-io/go-tpm v0.0.0-20221013145523-cc421fc8c33d github.com/kairos-io/kairos v1.1.2 github.com/kairos-io/kcrypt v0.0.0-20221006145351-cabc24dc37a7 github.com/mudler/go-pluggable v0.0.0-20220716112424-189d463e3ff3 @@ -85,7 +85,6 @@ require ( github.com/pterm/pterm v0.12.41 // indirect github.com/qeesung/image2ascii v1.0.1 // indirect github.com/rivo/uniseg v0.2.0 // indirect - github.com/sirupsen/logrus v1.8.1 // indirect github.com/spf13/pflag v1.0.5 // indirect github.com/wayneashleyberry/terminal-dimensions v1.1.0 // indirect github.com/xo/terminfo v0.0.0-20210125001918-ca9a967f8778 // indirect diff --git a/go.sum b/go.sum index 1d6e02b..af58547 100644 --- a/go.sum +++ b/go.sum @@ -581,8 +581,8 @@ github.com/jtolds/gls v4.20.0+incompatible/go.mod h1:QJZ7F/aHp+rZTRtaJ1ow/lLfFfV github.com/juju/ratelimit v1.0.1/go.mod h1:qapgC/Gy+xNh9UxzV13HGGl/6UXNN+ct+vwSgWNm/qk= github.com/julienschmidt/httprouter v1.2.0/go.mod h1:SYymIcj16QtmaHHD7aYtjjsJG7VTCxuUUipMqKk8s4w= github.com/julienschmidt/httprouter v1.3.0/go.mod h1:JR6WtHb+2LUe8TCKY3cZOxFyyO8IZAc4RVcycCCAKdM= -github.com/kairos-io/go-tpm v0.0.0-20221007215323-700d855876c5 h1:ntceYxOrfh3HITobT/vVvBvyrKQiVrk08CfaoQkOZxw= -github.com/kairos-io/go-tpm v0.0.0-20221007215323-700d855876c5/go.mod h1:VAhWkTXuXg6L6forfoHYeawYcBsBQ6hD4A0ZU+onovk= +github.com/kairos-io/go-tpm v0.0.0-20221013145523-cc421fc8c33d h1:btH1pOJxkGpmYBFYjLD05Ugs6lcgsDVB5nytzLsxY5w= +github.com/kairos-io/go-tpm v0.0.0-20221013145523-cc421fc8c33d/go.mod h1:VAhWkTXuXg6L6forfoHYeawYcBsBQ6hD4A0ZU+onovk= github.com/kairos-io/kairos v1.1.2 h1:xMRzB5Iqzi6t+V4uyFywEqclXWUh74P8JKNTd5A20H8= github.com/kairos-io/kairos v1.1.2/go.mod h1:6QMx1u5rpHgLQSe+ICryMjw3tecQc2MZVTKrTVip8ok= github.com/kairos-io/kcrypt v0.0.0-20221006145351-cabc24dc37a7 h1:5kQgugq41ADeAGRcaNtZr7ck0CrG5C72VkJ1gC/ZnOU= @@ -841,7 +841,6 @@ github.com/sirupsen/logrus v1.2.0/go.mod h1:LxeOpSwHxABJmUn/MG1IvRgCAasNZTLOkJPx github.com/sirupsen/logrus v1.4.2/go.mod h1:tLMulIdttU9McNUspp0xgXVQah82FyeX6MwdIuYE2rE= github.com/sirupsen/logrus v1.6.0/go.mod h1:7uNnSEd1DgxDLC74fIahvMZmmYsHGZGEOFrfsX/uA88= github.com/sirupsen/logrus v1.7.0/go.mod h1:yWOB1SBYBC5VeMP7gHvWumXLIWorT60ONWic61uBYv0= -github.com/sirupsen/logrus v1.8.1 h1:dJKuHgqk1NNQlqoA6BTlM1Wf9DOH3NBjQyu0h9+AZZE= github.com/sirupsen/logrus v1.8.1/go.mod h1:yWOB1SBYBC5VeMP7gHvWumXLIWorT60ONWic61uBYv0= github.com/smartystreets/assertions v0.0.0-20180927180507-b2de0cb4f26d/go.mod h1:OnSkiWE9lh6wB0YB77sQom3nweQdgAjqCqsofrRNTgc= github.com/smartystreets/assertions v1.0.0/go.mod h1:kHHU4qYBaI3q23Pp3VPrmWhuIUrLW/7eUrw0BU5VaoM=