Skip to content

feat: clean stale provisioner files #9545

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

Merged
merged 27 commits into from
Sep 11, 2023
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Next Next commit
TODOs
  • Loading branch information
mtojek committed Sep 5, 2023
commit 277d7c25a8bc846c29f68f43ce78187f67f031b5
2 changes: 2 additions & 0 deletions provisioner/terraform/provision.go
Original file line number Diff line number Diff line change
Expand Up @@ -89,6 +89,8 @@ func (s *server) Plan(
}
}

// TODO Clean stale TF files

s.logger.Debug(ctx, "running initialization")
err := e.init(ctx, killCtx, sess)
if err != nil {
Expand Down
3 changes: 3 additions & 0 deletions provisionersdk/session.go
Original file line number Diff line number Diff line change
Expand Up @@ -35,6 +35,9 @@ func (p *protoServer) Session(stream proto.DRPCProvisioner_SessionStream) error
stream: stream,
server: p.server,
}

// TODO Clean stale sessions in WorkDir

sessDir := fmt.Sprintf("Session%s", sessID)
s.WorkDirectory = filepath.Join(p.opts.WorkDirectory, sessDir)
err := os.MkdirAll(s.WorkDirectory, 0o700)
Expand Down