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

Re-implement UseLocalStackOnly feature #674

Closed
EronWright opened this issue Sep 20, 2024 · 3 comments
Closed

Re-implement UseLocalStackOnly feature #674

EronWright opened this issue Sep 20, 2024 · 3 comments
Assignees
Labels
kind/task Work that's part of an ongoing epic resolution/fixed This issue was fixed
Milestone

Comments

@EronWright
Copy link
Contributor

The Stack has a feature UseLocalStackOnly that, if true, prevents the system from creating new stacks in the backend. See #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.

@EronWright EronWright converted this from a draft issue Sep 20, 2024
@cleverguy25
Copy link

Added to epic #586

@pulumi-bot pulumi-bot added the needs-triage Needs attention from the triage team label Sep 20, 2024
@rquitales rquitales removed the needs-triage Needs attention from the triage team label Sep 21, 2024
@mikhailshilkov mikhailshilkov added the kind/task Work that's part of an ongoing epic label Sep 23, 2024
@blampe blampe added this to the 0.111 milestone Oct 1, 2024
@rquitales
Copy link
Member

This feature is already implemented and initialization will fail.

This is where we create the Workspace object:

wss := &autov1alpha1.WorkspaceStack{
Name: sess.stack.Stack,
Create: ptr.To(!sess.stack.UseLocalStackOnly),
}

Where the workspace controller talks to the agent:

l.V(1).Info("Creating or selecting a stack",
"create", stack.Create, "secretsProvider", stack.SecretsProvider)
if _, err = wc.SelectStack(ctx, &agentpb.SelectStackRequest{
StackName: stack.Name,
Create: stack.Create,
SecretsProvider: stack.SecretsProvider,

In the agent code where we do not create the stack if it doesn't exist:

func (s *Server) SelectStack(ctx context.Context, in *pb.SelectStackRequest) (*pb.SelectStackResult, error) {
if in.StackName == "" {
return nil, status.Error(codes.InvalidArgument, "invalid stack name")
}
stack, err := func() (auto.Stack, error) {
stack, err := auto.SelectStack(ctx, in.StackName, s.ws)
if err != nil {
if auto.IsSelectStack404Error(err) {
if !in.GetCreate() {
return auto.Stack{}, status.Error(codes.NotFound, "stack not found")
}
return auto.NewStack(ctx, in.StackName, s.ws)

I have manually tested that this feature works.

@pulumi-bot pulumi-bot reopened this Oct 14, 2024
@github-project-automation github-project-automation bot moved this from In Progress to Done in Pulumi Kubernetes Operator v2 Oct 14, 2024
@pulumi-bot
Copy link
Contributor

Cannot close issue:

  • does not have required labels: resolution/

Please fix these problems and try again.

@cleverguy25 cleverguy25 closed this as completed by moving to Done in Pulumi Kubernetes Operator v2 Oct 14, 2024
@rquitales rquitales added the resolution/fixed This issue was fixed label Oct 14, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
kind/task Work that's part of an ongoing epic resolution/fixed This issue was fixed
Projects
No open projects
Status: Done
Development

No branches or pull requests

6 participants