Skip to content

Commit 4eadeae

Browse files
committed
Merge branch 'master' into v6-docs
2 parents 26a6904 + 41610dc commit 4eadeae

52 files changed

Lines changed: 635 additions & 293 deletions

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

cmd/add/add.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@ import (
1111
func NewAddCmd(f factory.Factory, globalFlags *flags.GlobalFlags, plugins []plugin.Metadata) *cobra.Command {
1212
addCmd := &cobra.Command{
1313
Use: "add",
14-
Short: "Convenience command: adds something to devspace.yaml",
14+
Short: "Adds something to devspace.yaml",
1515
Long: `
1616
#######################################################
1717
#################### devspace add #####################

cmd/add/plugin.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@ func newPluginCmd(f factory.Factory) *cobra.Command {
1414
cmd := &pluginCmd{}
1515
pluginCmd := &cobra.Command{
1616
Use: "plugin",
17-
Short: "Add a plugin to devspace",
17+
Short: "Adds a plugin to devspace",
1818
Long: `
1919
#######################################################
2020
############### devspace add plugin ###################

cmd/completion.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -43,7 +43,7 @@ func NewCompletionCmd() *cobra.Command {
4343
return cobra.OnlyValidArgs(cmd, args)
4444
},
4545
ValidArgs: []string{"bash", "zsh"},
46-
Short: "Output shell completion for the given shell (bash or zsh)",
46+
Short: "Outputs shell completion for the given shell (bash or zsh)",
4747
Long: longDescription,
4848
RunE: completion,
4949
}

cmd/deploy.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@ func NewDeployCmd(f factory.Factory, globalFlags *flags.GlobalFlags, rawConfig *
1717

1818
deployCmd := &cobra.Command{
1919
Use: "deploy",
20-
Short: "Deploy the project",
20+
Short: "Deploys the project",
2121
Long: `
2222
#######################################################
2323
################## devspace deploy ####################

cmd/init.go

Lines changed: 5 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -49,9 +49,6 @@ const devspaceFolderGitignore = "\n\n# Ignore DevSpace cache and log folder\n.de
4949

5050
const (
5151
// Dockerfile not found options
52-
UseExistingDockerfileOption = "Use the Dockerfile in ./Dockerfile"
53-
CreateDockerfileOption = "Create a Dockerfile for this project"
54-
EnterDockerfileOption = "Enter path to a different Dockerfile"
5552
DeployOptionHelm = "helm"
5653
DeployOptionKubectl = "kubectl"
5754
DeployOptionKustomize = "kustomize"
@@ -162,9 +159,8 @@ func (cmd *InitCmd) Run(f factory.Factory) error {
162159
} else {
163160
err = cmd.initDevspace(f, configLoader)
164161
}
165-
166162
if err != nil {
167-
panic(err)
163+
return err
168164
}
169165

170166
cmd.log.WriteString(logrus.InfoLevel, "\n")
@@ -437,7 +433,7 @@ func (cmd *InitCmd) initDevspace(f factory.Factory, configLoader loader.ConfigLo
437433

438434
config.Commands["migrate-db"] = &latest.CommandConfig{
439435
Command: `echo 'This is a cross-platform, shared command that can be used to codify any kind of dev task.'
440-
echo 'Anyone using this project can invoke it via "devspace run migrate-db"'`,
436+
echo 'Anyone using this project can invoke it via "devspace run migrate-db"'`,
441437
}
442438
}
443439

@@ -456,8 +452,7 @@ start_dev ` + imageName + ` # 3. Start dev mode "` + imageNa
456452
config.Pipelines["deploy"] = &latest.Pipeline{
457453
Run: `run_dependency_pipelines --all # 1. Deploy any projects this project needs (see "dependencies")
458454
build_images --all -t $(git describe --always) # 2. Build, tag (git commit hash) and push all images (see "images")
459-
create_deployments --all \ # 3. Deploy Helm charts and manifests specfied as "deployments"
460-
--set updateImageTags=true # + make sure to update all image tags to the one from step 2`,
455+
create_deployments --all # 3. Deploy Helm charts and manifests specfied as "deployments"`,
461456
}
462457

463458
// Save config
@@ -739,7 +734,8 @@ func (cmd *InitCmd) render(f factory.Factory, config *latest.Config) (string, er
739734
}
740735
err = renderCmd.RunDefault(f)
741736
if err != nil {
742-
return "", err
737+
f.GetLog().Debugf("error rendering chart: %v", err)
738+
return "", nil
743739
}
744740

745741
return writer.String(), nil

cmd/list/deployments.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -32,7 +32,7 @@ func newDeploymentsCmd(f factory.Factory, globalFlags *flags.GlobalFlags) *cobra
3232
#######################################################
3333
############# devspace list deployments ###############
3434
#######################################################
35-
Shows the status of all deployments
35+
Lists the status of all deployments
3636
#######################################################
3737
`,
3838
Args: cobra.NoArgs,

cmd/logs.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -50,7 +50,7 @@ func NewLogsCmd(f factory.Factory, globalFlags *flags.GlobalFlags) *cobra.Comman
5050
#######################################################
5151
#################### devspace logs ####################
5252
#######################################################
53-
Logs prints the last log of a pod container and attachs
53+
Prints the last log of a pod container and attachs
5454
to it
5555
5656
Example:

cmd/print.go

Lines changed: 42 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,7 @@ import (
44
"context"
55
"fmt"
66
"github.com/loft-sh/devspace/pkg/devspace/config"
7+
"github.com/loft-sh/devspace/pkg/devspace/config/versions/latest"
78
devspacecontext "github.com/loft-sh/devspace/pkg/devspace/context"
89
"github.com/loft-sh/devspace/pkg/devspace/dependency"
910
"github.com/loft-sh/devspace/pkg/devspace/dependency/types"
@@ -27,8 +28,9 @@ import (
2728
type PrintCmd struct {
2829
*flags.GlobalFlags
2930

30-
Out io.Writer
31-
SkipInfo bool
31+
Out io.Writer
32+
StripNames bool
33+
SkipInfo bool
3234

3335
Dependency string
3436
}
@@ -37,12 +39,13 @@ type PrintCmd struct {
3739
func NewPrintCmd(f factory.Factory, globalFlags *flags.GlobalFlags) *cobra.Command {
3840
cmd := &PrintCmd{
3941
GlobalFlags: globalFlags,
42+
StripNames: true,
4043
Out: os.Stdout,
4144
}
4245

4346
printCmd := &cobra.Command{
4447
Use: "print",
45-
Short: "Print displays the configuration",
48+
Short: "Prints displays the configuration",
4649
Long: `
4750
#######################################################
4851
################## devspace print #####################
@@ -117,7 +120,7 @@ func (cmd *PrintCmd) Run(f factory.Factory) error {
117120
ctx = ctx.AsDependency(dep)
118121
}
119122

120-
bsConfig, err := yaml.Marshal(ctx.Config().Config())
123+
bsConfig, err := marshalConfig(ctx.Config().Config(), cmd.StripNames)
121124
if err != nil {
122125
return err
123126
}
@@ -141,6 +144,41 @@ func (cmd *PrintCmd) Run(f factory.Factory) error {
141144
return nil
142145
}
143146

147+
func marshalConfig(config *latest.Config, stripNames bool) ([]byte, error) {
148+
// remove the auto generated names
149+
if stripNames {
150+
for k := range config.Images {
151+
config.Images[k].Name = ""
152+
}
153+
for k := range config.Deployments {
154+
config.Deployments[k].Name = ""
155+
}
156+
for k := range config.Dependencies {
157+
config.Dependencies[k].Name = ""
158+
}
159+
for k := range config.Pipelines {
160+
config.Pipelines[k].Name = ""
161+
}
162+
for k := range config.Dev {
163+
config.Dev[k].Name = ""
164+
for c := range config.Dev[k].Containers {
165+
config.Dev[k].Containers[c].Container = ""
166+
}
167+
}
168+
for k := range config.Vars {
169+
config.Vars[k].Name = ""
170+
}
171+
for k := range config.PullSecrets {
172+
config.PullSecrets[k].Name = ""
173+
}
174+
for k := range config.Commands {
175+
config.Commands[k].Name = ""
176+
}
177+
}
178+
179+
return yaml.Marshal(config)
180+
}
181+
144182
func printExtraInfo(config config.Config, dependencies []types.Dependency, log logger.Logger) error {
145183
log.WriteString(logrus.InfoLevel, "\n-------------------\n\nVars:\n")
146184

cmd/purge.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@ func NewPurgeCmd(f factory.Factory, globalFlags *flags.GlobalFlags, rawConfig *R
1717
}
1818
purgeCmd := &cobra.Command{
1919
Use: "purge",
20-
Short: "Delete deployed resources",
20+
Short: "Deletes deployed resources",
2121
Long: `
2222
#######################################################
2323
################### devspace purge ####################

cmd/remove/remove.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@ import (
1111
func NewRemoveCmd(f factory.Factory, globalFlags *flags.GlobalFlags, plugins []plugin.Metadata) *cobra.Command {
1212
removeCmd := &cobra.Command{
1313
Use: "remove",
14-
Short: "Changes devspace configuration",
14+
Short: "Removes devspace configuration",
1515
Long: `
1616
#######################################################
1717
################## devspace remove ####################

0 commit comments

Comments
 (0)