@@ -12,7 +12,6 @@ import (
1212 "sigs.k8s.io/kustomize/api/krusty"
1313 "sigs.k8s.io/kustomize/kyaml/filesys"
1414
15- "github.com/openmcp-project/bootstrapper/internal/common"
1615 cfg "github.com/openmcp-project/bootstrapper/internal/config"
1716 ocmcli "github.com/openmcp-project/bootstrapper/internal/ocm-cli"
1817 "github.com/openmcp-project/bootstrapper/internal/template"
@@ -104,7 +103,7 @@ func (d *FluxDeployer) Deploy(ctx context.Context) (err error) {
104103 return err
105104 }
106105
107- d .fluxcdCV , err = componentGetter .GetComponentVersionForResourceRecursive (ctx , componentGetter .RootComponentVersion (), common . FluxCDSourceControllerResourceName )
106+ d .fluxcdCV , err = componentGetter .GetComponentVersionForResourceRecursive (ctx , componentGetter .RootComponentVersion (), FluxCDSourceControllerResourceName )
108107 if err != nil {
109108 return fmt .Errorf ("failed to get fluxcd source controller component version: %w" , err )
110109 }
@@ -126,7 +125,7 @@ func (d *FluxDeployer) Deploy(ctx context.Context) (err error) {
126125 }
127126
128127 // Kustomize <workdir>/repo/envs/<envName>/fluxcd
129- fluxCDEnvDir := filepath .Join (d .repoDir , common . EnvsDirectoryName , d .Config .Environment , common . FluxCDDirectoryName )
128+ fluxCDEnvDir := filepath .Join (d .repoDir , EnvsDirectoryName , d .Config .Environment , FluxCDDirectoryName )
130129 manifests , err := d .Kustomize (fluxCDEnvDir )
131130 if err != nil {
132131 return fmt .Errorf ("error kustomizing templated files: %w" , err )
@@ -146,14 +145,14 @@ func (d *FluxDeployer) ArrangeTemplates() (err error) {
146145 d .log .Info ("Arranging template files" )
147146
148147 // Create directory <templatesDir>/envs/<envName>/fluxcd
149- fluxCDEnvDir := filepath .Join (d .templatesDir , common . EnvsDirectoryName , d .Config .Environment , common . FluxCDDirectoryName )
148+ fluxCDEnvDir := filepath .Join (d .templatesDir , EnvsDirectoryName , d .Config .Environment , FluxCDDirectoryName )
150149 err = os .MkdirAll (fluxCDEnvDir , 0755 )
151150 if err != nil {
152151 return fmt .Errorf ("failed to create fluxcd environment directory: %w" , err )
153152 }
154153
155154 // Create directory <templatesDir>/resources/fluxcd
156- fluxCDResourcesDir := filepath .Join (d .templatesDir , common . ResourcesDirectoryName , common . FluxCDDirectoryName )
155+ fluxCDResourcesDir := filepath .Join (d .templatesDir , ResourcesDirectoryName , FluxCDDirectoryName )
157156 err = os .MkdirAll (fluxCDResourcesDir , 0755 )
158157 if err != nil {
159158 return fmt .Errorf ("failed to create fluxcd resources directory: %w" , err )
@@ -162,13 +161,13 @@ func (d *FluxDeployer) ArrangeTemplates() (err error) {
162161 d .log .Debug ("Copying template files to target directories" )
163162
164163 // copy all files from <downloadDir>/templates/overlays to <templatesDir>/envs/<envName>/fluxcd
165- err = util .CopyDir (filepath .Join (d .downloadDir , common . TemplatesDirectoryName , common . OverlaysDirectoryName ), fluxCDEnvDir )
164+ err = util .CopyDir (filepath .Join (d .downloadDir , TemplatesDirectoryName , OverlaysDirectoryName ), fluxCDEnvDir )
166165 if err != nil {
167166 return fmt .Errorf ("failed to copy fluxcd overlays: %w" , err )
168167 }
169168
170169 // copy all files from <downloadDir>/templates/resources to <templatesDir>/resources/fluxcd
171- err = util .CopyDir (filepath .Join (d .downloadDir , common . TemplatesDirectoryName , common . ResourcesDirectoryName ), fluxCDResourcesDir )
170+ err = util .CopyDir (filepath .Join (d .downloadDir , TemplatesDirectoryName , ResourcesDirectoryName ), fluxCDResourcesDir )
172171 if err != nil {
173172 return fmt .Errorf ("failed to copy fluxcd resources: %w" , err )
174173 }
@@ -181,15 +180,15 @@ func (d *FluxDeployer) ArrangeTemplates() (err error) {
181180// The resulting files are written to the repo directory.
182181func (d * FluxDeployer ) Template () (err error ) {
183182 d .log .Infof ("Applying templates from %s to deployment repository" , d .Config .Component .FluxcdTemplateResourcePath )
184- templateInput := common . NewTemplateInputFromConfig (d .Config )
183+ templateInput := NewTemplateInputFromConfig (d .Config )
185184
186- if err = templateInput .AddImageResource (d .fluxcdCV , common . FluxCDSourceControllerResourceName , "sourceController" ); err != nil {
185+ if err = templateInput .AddImageResource (d .fluxcdCV , FluxCDSourceControllerResourceName , "sourceController" ); err != nil {
187186 return fmt .Errorf ("failed to apply fluxcd source controller template input: %w" , err )
188187 }
189- if err = templateInput .AddImageResource (d .fluxcdCV , common . FluxCDKustomizationControllerResourceName , "kustomizeController" ); err != nil {
188+ if err = templateInput .AddImageResource (d .fluxcdCV , FluxCDKustomizationControllerResourceName , "kustomizeController" ); err != nil {
190189 return fmt .Errorf ("failed to apply fluxcd kustomize controller template input: %w" , err )
191190 }
192- if err = templateInput .AddImageResource (d .fluxcdCV , common . FluxCDHelmControllerResourceName , "helmController" ); err != nil {
191+ if err = templateInput .AddImageResource (d .fluxcdCV , FluxCDHelmControllerResourceName , "helmController" ); err != nil {
193192 return fmt .Errorf ("failed to apply fluxcd helm controller template input: %w" , err )
194193 }
195194
0 commit comments