Skip to content

Commit

Permalink
[dubboctl] Initial image command field (#571)
Browse files Browse the repository at this point in the history
  • Loading branch information
mfordjody authored Jan 31, 2025
1 parent efb916a commit 5fc7a9f
Show file tree
Hide file tree
Showing 2 changed files with 34 additions and 0 deletions.
34 changes: 34 additions & 0 deletions dubboctl/cmd/image.go
Original file line number Diff line number Diff line change
Expand Up @@ -4,12 +4,46 @@ import (
"fmt"
"github.com/apache/dubbo-kubernetes/dubboctl/pkg/cli"
"github.com/apache/dubbo-kubernetes/dubboctl/pkg/sdk/dubbo"
"github.com/ory/viper"
"github.com/spf13/cobra"
"os"
"os/exec"
"path/filepath"
)

type BuildConfig struct {
Build bool
}

type PushConfig struct {
Push bool
}

type ApplyConfig struct {
Apply bool
}

func newBuildConfig(cmd *cobra.Command) *BuildConfig {
bc := &BuildConfig{
Build: viper.GetBool("build"),
}
return bc
}

func newPushConfig(cmd *cobra.Command) *PushConfig {
pc := &PushConfig{
Push: viper.GetBool("push"),
}
return pc
}

func newApplyConfig(cmd *cobra.Command) *ApplyConfig {
ac := &ApplyConfig{
Apply: viper.GetBool("apply"),
}
return ac
}

func ImageCmd(ctx cli.Context, cmd *cobra.Command, clientFactory ClientFactory) *cobra.Command {
ibc := imageBuildCmd(cmd, clientFactory)
ipc := imagePushCmd(cmd, clientFactory)
Expand Down
File renamed without changes.

0 comments on commit 5fc7a9f

Please sign in to comment.