@@ -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,32 @@ 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 .HelmFQNConfig != nil {
101
+ // is 'fqn'
102
+ for k , v := range aos {
103
+ svs [k ] = v
104
+ }
105
+ }
106
+ if oldPL .Deploy .HelmDeploy .Releases [i ].ImageStrategy .HelmConventionConfig != nil {
107
+ // is 'helm'
108
+ if oldPL .Deploy .HelmDeploy .Releases [i ].ImageStrategy .HelmConventionConfig .ExplicitRegistry {
109
+ // is 'helm' + explicitRegistry
110
+ return fmt .Errorf ("skaffold v3alpha does not support " )
111
+ }
112
+ return fmt .Errorf ("skaffold v3alpha does not support imageStrategy.helm" )
113
+ }
114
+ newPL .Render .Helm .Releases [i ].SetValues = svs
115
+ }
116
+
90
117
// Copy over lifecyle hooks for helm deployer
91
118
newPL .Deploy .LegacyHelmDeploy = & next.LegacyHelmDeploy {}
92
119
newPL .Deploy .LegacyHelmDeploy .LifecycleHooks = newHelm .LifecycleHooks
0 commit comments