pulumi / pulumi-kubernetes-operator

A Kubernetes Operator that automates the deployment of Pulumi Stacks
Apache License 2.0
226 stars 54 forks source link

Re-implement UseLocalStackOnly feature #674

Closed EronWright closed 1 month ago

EronWright commented 2 months ago

The Stack has a feature UseLocalStackOnly that, if true, prevents the system from creating new stacks in the backend. See https://github.com/pulumi/pulumi-kubernetes-operator/pull/186.

The Workspace API has a stacks field to populate the workspace with stacks, and invokes the RPC layer to upsert each stack. Seems we must plumb a flag to support this.

cleverguy25 commented 2 months ago

Added to epic https://github.com/pulumi/pulumi-kubernetes-operator/issues/586

rquitales commented 1 month ago

This feature is already implemented and initialization will fail.

This is where we create the Workspace object: https://github.com/pulumi/pulumi-kubernetes-operator/blob/d52dbe79ad0c3ea3110cc2c96f4afd47edd84347/operator/internal/controller/pulumi/stack_controller.go#L1165-L1168

Where the workspace controller talks to the agent: https://github.com/pulumi/pulumi-kubernetes-operator/blob/d52dbe79ad0c3ea3110cc2c96f4afd47edd84347/operator/internal/controller/auto/workspace_controller.go#L256-L261

In the agent code where we do not create the stack if it doesn't exist: https://github.com/pulumi/pulumi-kubernetes-operator/blob/d52dbe79ad0c3ea3110cc2c96f4afd47edd84347/agent/pkg/server/server.go#L186-L197

I have manually tested that this feature works.

pulumi-bot commented 1 month ago

Cannot close issue:

Please fix these problems and try again.