Skip to content

Commit

Permalink
chore: adjust code to changes in core
Browse files Browse the repository at this point in the history
  • Loading branch information
oclaussen committed Aug 30, 2024
1 parent 83b6cba commit 450e430
Show file tree
Hide file tree
Showing 8 changed files with 19 additions and 11 deletions.
7 changes: 6 additions & 1 deletion pkg/command/build/command.go
Original file line number Diff line number Diff line change
Expand Up @@ -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"
)
Expand All @@ -13,6 +13,7 @@ type options struct {
noCache bool
forceRebuild bool
forcePull bool
runtime string
}

func New(m plugin.Manager) *Command {
Expand All @@ -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,
Expand All @@ -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}
}
4 changes: 2 additions & 2 deletions pkg/command/build/plugin.go
Original file line number Diff line number Diff line change
Expand Up @@ -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"
)
Expand All @@ -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
}

Expand Down
2 changes: 1 addition & 1 deletion pkg/command/dodo/command.go
Original file line number Diff line number Diff line change
Expand Up @@ -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"
Expand Down
4 changes: 2 additions & 2 deletions pkg/command/dodo/plugin.go
Original file line number Diff line number Diff line change
Expand Up @@ -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"
)
Expand All @@ -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
}

Expand Down
5 changes: 4 additions & 1 deletion pkg/command/run/command.go
Original file line number Diff line number Diff line change
Expand Up @@ -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"
Expand Down Expand Up @@ -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,
Expand Down
4 changes: 2 additions & 2 deletions pkg/command/run/plugin.go
Original file line number Diff line number Diff line change
Expand Up @@ -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"
)
Expand All @@ -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
}

Expand Down
2 changes: 1 addition & 1 deletion pkg/core/build.go
Original file line number Diff line number Diff line change
Expand Up @@ -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"
Expand Down
2 changes: 1 addition & 1 deletion pkg/core/run.go
Original file line number Diff line number Diff line change
Expand Up @@ -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"
Expand Down

0 comments on commit 450e430

Please sign in to comment.