From 450e4301c986e4e7102a89414f5fa44695244704 Mon Sep 17 00:00:00 2001 From: Ole Claussen Date: Fri, 30 Aug 2024 11:10:48 +0000 Subject: [PATCH] chore: adjust code to changes in core --- pkg/command/build/command.go | 7 ++++++- pkg/command/build/plugin.go | 4 ++-- pkg/command/dodo/command.go | 2 +- pkg/command/dodo/plugin.go | 4 ++-- pkg/command/run/command.go | 5 ++++- pkg/command/run/plugin.go | 4 ++-- pkg/core/build.go | 2 +- pkg/core/run.go | 2 +- 8 files changed, 19 insertions(+), 11 deletions(-) diff --git a/pkg/command/build/command.go b/pkg/command/build/command.go index 9ed7ec6..13c0f9f 100644 --- a/pkg/command/build/command.go +++ b/pkg/command/build/command.go @@ -4,7 +4,7 @@ import ( "fmt" "github.com/spf13/cobra" - api "github.com/wabenet/dodo-core/api/v1alpha4" + api "github.com/wabenet/dodo-core/api/core/v1alpha5" "github.com/wabenet/dodo-core/pkg/plugin" "github.com/wabenet/dodo/pkg/core" ) @@ -13,6 +13,7 @@ type options struct { noCache bool forceRebuild bool forcePull bool + runtime string } func New(m plugin.Manager) *Command { @@ -27,6 +28,7 @@ func New(m plugin.Manager) *Command { RunE: func(cmd *cobra.Command, args []string) error { config := &api.BuildInfo{ ImageName: args[0], + Builder: opts.runtime, NoCache: opts.noCache, ForceRebuild: opts.forceRebuild, ForcePull: opts.forcePull, @@ -52,6 +54,9 @@ func New(m plugin.Manager) *Command { flags.BoolVar( &opts.forcePull, "pull", false, "always attempt to pull base images") + flags.StringVarP( + &opts.runtime, "runtime", "r", "", + "select runtime plugin") return &Command{cmd: cmd} } diff --git a/pkg/command/build/plugin.go b/pkg/command/build/plugin.go index 40dc1a6..b0d42df 100644 --- a/pkg/command/build/plugin.go +++ b/pkg/command/build/plugin.go @@ -2,7 +2,7 @@ package build import ( "github.com/spf13/cobra" - api "github.com/wabenet/dodo-core/api/v1alpha4" + api "github.com/wabenet/dodo-core/api/core/v1alpha5" "github.com/wabenet/dodo-core/pkg/plugin" "github.com/wabenet/dodo-core/pkg/plugin/command" ) @@ -25,7 +25,7 @@ func (p *Command) PluginInfo() *api.PluginInfo { } } -func (*Command) Init() (plugin.PluginConfig, error) { +func (*Command) Init() (plugin.Config, error) { return map[string]string{}, nil } diff --git a/pkg/command/dodo/command.go b/pkg/command/dodo/command.go index 5a938f5..0c438af 100644 --- a/pkg/command/dodo/command.go +++ b/pkg/command/dodo/command.go @@ -6,7 +6,7 @@ import ( "os/exec" "github.com/spf13/cobra" - api "github.com/wabenet/dodo-core/api/v1alpha4" + api "github.com/wabenet/dodo-core/api/core/v1alpha5" "github.com/wabenet/dodo-core/pkg/plugin" "github.com/wabenet/dodo-core/pkg/plugin/command" "go.szostok.io/version/extension" diff --git a/pkg/command/dodo/plugin.go b/pkg/command/dodo/plugin.go index 904ad29..f0731ce 100644 --- a/pkg/command/dodo/plugin.go +++ b/pkg/command/dodo/plugin.go @@ -2,7 +2,7 @@ package dodo import ( "github.com/spf13/cobra" - api "github.com/wabenet/dodo-core/api/v1alpha4" + api "github.com/wabenet/dodo-core/api/core/v1alpha5" "github.com/wabenet/dodo-core/pkg/plugin" "github.com/wabenet/dodo-core/pkg/plugin/command" ) @@ -25,7 +25,7 @@ func (p *Command) PluginInfo() *api.PluginInfo { } } -func (*Command) Init() (plugin.PluginConfig, error) { +func (*Command) Init() (plugin.Config, error) { return map[string]string{}, nil } diff --git a/pkg/command/run/command.go b/pkg/command/run/command.go index 91438dd..0e982b4 100644 --- a/pkg/command/run/command.go +++ b/pkg/command/run/command.go @@ -4,7 +4,7 @@ import ( "fmt" "github.com/spf13/cobra" - api "github.com/wabenet/dodo-core/api/v1alpha4" + api "github.com/wabenet/dodo-core/api/core/v1alpha5" "github.com/wabenet/dodo-core/pkg/config" "github.com/wabenet/dodo-core/pkg/plugin" "github.com/wabenet/dodo-core/pkg/plugin/command" @@ -91,6 +91,9 @@ func (opts *options) createConfig(name string, command []string) (*api.Backdrop, c := &api.Backdrop{ Name: name, Runtime: opts.runtime, + BuildInfo: &api.BuildInfo{ + Builder: opts.runtime, + }, Entrypoint: &api.Entrypoint{ Interactive: opts.interactive, Arguments: command, diff --git a/pkg/command/run/plugin.go b/pkg/command/run/plugin.go index 7cc2082..f29d679 100644 --- a/pkg/command/run/plugin.go +++ b/pkg/command/run/plugin.go @@ -2,7 +2,7 @@ package run import ( "github.com/spf13/cobra" - api "github.com/wabenet/dodo-core/api/v1alpha4" + api "github.com/wabenet/dodo-core/api/core/v1alpha5" "github.com/wabenet/dodo-core/pkg/plugin" "github.com/wabenet/dodo-core/pkg/plugin/command" ) @@ -25,7 +25,7 @@ func (p *Command) PluginInfo() *api.PluginInfo { } } -func (*Command) Init() (plugin.PluginConfig, error) { +func (*Command) Init() (plugin.Config, error) { return map[string]string{}, nil } diff --git a/pkg/core/build.go b/pkg/core/build.go index fa647b3..5d54e8f 100644 --- a/pkg/core/build.go +++ b/pkg/core/build.go @@ -3,7 +3,7 @@ package core import ( "fmt" - api "github.com/wabenet/dodo-core/api/v1alpha4" + api "github.com/wabenet/dodo-core/api/core/v1alpha5" "github.com/wabenet/dodo-core/pkg/plugin" "github.com/wabenet/dodo-core/pkg/plugin/builder" "github.com/wabenet/dodo-core/pkg/plugin/configuration" diff --git a/pkg/core/run.go b/pkg/core/run.go index 3ceb8b7..4b5d750 100644 --- a/pkg/core/run.go +++ b/pkg/core/run.go @@ -8,7 +8,7 @@ import ( "syscall" log "github.com/hashicorp/go-hclog" - api "github.com/wabenet/dodo-core/api/v1alpha4" + api "github.com/wabenet/dodo-core/api/core/v1alpha5" "github.com/wabenet/dodo-core/pkg/plugin" "github.com/wabenet/dodo-core/pkg/plugin/configuration" "github.com/wabenet/dodo-core/pkg/plugin/runtime"