Skip to content

Commit 4b621a5

Browse files
Mate Oryorymate
authored andcommitted
cp: remove legacy image support
1 parent 76b824b commit 4b621a5

File tree

1 file changed

+7
-23
lines changed
  • internal/cli/command/controlplane

1 file changed

+7
-23
lines changed

internal/cli/command/controlplane/up.go

Lines changed: 7 additions & 23 deletions
Original file line numberDiff line numberDiff line change
@@ -135,31 +135,15 @@ func runUp(options *createOptions, banzaiCli cli.Cli) error {
135135
}
136136

137137
source := "/export"
138-
139-
// for backward compatibility
140-
hasExports, err := imageFileExists(options.cpContext, source)
141-
if err != nil {
138+
var defaultValues map[string]interface{}
139+
exportHandlers := []ExportedFilesHandler{
140+
defaultValuesExporter(filepath.Join(strings.TrimPrefix(source, "/"), "values.yaml"), &defaultValues),
141+
}
142+
if err := processExports(options.cpContext, source, exportHandlers); err != nil {
142143
return err
143144
}
144-
145-
if hasExports {
146-
var defaultValues map[string]interface{}
147-
exportHandlers := []ExportedFilesHandler{
148-
defaultValuesExporter(filepath.Join(strings.TrimPrefix(source, "/"), "values.yaml"), &defaultValues),
149-
}
150-
if err := processExports(options.cpContext, source, exportHandlers); err != nil {
151-
return err
152-
}
153-
if err := writeMergedValues(options.cpContext, defaultValues, values); err != nil {
154-
return err
155-
}
156-
} else {
157-
log.Warnf("%s is not available in the image, skipping export handlers", source)
158-
// this is the legacy behaviour that should be removed as soon as we can deprecate old image versions
159-
// where the null_resource.preapply_hook did the merging
160-
if err := runTerraform("apply", options.cpContext, nil, "null_resource.preapply_hook"); err != nil {
161-
return errors.WrapIf(err, "failed to run null_resource.preapply_hook as a standalone target")
162-
}
145+
if err := writeMergedValues(options.cpContext, defaultValues, values); err != nil {
146+
return err
163147
}
164148

165149
var env map[string]string

0 commit comments

Comments
 (0)