Prefer "up" over "update" (#1672)
This commit is contained in:
parent
d19942f2b0
commit
76eea4863a
|
@ -129,7 +129,7 @@ func NewPulumiCmd() *cobra.Command {
|
||||||
cmd.AddCommand(newPreviewCmd())
|
cmd.AddCommand(newPreviewCmd())
|
||||||
cmd.AddCommand(newRefreshCmd())
|
cmd.AddCommand(newRefreshCmd())
|
||||||
cmd.AddCommand(newStackCmd())
|
cmd.AddCommand(newStackCmd())
|
||||||
cmd.AddCommand(newUpdateCmd())
|
cmd.AddCommand(newUpCmd())
|
||||||
cmd.AddCommand(newVersionCmd())
|
cmd.AddCommand(newVersionCmd())
|
||||||
cmd.AddCommand(newWhoAmICmd())
|
cmd.AddCommand(newWhoAmICmd())
|
||||||
|
|
||||||
|
|
|
@ -25,7 +25,7 @@ import (
|
||||||
"github.com/pulumi/pulumi/pkg/util/cmdutil"
|
"github.com/pulumi/pulumi/pkg/util/cmdutil"
|
||||||
)
|
)
|
||||||
|
|
||||||
func newUpdateCmd() *cobra.Command {
|
func newUpCmd() *cobra.Command {
|
||||||
var debug bool
|
var debug bool
|
||||||
var expectNop bool
|
var expectNop bool
|
||||||
var message string
|
var message string
|
||||||
|
@ -43,20 +43,20 @@ func newUpdateCmd() *cobra.Command {
|
||||||
var yes bool
|
var yes bool
|
||||||
|
|
||||||
var cmd = &cobra.Command{
|
var cmd = &cobra.Command{
|
||||||
Use: "update",
|
Use: "up",
|
||||||
Aliases: []string{"up"},
|
Aliases: []string{"update"},
|
||||||
SuggestFor: []string{"deploy", "push"},
|
SuggestFor: []string{"deploy", "push"},
|
||||||
Short: "Update the resources in a stack",
|
Short: "Create or update the resources in a stack",
|
||||||
Long: "Update the resources in a stack.\n" +
|
Long: "Create or update the resources in a stack.\n" +
|
||||||
"\n" +
|
"\n" +
|
||||||
"This command updates an existing stack whose state is represented by the existing checkpoint\n" +
|
"This command creates or updates resources in a stack. The new desired goal state for the target stack\n" +
|
||||||
"file. The new desired state is computed by running a Pulumi program, and extracting all resource\n" +
|
"is computed by running the current Pulumi program and observing all resource allocations to produce a\n" +
|
||||||
"allocations from its resulting object graph. These allocations are then compared against the\n" +
|
"resource graph. This goal state is then compared against the existing state to determine what create,\n" +
|
||||||
"existing state to determine what operations must take place to achieve the desired state. This\n" +
|
"read, update, and/or delete operations must take place to achieve the desired goal state, in the most\n" +
|
||||||
"command results in a checkpoint containing a full snapshot of the stack's new resource state, so\n" +
|
"minimally disruptive way. This command records a full transactional snapshot of the stack's new state\n" +
|
||||||
"that it may be updated incrementally again later.\n" +
|
"afterwards so that the stack may be updated incrementally again later on.\n" +
|
||||||
"\n" +
|
"\n" +
|
||||||
"The program to run is loaded from the project in the current directory. Use the `-C` or\n" +
|
"The program to run is loaded from the project in the current directory by default. Use the `-C` or\n" +
|
||||||
"`--cwd` flag to use a different directory.",
|
"`--cwd` flag to use a different directory.",
|
||||||
Args: cmdutil.NoArgs,
|
Args: cmdutil.NoArgs,
|
||||||
Run: cmdutil.RunFunc(func(cmd *cobra.Command, args []string) error {
|
Run: cmdutil.RunFunc(func(cmd *cobra.Command, args []string) error {
|
|
@ -674,7 +674,7 @@ func (pt *programTester) previewAndUpdate(dir string, name string, shouldFail, e
|
||||||
expectNopUpdate bool) error {
|
expectNopUpdate bool) error {
|
||||||
|
|
||||||
preview := []string{"preview", "--non-interactive"}
|
preview := []string{"preview", "--non-interactive"}
|
||||||
update := []string{"update", "--non-interactive", "--skip-preview"}
|
update := []string{"up", "--non-interactive", "--skip-preview"}
|
||||||
if pt.opts.GetDebugUpdates() {
|
if pt.opts.GetDebugUpdates() {
|
||||||
preview = append(preview, "-d")
|
preview = append(preview, "-d")
|
||||||
update = append(update, "-d")
|
update = append(update, "-d")
|
||||||
|
|
|
@ -67,7 +67,7 @@ func TestProjectMain(t *testing.T) {
|
||||||
e.ImportDirectory("project_main_abs")
|
e.ImportDirectory("project_main_abs")
|
||||||
e.RunCommand("pulumi", "login", "--cloud-url", e.LocalURL())
|
e.RunCommand("pulumi", "login", "--cloud-url", e.LocalURL())
|
||||||
e.RunCommand("pulumi", "stack", "init", "main-abs")
|
e.RunCommand("pulumi", "stack", "init", "main-abs")
|
||||||
stdout, stderr := e.RunCommandExpectError("pulumi", "update", "--non-interactive", "--skip-preview", "--yes")
|
stdout, stderr := e.RunCommandExpectError("pulumi", "up", "--non-interactive", "--skip-preview", "--yes")
|
||||||
assert.Equal(t, "", stdout)
|
assert.Equal(t, "", stdout)
|
||||||
assert.Contains(t, stderr, "project 'main' must be a relative path")
|
assert.Contains(t, stderr, "project 'main' must be a relative path")
|
||||||
e.RunCommand("pulumi", "stack", "rm", "--yes")
|
e.RunCommand("pulumi", "stack", "rm", "--yes")
|
||||||
|
@ -83,7 +83,7 @@ func TestProjectMain(t *testing.T) {
|
||||||
e.ImportDirectory("project_main_parent")
|
e.ImportDirectory("project_main_parent")
|
||||||
e.RunCommand("pulumi", "login", "--cloud-url", e.LocalURL())
|
e.RunCommand("pulumi", "login", "--cloud-url", e.LocalURL())
|
||||||
e.RunCommand("pulumi", "stack", "init", "main-parent")
|
e.RunCommand("pulumi", "stack", "init", "main-parent")
|
||||||
stdout, stderr := e.RunCommandExpectError("pulumi", "update", "--non-interactive", "--skip-preview", "--yes")
|
stdout, stderr := e.RunCommandExpectError("pulumi", "up", "--non-interactive", "--skip-preview", "--yes")
|
||||||
assert.Equal(t, "", stdout)
|
assert.Equal(t, "", stdout)
|
||||||
assert.Contains(t, stderr, "project 'main' must be a subfolder")
|
assert.Contains(t, stderr, "project 'main' must be a subfolder")
|
||||||
e.RunCommand("pulumi", "stack", "rm", "--yes")
|
e.RunCommand("pulumi", "stack", "rm", "--yes")
|
||||||
|
|
|
@ -233,7 +233,7 @@ func TestStackBackups(t *testing.T) {
|
||||||
|
|
||||||
// Now run pulumi update.
|
// Now run pulumi update.
|
||||||
before := time.Now().UnixNano()
|
before := time.Now().UnixNano()
|
||||||
e.RunCommand("pulumi", "update", "--non-interactive", "--skip-preview", "--yes")
|
e.RunCommand("pulumi", "up", "--non-interactive", "--skip-preview", "--yes")
|
||||||
after := time.Now().UnixNano()
|
after := time.Now().UnixNano()
|
||||||
|
|
||||||
// Verify the backup directory contains a single backup.
|
// Verify the backup directory contains a single backup.
|
||||||
|
|
Loading…
Reference in a new issue