2 Commits

Author SHA1 Message Date
Dimitris Karakasilis
45901b67ca Add new find-matching-framework command
to be used here:
https://github.com/kairos-io/enki/pull/2/files#diff-73afecb49f97526777fbdcbb5fe33b639ff0a1d84757414b30e6efeeaedbe72fR89

Signed-off-by: Dimitris Karakasilis <dimitris@karakasilis.me>
2023-10-05 11:36:46 +03:00
renovate[bot]
8a77e39866 Update module github.com/kairos-io/kairos-sdk to v0.0.14 2023-10-05 03:48:11 +00:00
4 changed files with 59 additions and 2 deletions

View File

@@ -0,0 +1,42 @@
package cmd
import (
"fmt"
"github.com/kairos-io/enki/pkg/action"
"github.com/spf13/cobra"
)
// NewFindMatchingFrameworkCmd returns a new instance of the build-iso subcommand and appends it to
// the root command.
func NewFindMatchingFrameworkCmd() *cobra.Command {
c := &cobra.Command{
Use: "find-matching-framework",
Short: "Finds the framework image that matches the current OS best",
Long: "Finds the framework image that matches the current OS best\n" +
"This is best effort and might return a framework image that doesn't work.\n" +
"It is expected to work with the official Kairos flavors.",
Args: cobra.ExactArgs(0),
PreRunE: func(cmd *cobra.Command, args []string) error {
//return CheckRoot() // TODO: Do we need this?
return nil
},
RunE: func(cmd *cobra.Command, args []string) error {
a := action.NewFindMatchingFrameworkAction()
result, err := a.Run()
if err != nil {
return err
}
fmt.Println(result)
return nil
},
}
return c
}
func init() {
rootCmd.AddCommand(NewFindMatchingFrameworkCmd())
}

4
go.mod
View File

@@ -4,7 +4,7 @@ go 1.20
require (
github.com/kairos-io/kairos-agent/v2 v2.1.11-0.20230713071318-9a16b94e2af6
github.com/kairos-io/kairos-sdk v0.0.9-0.20230719194412-fe26d1de9166
github.com/kairos-io/kairos-sdk v0.0.14
github.com/mitchellh/mapstructure v1.5.0
github.com/onsi/ginkgo/v2 v2.11.0
github.com/onsi/gomega v1.27.10
@@ -125,7 +125,7 @@ require (
github.com/willdonnelly/passwd v0.0.0-20141013001024-7935dab3074c // indirect
github.com/xanzy/ssh-agent v0.3.1 // indirect
github.com/xo/terminfo v0.0.0-20220910002029-abceb7e1c41e // indirect
github.com/zcalusic/sysinfo v0.9.5 // indirect
github.com/zcalusic/sysinfo v1.0.1 // indirect
go.opencensus.io v0.24.0 // indirect
golang.org/x/crypto v0.11.0 // indirect
golang.org/x/exp v0.0.0-20230522175609-2e198f4a06a1 // indirect

4
go.sum
View File

@@ -328,6 +328,8 @@ github.com/kairos-io/kairos-agent/v2 v2.1.11-0.20230713071318-9a16b94e2af6 h1:5t
github.com/kairos-io/kairos-agent/v2 v2.1.11-0.20230713071318-9a16b94e2af6/go.mod h1:+zG2JtLuTE9TDwiXJg9/jqcD/G59PhdN+Z0G5dcGiJk=
github.com/kairos-io/kairos-sdk v0.0.9-0.20230719194412-fe26d1de9166 h1:xAsvPm5a7ivervVjkJ5DIZWOQww4Za75erEwZ1Xcd7I=
github.com/kairos-io/kairos-sdk v0.0.9-0.20230719194412-fe26d1de9166/go.mod h1:AK9poWisuhnzri04diXnTG8L7EkOSUArSeeDn2LYFU0=
github.com/kairos-io/kairos-sdk v0.0.14 h1:yVKaay70cjmAUY6m4uLoV9UguBv3Dx3JxAh2faRlUZo=
github.com/kairos-io/kairos-sdk v0.0.14/go.mod h1:+fhVoCEA2hD7OFTmhDmy4pP3uC9q84OYhDa7irkEVWQ=
github.com/kendru/darwin/go/depgraph v0.0.0-20221105232959-877d6a81060c h1:eKb4PqwAMhlqwXw0W3atpKaYaPGlXE/Fwh+xpCEYaPk=
github.com/kendru/darwin/go/depgraph v0.0.0-20221105232959-877d6a81060c/go.mod h1:VOfm8h1NySetVlpHDSnbpCMsvCgYaU+YDn4XezUy2+4=
github.com/kevinburke/ssh_config v0.0.0-20201106050909-4977a11b4351/go.mod h1:CT57kijsi8u/K/BOFA39wgDQJ9CxiF4nAY/ojJ6r6mM=
@@ -568,6 +570,8 @@ github.com/yuin/goldmark v1.2.1/go.mod h1:3hX8gzYuyVAZsxl0MRgGTJEmQBFcNTphYh9dec
github.com/yuin/goldmark v1.4.13/go.mod h1:6yULJ656Px+3vBD8DxQVa3kxgyrAnzto9xy5taEt/CY=
github.com/zcalusic/sysinfo v0.9.5 h1:ivoHyj9aIAYkwzo1+8QgJ5s4oeE6Etx9FmZtqa4wJjQ=
github.com/zcalusic/sysinfo v0.9.5/go.mod h1:Z/gPVufBrFc8X5sef3m6kkw3r3nlNFp+I6bvASfvBZQ=
github.com/zcalusic/sysinfo v1.0.1 h1:cVh8q3codjh43AGRTa54dJ2Zq+qPejv8n2VWpxKViwc=
github.com/zcalusic/sysinfo v1.0.1/go.mod h1:LxwKwtQdbTIQc65drhjQzYzt0o7jfB80LrrZm7SWn8o=
go.etcd.io/bbolt v1.3.2/go.mod h1:IbVyRI1SCnLcuJnV2u8VeU0CEYM7e686BmAb1XKL+uU=
go.opencensus.io v0.21.0/go.mod h1:mSImk1erAIZhrmZN+AvHh14ztQfjbGwt4TtuofqLduU=
go.opencensus.io v0.22.0/go.mod h1:+kGneAE2xo2IficOXnaByMWTGM9T73dGwxeWcUqIpI8=

View File

@@ -0,0 +1,11 @@
package action
type FindMatchingFrameworkAction struct{}
func NewFindMatchingFrameworkAction() *FindMatchingFrameworkAction {
return &FindMatchingFrameworkAction{}
}
func (a *FindMatchingFrameworkAction) Run() (framework string, err error) {
return
}