Skip to content

Commit

Permalink
feat: delete runtime config in module proto (#970)
Browse files Browse the repository at this point in the history
  • Loading branch information
SparkYuan committed Mar 27, 2024
1 parent 97c6f0f commit 9d94eb0
Show file tree
Hide file tree
Showing 4 changed files with 14 additions and 34 deletions.
2 changes: 0 additions & 2 deletions docs/design/kusion_module/kusion_modules.md
Original file line number Diff line number Diff line change
Expand Up @@ -117,8 +117,6 @@ message GeneratorRequest {
bytes dev_module_config = 5;
// PlatformModuleConfig is the platform engineer's inputs of this module
bytes platform_module_config = 6;
// RuntimeConfig is the runtime configurations defined in the workspace
bytes runtime_config = 7;
}
// GeneratorResponse represents the generate result of the generator.
Expand Down
9 changes: 2 additions & 7 deletions pkg/modules/generators/app_configurations_generator.go
Original file line number Diff line number Diff line change
Expand Up @@ -390,7 +390,7 @@ func parseModuleKey(accessory v1.Accessory, dependencies *pkg.Dependencies) (str
}

func (g *appConfigurationGenerator) initModuleRequest(config moduleConfig) (*proto.GeneratorRequest, error) {
var workloadConfig, devConfig, platformConfig, runtimeConfig []byte
var workloadConfig, devConfig, platformConfig []byte
var err error
// Attention: we MUST yaml.v2 to serialize the object,
// because we have introduced MapSlice in the Workload which is supported only in the yaml.v2
Expand All @@ -409,19 +409,14 @@ func (g *appConfigurationGenerator) initModuleRequest(config moduleConfig) (*pro
return nil, fmt.Errorf("marshal platform module config failed. %w", err)
}
}
if g.ws.Runtimes != nil {
if runtimeConfig, err = yaml.Marshal(g.ws.Runtimes); err != nil {
return nil, fmt.Errorf("marshal runtime config failed. %w", err)
}
}

protoRequest := &proto.GeneratorRequest{
Project: g.project,
Stack: g.stack,
App: g.appName,
Workload: workloadConfig,
DevModuleConfig: devConfig,
PlatformModuleConfig: platformConfig,
RuntimeConfig: runtimeConfig,
}
return protoRequest, nil
}
Expand Down
35 changes: 12 additions & 23 deletions pkg/modules/proto/module.pb.go

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

2 changes: 0 additions & 2 deletions pkg/modules/proto/module.proto
Original file line number Diff line number Diff line change
Expand Up @@ -15,8 +15,6 @@ message GeneratorRequest {
bytes dev_module_config = 5;
// PlatformModuleConfig is the platform engineer's inputs of this module
bytes platform_module_config = 6;
// RuntimeConfig is the runtime configurations defined in the workspace
bytes runtime_config = 7;
}

// GeneratorResponse represents the generate result of the generator.
Expand Down

0 comments on commit 9d94eb0

Please sign in to comment.