Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Replace a type used by the service #15216

Merged
merged 1 commit into from Jan 23, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
@@ -0,0 +1,4 @@
changes:
- type: fix
scope: sdk/go
description: Replace a deleted type used by Pulumi Cloud code.
4 changes: 2 additions & 2 deletions pkg/backend/filestate/backend.go
Expand Up @@ -1036,8 +1036,8 @@ func (b *localBackend) apply(
_, changes, updateErr = engine.Refresh(update, engineCtx, op.Opts.Engine, opts.DryRun)
case apitype.DestroyUpdate:
_, changes, updateErr = engine.Destroy(update, engineCtx, op.Opts.Engine, opts.DryRun)
case apitype.StackImportUpdate:
contract.Failf("unexpected stack import event")
case apitype.StackImportUpdate, apitype.RenameUpdate:
contract.Failf("unexpected %s event", kind)
default:
contract.Failf("Unrecognized update kind: %s", kind)
}
Expand Down
4 changes: 2 additions & 2 deletions pkg/backend/httpstate/backend.go
Expand Up @@ -1358,8 +1358,8 @@ func (b *cloudBackend) runEngineAction(
_, changes, updateErr = engine.Refresh(u, engineCtx, op.Opts.Engine, dryRun)
case apitype.DestroyUpdate:
_, changes, updateErr = engine.Destroy(u, engineCtx, op.Opts.Engine, dryRun)
case apitype.StackImportUpdate:
contract.Failf("unexpected stack import event")
case apitype.StackImportUpdate, apitype.RenameUpdate:
contract.Failf("unexpected %s event", kind)
default:
contract.Failf("Unrecognized update kind: %s", kind)
}
Expand Down
4 changes: 2 additions & 2 deletions pkg/backend/httpstate/client/client.go
Expand Up @@ -642,8 +642,8 @@ func (pc *Client) CreateUpdate(
endpoint = "refresh"
case apitype.DestroyUpdate:
endpoint = "destroy"
case apitype.StackImportUpdate:
contract.Failf("Stack import updates are not supported")
case apitype.StackImportUpdate, apitype.RenameUpdate:
contract.Failf("%s updates are not supported", kind)
default:
contract.Failf("Unknown kind: %s", kind)
}
Expand Down
3 changes: 3 additions & 0 deletions sdk/go/common/apitype/history.go
Expand Up @@ -29,6 +29,9 @@ const (
PreviewUpdate UpdateKind = "preview"
// RefreshUpdate is an update that came from a refresh operation.
RefreshUpdate UpdateKind = "refresh"
// RenameUpdate is an update that changes the stack name or project name of a Pulumi program.
// NOTE: Do not remove this type - it is used by Pulumi Cloud code.
RenameUpdate UpdateKind = "rename"
// DestroyUpdate is an update which removes all resources.
DestroyUpdate UpdateKind = "destroy"
// StackImportUpdate is an update that entails importing a raw checkpoint file.
Expand Down