Skip to content

Commit eaab4b9

Browse files
committed
feat: add get_image && is_true
1 parent d6f711c commit eaab4b9

File tree

33 files changed

+184
-110
lines changed

33 files changed

+184
-110
lines changed

cmd/analyze.go

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,7 @@ import (
55
"github.com/loft-sh/devspace/pkg/devspace/analyze"
66
"github.com/loft-sh/devspace/pkg/devspace/config/localcache"
77
"github.com/loft-sh/devspace/pkg/devspace/hook"
8+
"github.com/loft-sh/devspace/pkg/devspace/kubectl"
89
"github.com/loft-sh/devspace/pkg/devspace/plugin"
910
"github.com/loft-sh/devspace/pkg/util/factory"
1011
"github.com/pkg/errors"
@@ -85,7 +86,7 @@ func (cmd *AnalyzeCmd) RunAnalyze(f factory.Factory, cobraCmd *cobra.Command, ar
8586

8687
// If the current kube context or namespace is different than old,
8788
// show warnings and reset kube client if necessary
88-
client, err = client.CheckKubeContext(localCache, cmd.NoWarn, log)
89+
client, err = kubectl.CheckKubeContext(client, localCache, cmd.NoWarn, log)
8990
if err != nil {
9091
return err
9192
}

cmd/build.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -106,10 +106,10 @@ func (cmd *BuildCmd) runCommand(ctx *devspacecontext.Context, f factory.Factory,
106106
},
107107
DependencyOptions: pipelinetypes.DependencyOptions{
108108
Exclude: cmd.SkipDependency,
109+
Only: cmd.Dependency,
109110
},
110111
},
111112
ConfigOptions: configOptions,
112-
Only: cmd.Dependency,
113113
Pipeline: cmd.Pipeline,
114114
})
115115
}

cmd/deploy.go

