Skip to content

Commit 5d9480c

Browse files
authored
feat: add SecretStore field for GeneratorRequest (#1284)
1 parent c8b4a0c commit 5d9480c

File tree

4 files changed

+61
-26
lines changed

4 files changed

+61
-26
lines changed

pkg/modules/generators/app_configurations_generator.go

+7-1
Original file line numberDiff line numberDiff line change
@@ -585,7 +585,7 @@ func getModuleName(accessory v1.Accessory) (string, error) {
585585
}
586586

587587
func (g *appConfigurationGenerator) initModuleRequest(config moduleConfig) (*proto.GeneratorRequest, error) {
588-
var workloadConfig, devConfig, platformConfig, ctx []byte
588+
var workloadConfig, secretStoreConfig, devConfig, platformConfig, ctx []byte
589589
var err error
590590
// Attention: we MUST yaml.v2 to serialize the object,
591591
// because we have introduced MapSlice in the Workload which is supported only in the yaml.v2
@@ -594,6 +594,11 @@ func (g *appConfigurationGenerator) initModuleRequest(config moduleConfig) (*pro
594594
return nil, fmt.Errorf("marshal workload config failed. %w", err)
595595
}
596596
}
597+
if g.ws.SecretStore != nil {
598+
if secretStoreConfig, err = yamlv2.Marshal(g.ws.SecretStore); err != nil {
599+
return nil, fmt.Errorf("marshal secret store config failed. %w", err)
600+
}
601+
}
597602
if config.devConfig != nil {
598603
if devConfig, err = yaml.Marshal(config.devConfig); err != nil {
599604
return nil, fmt.Errorf("marshal dev module config failed. %w", err)
@@ -618,6 +623,7 @@ func (g *appConfigurationGenerator) initModuleRequest(config moduleConfig) (*pro
618623
DevConfig: devConfig,
619624
PlatformConfig: platformConfig,
620625
Context: ctx,
626+
SecretStore: secretStoreConfig,
621627
}
622628
return protoRequest, nil
623629
}

pkg/modules/proto/module.pb.go

+27-16
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

pkg/modules/proto/module.proto

+2
Original file line numberDiff line numberDiff line change
@@ -17,6 +17,8 @@ message GeneratorRequest {
1717
bytes platform_config = 6;
1818
// context contains workspace-level configurations, such as topologies, server endpoints, metadata, etc.
1919
bytes context = 7;
20+
// SecretStore represents a secure external location for storing secrets.
21+
bytes secret_store = 8;
2022
}
2123

2224
// GeneratorResponse represents the generate result of the generator.

pkg/modules/proto/module_grpc.pb.go

+25-9
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

0 commit comments

Comments
 (0)