Skip to content

Commit

Permalink
feat(agent): allow to specify stack versions over grpc
Browse files Browse the repository at this point in the history
  • Loading branch information
gfyrag committed Dec 18, 2023
1 parent 2780091 commit d7423ab
Show file tree
Hide file tree
Showing 3 changed files with 90 additions and 77 deletions.
18 changes: 10 additions & 8 deletions ee/agent/internal/grpc/client.go
Original file line number Diff line number Diff line change
Expand Up @@ -167,14 +167,16 @@ func (client *client) createStack(stack *generated.Stack) *v1beta3.Stack {
}
}

func (client *client) mergeStack(currentStack *v1beta3.Stack, createStack *v1beta3.Stack) *v1beta3.Stack {
createStack.SetResourceVersion(currentStack.GetResourceVersion())
createStack.Spec.Services = currentStack.Spec.Services
createStack.Spec.Seed = currentStack.Spec.Seed
createStack.Spec.Versions = currentStack.Spec.Versions
createStack.Spec.DevProperties.Debug = currentStack.Spec.DevProperties.Debug
createStack.Spec.DevProperties.Dev = currentStack.Spec.DevProperties.Dev
return createStack
func (client *client) mergeStack(currentStack *v1beta3.Stack, into *v1beta3.Stack) *v1beta3.Stack {
into.SetResourceVersion(currentStack.GetResourceVersion())
into.Spec.Services = currentStack.Spec.Services
into.Spec.Seed = currentStack.Spec.Seed
into.Spec.DevProperties.Debug = currentStack.Spec.DevProperties.Debug
into.Spec.DevProperties.Dev = currentStack.Spec.DevProperties.Dev
if into.Spec.Versions == "" {
into.Spec.Versions = currentStack.Spec.Versions
}
return into
}

func (client *client) Start(ctx context.Context) error {
Expand Down
148 changes: 79 additions & 69 deletions ee/agent/internal/grpc/generated/server.pb.go

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

1 change: 1 addition & 0 deletions ee/agent/server.proto
Original file line number Diff line number Diff line change
Expand Up @@ -53,6 +53,7 @@ message Stack {
StargateConfig stargateConfig = 5;
bool disabled = 6;
google.protobuf.Timestamp deletedAt = 7;
string versions = 8;
}

enum StackStatus {
Expand Down

0 comments on commit d7423ab

Please sign in to comment.