Lines changed: 5 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,7 @@ import (
1414
"github.com/loft-sh/devspace/pkg/devspace/deploy"
1515
"github.com/loft-sh/devspace/pkg/devspace/dev"
1616
"github.com/loft-sh/devspace/pkg/devspace/devpod"
17+
"github.com/loft-sh/devspace/pkg/devspace/kubectl"
1718
fakekube "github.com/loft-sh/devspace/pkg/devspace/kubectl/testing"
1819
"github.com/loft-sh/devspace/pkg/devspace/pipeline"
1920
"github.com/loft-sh/devspace/pkg/devspace/pipeline/types"
@@ -151,10 +152,10 @@ func (cmd *DeployCmd) runCommand(ctx *devspacecontext.Context, f factory.Factory
151152
},
152153
DependencyOptions: types.DependencyOptions{
153154
Exclude: cmd.SkipDependency,
155+
Only: cmd.Dependency,
154156
},
155157
},
156158
ConfigOptions: configOptions,
157-
Only: cmd.Dependency,
158159
Pipeline: cmd.Pipeline,
159160
})
160161
}
@@ -212,7 +213,7 @@ func prepare(ctx context.Context, f factory.Factory, configOptions *loader.Confi
212213

213214
// If the current kube context or namespace is different than old,
214215
// show warnings and reset kube client if necessary
215-
client, err = client.CheckKubeContext(localCache, globalFlags.NoWarn, log)
216+
client, err = kubectl.CheckKubeContext(client, localCache, globalFlags.NoWarn, log)
216217
if err != nil {
217218
return nil, err
218219
}
@@ -233,7 +234,6 @@ type PipelineOptions struct {
233234
types.Options
234235

235236
ConfigOptions *loader.ConfigOptions
236-
Only []string
237237
Pipeline string
238238
ShowUI bool
239239
UIPort int
@@ -242,7 +242,7 @@ type PipelineOptions struct {
242242
func runPipeline(ctx *devspacecontext.Context, f factory.Factory, forceLeader bool, options *PipelineOptions) error {
243243
// create namespace if necessary
244244
if !options.DeployOptions.Render {
245-
err := ctx.KubeClient.EnsureNamespace(ctx.Context, ctx.KubeClient.Namespace(), ctx.Log)
245+
err := kubectl.EnsureNamespace(ctx.Context, ctx.KubeClient, ctx.KubeClient.Namespace(), ctx.Log)
246246
if err != nil {
247247
return errors.Errorf("unable to create namespace: %v", err)
248248
}
@@ -255,10 +255,7 @@ func runPipeline(ctx *devspacecontext.Context, f factory.Factory, forceLeader bo
255255
}
256256

257257
// resolve dependencies
258-
dependencies, err := f.NewDependencyManager(ctx, options.ConfigOptions).ResolveAll(ctx, dependency.ResolveOptions{
259-
SkipDependencies: options.DependencyOptions.Exclude,
260-
Dependencies: options.Only,
261-
})
258+
dependencies, err := f.NewDependencyManager(ctx, options.ConfigOptions).ResolveAll(ctx, dependency.ResolveOptions{})
262259
if err != nil {
263260
return errors.Wrap(err, "deploy dependencies")
264261
}

cmd/dev.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -181,6 +181,7 @@ func (cmd *DevCmd) runCommand(ctx *devspacecontext.Context, f factory.Factory, c
181181
},
182182
DependencyOptions: types.DependencyOptions{
183183
Exclude: cmd.SkipDependency,
184+
Only: cmd.Dependency,
184185
},
185186
DevOptions: devpod.Options{
186187
DisableSync: cmd.DisableSync,
@@ -189,7 +190,6 @@ func (cmd *DevCmd) runCommand(ctx *devspacecontext.Context, f factory.Factory, c
189190
},
190191
},
191192
ConfigOptions: configOptions,
192-
Only: cmd.Dependency,
193193
Pipeline: cmd.Pipeline,
194194
ShowUI: !cmd.DisableUI,
195195
UIPort: cmd.UIPort,

cmd/list/deployments.go

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,7 @@ import (
99
deployHelm "github.com/loft-sh/devspace/pkg/devspace/deploy/deployer/helm"
1010
deployKubectl "github.com/loft-sh/devspace/pkg/devspace/deploy/deployer/kubectl"
1111
"github.com/loft-sh/devspace/pkg/devspace/helm"
12+
"github.com/loft-sh/devspace/pkg/devspace/kubectl"
1213
"github.com/loft-sh/devspace/pkg/util/factory"
1314
logpkg "github.com/loft-sh/devspace/pkg/util/log"
1415
"github.com/loft-sh/devspace/pkg/util/message"
@@ -79,7 +80,7 @@ func (cmd *deploymentsCmd) RunDeploymentsStatus(f factory.Factory, cobraCmd *cob
7980

8081
// If the current kube context or namespace is different than old,
8182
// show warnings and reset kube client if necessary
82-
client, err = client.CheckKubeContext(localCache, cmd.NoWarn, logger)
83+
client, err = kubectl.CheckKubeContext(client, localCache, cmd.NoWarn, logger)
8384
if err != nil {
8485
return err
8586
}

cmd/list/namespaces.go

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,7 @@ package list
33
import (
44
"context"
55
"github.com/loft-sh/devspace/pkg/devspace/config/localcache"
6+
"github.com/loft-sh/devspace/pkg/devspace/kubectl"
67
"strconv"
78

89
"github.com/loft-sh/devspace/cmd/flags"
@@ -70,7 +71,7 @@ func (cmd *namespacesCmd) RunListNamespaces(f factory.Factory, cobraCmd *cobra.C
7071

7172
// If the current kube context or namespace is different than old,
7273
// show warnings and reset kube client if necessary
73-
client, err = client.CheckKubeContext(localCache, cmd.NoWarn, logger)
74+
client, err = kubectl.CheckKubeContext(client, localCache, cmd.NoWarn, logger)
7475
if err != nil {
7576
return err
7677
}

cmd/open.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -129,7 +129,7 @@ func (cmd *OpenCmd) RunOpen(f factory.Factory) error {
129129

130130
// If the current kube context or namespace is different than old,
131131
// show warnings and reset kube client if necessary
132-
client, err = client.CheckKubeContext(localCache, cmd.NoWarn, cmd.log)
132+
client, err = kubectl.CheckKubeContext(client, localCache, cmd.NoWarn, cmd.log)
133133
if err != nil {
134134
return err
135135
}

cmd/purge.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -98,10 +98,10 @@ func (cmd *PurgeCmd) runCommand(ctx *devspacecontext.Context, f factory.Factory,
9898
Options: types.Options{
9999
DependencyOptions: types.DependencyOptions{
100100
Exclude: cmd.SkipDependency,
101+
Only: cmd.Dependency,
101102
},
102103
},
103104
ConfigOptions: configOptions,
104-
Only: cmd.Dependency,
105105
Pipeline: cmd.Pipeline,
106106
})
107107
}

cmd/render.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -108,10 +108,10 @@ func (cmd *RenderCmd) runCommand(ctx *devspacecontext.Context, f factory.Factory
108108
},
109109
DependencyOptions: pipelinetypes.DependencyOptions{
110110
Exclude: cmd.SkipDependency,
111+
Only: cmd.Dependency,
111112
},
112113
},
113114
ConfigOptions: configOptions,
114-
Only: cmd.Dependency,
115115
Pipeline: "deploy",
116116
})
117117
}

cmd/reset/pods.go

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,7 @@ package reset
33
import (
44
"context"
55
devspacecontext "github.com/loft-sh/devspace/pkg/devspace/context"
6+
"github.com/loft-sh/devspace/pkg/devspace/kubectl"
67

78
"github.com/loft-sh/devspace/cmd/flags"
89
"github.com/loft-sh/devspace/pkg/devspace/dependency"
@@ -77,7 +78,7 @@ func (cmd *podsCmd) RunResetPods(f factory.Factory, cobraCmd *cobra.Command, arg
7778

7879
// If the current kube context or namespace is different than old,
7980
// show warnings and reset kube client if necessary
80-
client, err = client.CheckKubeContext(localCache, cmd.NoWarn, cmd.log)
81+
client, err = kubectl.CheckKubeContext(client, localCache, cmd.NoWarn, cmd.log)
8182
if err != nil {
8283
return err
8384
}

0 commit comments

Comments
 (0)