@@ -18,6 +18,7 @@ package v2beta29
18
18
19
19
import (
20
20
"encoding/json"
21
+ "fmt"
21
22
22
23
"github.com/pkg/errors"
23
24
@@ -87,6 +88,31 @@ func upgradeOnePipeline(oldPipeline, newPipeline interface{}) error {
87
88
newPL .Render .Helm .Releases = newHelm .Releases
88
89
newPL .Render .Helm .Flags = newHelm .Flags
89
90
91
+ // Copy over removed artifactOverrides & imageStrategy field as identical setValues fields
92
+ for i := 0 ; i < len (newPL .Render .Helm .Releases ); i ++ {
93
+ // need to append, not override
94
+ svs := map [string ]string (oldPL .Deploy .HelmDeploy .Releases [i ].SetValues )
95
+ aos := map [string ]string (oldPL .Deploy .HelmDeploy .Releases [i ].ArtifactOverrides )
96
+ if aos != nil && svs == nil {
97
+ svs = map [string ]string {}
98
+ }
99
+ // TODO(aaron-prindle) - upgrade currently only supports FQN image strategy, need to add: helm & helm+explicitRegistry
100
+ if oldPL .Deploy .HelmDeploy .Releases [i ].ImageStrategy .HelmConventionConfig != nil {
101
+ // is 'helm'
102
+ if oldPL .Deploy .HelmDeploy .Releases [i ].ImageStrategy .HelmConventionConfig .ExplicitRegistry {
103
+ // is 'helm' + explicitRegistry
104
+ return fmt .Errorf ("skaffold v2.0.0 binary w/ v3alpha1 schema does not support deploy.helm.imageStrategy=helm currently" )
105
+ }
106
+ return fmt .Errorf ("skaffold v2.0.0 binary w/ v3alpha1 schema does not support imageStrategy.helm.imageStrategy=helm currently" )
107
+ } else {
108
+ // is 'fqn'
109
+ for k , v := range aos {
110
+ svs [k ] = v
111
+ }
112
+ }
113
+ newPL .Render .Helm .Releases [i ].SetValues = svs
114
+ }
115
+
90
116
// Copy over lifecyle hooks for helm deployer
91
117
newPL .Deploy .LegacyHelmDeploy = & next.LegacyHelmDeploy {}
92
118
newPL .Deploy .LegacyHelmDeploy .LifecycleHooks = newHelm .LifecycleHooks
0 commit comments