Skip to content

Commit

Permalink
Merge pull request #1075 from rsteube/pulumi-updates
Browse files Browse the repository at this point in the history
pulumi: updates from v3.31.0
  • Loading branch information
rsteube authored Apr 30, 2022
2 parents 36a67d4 + b2568cb commit 8fbb679
Show file tree
Hide file tree
Showing 8 changed files with 73 additions and 16 deletions.
9 changes: 5 additions & 4 deletions completers/pulumi_completer/cmd/destroy.go
Original file line number Diff line number Diff line change
Expand Up @@ -7,9 +7,10 @@ import (
)

var destroyCmd = &cobra.Command{
Use: "destroy",
Short: "Destroy an existing stack and its resources",
Run: func(cmd *cobra.Command, args []string) {},
Use: "destroy",
Short: "Destroy an existing stack and its resources",
Aliases: []string{"down"},
Run: func(cmd *cobra.Command, args []string) {},
}

func init() {
Expand All @@ -31,7 +32,7 @@ func init() {
destroyCmd.PersistentFlags().StringP("stack", "s", "", "The name of the stack to operate on. Defaults to the current stack")
destroyCmd.PersistentFlags().Bool("suppress-outputs", false, "Suppress display of stack outputs (in case they contain sensitive values)")
destroyCmd.PersistentFlags().String("suppress-permalink", "", "Suppress display of the state permalink")
destroyCmd.PersistentFlags().StringArrayP("target", "t", []string{}, "Specify a single resource URN to destroy. All resources necessary to destroy this target will also be destroyed. Multiple resources can be specified using: --target urn1 --target urn2")
destroyCmd.PersistentFlags().StringArrayP("target", "t", []string{}, "Specify a single resource URN to destroy. All resources necessary to destroy this target will also be destroyed. Multiple resources can be specified using: --target urn1 --target urn2. Wildcards (*, **) are also supported")
destroyCmd.PersistentFlags().Bool("target-dependents", false, "Allows destroying of dependent targets discovered but not specified in --target list")
destroyCmd.PersistentFlags().BoolP("yes", "y", false, "Automatically approve and perform the destroy after previewing it")
destroyCmd.Flag("refresh").NoOptDefVal = "true"
Expand Down
2 changes: 2 additions & 0 deletions completers/pulumi_completer/cmd/help.go
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
package cmd

import (
"github.com/rsteube/carapace"
"github.com/spf13/cobra"
)

Expand All @@ -11,5 +12,6 @@ var helpCmd = &cobra.Command{
}

func init() {
carapace.Gen(helpCmd).Standalone()
rootCmd.AddCommand(helpCmd)
}
2 changes: 2 additions & 0 deletions completers/pulumi_completer/cmd/import.go
Original file line number Diff line number Diff line change
Expand Up @@ -20,10 +20,12 @@ func init() {
importCmd.PersistentFlags().String("exec-agent", "", "")
importCmd.PersistentFlags().String("exec-kind", "", "")
importCmd.PersistentFlags().StringP("file", "f", "", "The path to a JSON-encoded file containing a list of resources to import")
importCmd.PersistentFlags().Bool("generate-code", true, "Generate resource declaration code for the imported resources")
importCmd.PersistentFlags().StringP("message", "m", "", "Optional message to associate with the update operation")
importCmd.PersistentFlags().StringP("out", "o", "", "The path to the file that will contain the generated resource declarations")
importCmd.PersistentFlags().IntP("parallel", "p", 2147483647, "Allow P resource operations to run in parallel at once (1 for no parallelism). Defaults to unbounded.")
importCmd.PersistentFlags().String("parent", "", "The name and URN of the parent resource in the format name=urn, where name is the variable name of the parent resource")
importCmd.PersistentFlags().StringSlice("properties", []string{}, "The property names to use for the import in the format name1,name2")
importCmd.PersistentFlags().Bool("protect", true, "Allow resources to be imported with protection from deletion enabled")
importCmd.PersistentFlags().String("provider", "", "The name and URN of the provider to use for the import in the format name=urn, where name is the variable name for the provider resource")
importCmd.PersistentFlags().Bool("skip-preview", false, "Do not perform a preview before performing the refresh")
Expand Down
12 changes: 8 additions & 4 deletions completers/pulumi_completer/cmd/preview.go
Original file line number Diff line number Diff line change
Expand Up @@ -7,9 +7,10 @@ import (
)

var previewCmd = &cobra.Command{
Use: "preview",
Short: "Show a preview of updates to a stack's resources",
Run: func(cmd *cobra.Command, args []string) {},
Use: "preview",
Short: "Show a preview of updates to a stack's resources",
Aliases: []string{"pre"},
Run: func(cmd *cobra.Command, args []string) {},
}

func init() {
Expand All @@ -30,10 +31,12 @@ func init() {
previewCmd.PersistentFlags().StringSlice("policy-pack-config", []string{}, "Path to JSON file containing the config for the policy pack of the corresponding \"--policy-pack\" flag")
previewCmd.PersistentFlags().StringP("refresh", "r", "", "Refresh the state of the stack's resources before this update")
previewCmd.PersistentFlags().StringArray("replace", []string{}, "Specify resources to replace. Multiple resources can be specified using --replace urn1 --replace urn2")
previewCmd.PersistentFlags().String("save-plan", "", "[EXPERIMENTAL] Save the operations proposed by the preview to a plan file at the given path")
previewCmd.PersistentFlags().Bool("show-config", false, "Show configuration keys and variables")
previewCmd.PersistentFlags().Bool("show-reads", false, "Show resources that are being read in, alongside those being managed directly in the stack")
previewCmd.PersistentFlags().Bool("show-replacement-steps", false, "Show detailed resource replacement creates and deletes instead of a single step")
previewCmd.PersistentFlags().Bool("show-sames", false, "Show resources that needn't be updated because they haven't changed, alongside those that do")
previewCmd.Flags().Bool("show-secrets", false, "Emit secrets in plaintext in the plan file. Defaults to `false`")
previewCmd.PersistentFlags().StringP("stack", "s", "", "The name of the stack to operate on. Defaults to the current stack")
previewCmd.PersistentFlags().Bool("suppress-outputs", false, "Suppress display of stack outputs (in case they contain sensitive values)")
previewCmd.PersistentFlags().String("suppress-permalink", "", "Suppress display of the state permalink")
Expand All @@ -49,7 +52,8 @@ func init() {
"replace": carapace.ActionCallback(func(c carapace.Context) carapace.Action {
return action.ActionUrns(previewCmd)
}),
"stack": action.ActionStacks(previewCmd, action.StackOpts{}),
"save-plan": carapace.ActionFiles(),
"stack": action.ActionStacks(previewCmd, action.StackOpts{}),
"target": carapace.ActionCallback(func(c carapace.Context) carapace.Action {
return action.ActionUrns(previewCmd)
}),
Expand Down
7 changes: 4 additions & 3 deletions completers/pulumi_completer/cmd/stack_history.go
Original file line number Diff line number Diff line change
Expand Up @@ -6,9 +6,10 @@ import (
)

var stack_historyCmd = &cobra.Command{
Use: "history",
Short: "[PREVIEW] Display history for a stack",
Run: func(cmd *cobra.Command, args []string) {},
Use: "history",
Short: "[PREVIEW] Display history for a stack",
Aliases: []string{"hist"},
Run: func(cmd *cobra.Command, args []string) {},
}

func init() {
Expand Down
17 changes: 17 additions & 0 deletions completers/pulumi_completer/cmd/stack_unselect.go
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
package cmd

import (
"github.com/rsteube/carapace"
"github.com/spf13/cobra"
)

var stack_unselectCmd = &cobra.Command{
Use: "unselect",
Short: "Resets stack selection from the current workspace",
Run: func(cmd *cobra.Command, args []string) {},
}

func init() {
carapace.Gen(stack_unselectCmd).Standalone()
stackCmd.AddCommand(stack_unselectCmd)
}
28 changes: 28 additions & 0 deletions completers/pulumi_completer/cmd/state_rename.go
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
package cmd

import (
"github.com/rsteube/carapace"
"github.com/rsteube/carapace-bin/completers/pulumi_completer/cmd/action"
"github.com/spf13/cobra"
)

var state_renameCmd = &cobra.Command{
Use: "rename",
Short: "Renames a resource from a stack's state",
Run: func(cmd *cobra.Command, args []string) {},
}

func init() {
carapace.Gen(state_renameCmd).Standalone()
state_renameCmd.PersistentFlags().StringP("stack", "s", "", "The name of the stack to operate on. Defaults to the current stack")
state_renameCmd.Flags().BoolP("yes", "y", false, "Skip confirmation prompts")
stateCmd.AddCommand(state_renameCmd)

carapace.Gen(state_renameCmd).FlagCompletion(carapace.ActionMap{
"stack": action.ActionStacks(state_renameCmd, action.StackOpts{All: true}),
})

carapace.Gen(state_renameCmd).PositionalCompletion(
action.ActionUrns(state_renameCmd),
)
}
12 changes: 7 additions & 5 deletions completers/pulumi_completer/cmd/up.go
Original file line number Diff line number Diff line change
Expand Up @@ -7,9 +7,10 @@ import (
)

var upCmd = &cobra.Command{
Use: "up",
Short: "Create or update the resources in a stack",
Run: func(cmd *cobra.Command, args []string) {},
Use: "up",
Short: "Create or update the resources in a stack",
Aliases: []string{"update"},
Run: func(cmd *cobra.Command, args []string) {},
}

func init() {
Expand All @@ -26,10 +27,11 @@ func init() {
upCmd.Flags().BoolP("json", "j", false, "Serialize the update diffs, operations, and overall output as JSON")
upCmd.PersistentFlags().StringP("message", "m", "", "Optional message to associate with the update operation")
upCmd.PersistentFlags().IntP("parallel", "p", 2147483647, "Allow P resource operations to run in parallel at once (1 for no parallelism). Defaults to unbounded.")
upCmd.PersistentFlags().String("plan", "", "[EXPERIMENTAL] Path to a plan file to use for the update. The update will not perform operations that exceed its plan (e.g. replacements instead of updates, or updates insteadof sames).")
upCmd.PersistentFlags().StringSlice("policy-pack", []string{}, "Run one or more policy packs as part of this update")
upCmd.PersistentFlags().StringSlice("policy-pack-config", []string{}, "Path to JSON file containing the config for the policy pack of the corresponding \"--policy-pack\" flag")
upCmd.PersistentFlags().StringP("refresh", "r", "", "Refresh the state of the stack's resources before this update")
upCmd.PersistentFlags().StringArray("replace", []string{}, "Specify resources to replace. Multiple resources can be specified using --replace urn1 --replace urn2")
upCmd.PersistentFlags().StringArray("replace", []string{}, "Specify resources to replace. Multiple resources can be specified using --replace urn1 --replace urn2. Wildcards (*, **) are also supported")
upCmd.PersistentFlags().String("secrets-provider", "default", "The type of the provider that should be used to encrypt and decrypt secrets (possible choices: default, passphrase, awskms, azurekeyvault, gcpkms, hashivault). Onlyused when creating a new stack from an existing template")
upCmd.PersistentFlags().Bool("show-config", false, "Show configuration keys and variables")
upCmd.PersistentFlags().Bool("show-reads", false, "Show resources that are being read in, alongside those being managed directly in the stack")
Expand All @@ -39,7 +41,7 @@ func init() {
upCmd.PersistentFlags().StringP("stack", "s", "", "The name of the stack to operate on. Defaults to the current stack")
upCmd.PersistentFlags().Bool("suppress-outputs", false, "Suppress display of stack outputs (in case they contain sensitive values)")
upCmd.PersistentFlags().String("suppress-permalink", "", "Suppress display of the state permalink")
upCmd.PersistentFlags().StringArrayP("target", "t", []string{}, "Specify a single resource URN to update. Other resources will not be updated. Multiple resources can be specified using --target urn1 --target urn2")
upCmd.PersistentFlags().StringArrayP("target", "t", []string{}, "Specify a single resource URN to update. Other resources will not be updated. Multiple resources can be specified using --target urn1 --target urn2. Wildcards (*, **) are also supported")
upCmd.PersistentFlags().Bool("target-dependents", false, "Allows updating of dependent targets discovered but not specified in --target list")
upCmd.PersistentFlags().StringArray("target-replace", []string{}, "Specify a single resource URN to replace. Other resources will not be updated. Shorthand for --target urn --replace urn.")
upCmd.PersistentFlags().BoolP("yes", "y", false, "Automatically approve and perform the update after previewing it")
Expand Down

0 comments on commit 8fbb679

Please sign in to comment.