Skip to content

Commit

Permalink
adapt module.go Run() conforming to the new flag
Browse files Browse the repository at this point in the history
  • Loading branch information
amritanshusikdar committed Mar 20, 2024
1 parent d71405e commit 5966a2e
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 10 deletions.
4 changes: 3 additions & 1 deletion cmd/kyma/alpha/create/module/module.go
Original file line number Diff line number Diff line change
Expand Up @@ -423,11 +423,13 @@ func (cmd *command) Run(cobraCmd *cobra.Command) error {
cmd.NewStep("Generating module template...")
var resourceName = ""
mandatoryModule := false
enableModuleConfig := false
var channel = cmd.opts.Channel
if modCnf != nil {
resourceName = modCnf.ResourceName
channel = modCnf.Channel
mandatoryModule = modCnf.Mandatory
enableModuleConfig = modCnf.EnableModuleConfig
}

var namespace = cmd.opts.Namespace
Expand All @@ -440,7 +442,7 @@ func (cmd *command) Run(cobraCmd *cobra.Command) error {
annotations := cmd.getModuleTemplateAnnotations(modCnf, crd)

template, err := module.Template(componentVersionAccess, resourceName, namespace,
channel, modDef.DefaultCR, labels, annotations, modDef.CustomStateChecks, mandatoryModule)
channel, modDef.DefaultCR, labels, annotations, modDef.CustomStateChecks, mandatoryModule, enableModuleConfig)
if err != nil {
cmd.CurrentStep.Failure()
return err
Expand Down
19 changes: 10 additions & 9 deletions pkg/module/template.go
Original file line number Diff line number Diff line change
Expand Up @@ -88,15 +88,16 @@ func Template(remote ocm.ComponentVersionAccess, moduleTemplateName, namespace,
resourceName = shortName + "-" + channel
}
td := moduleTemplateData{
ResourceName: resourceName,
Namespace: namespace,
Descriptor: cva,
Channel: channel,
Data: string(data),
Labels: labels,
Annotations: annotations,
CustomStateChecks: customsStateChecks,
Mandatory: mandatory,
ResourceName: resourceName,
Namespace: namespace,
Descriptor: cva,
Channel: channel,
Data: string(data),
Labels: labels,
Annotations: annotations,
CustomStateChecks: customsStateChecks,
Mandatory: mandatory,
EnableModuleConfig: enableModuleConfig,
}

t, err := template.New("modTemplate").Funcs(template.FuncMap{
Expand Down

0 comments on commit 5966a2e

Please sign in to comment.