@@ -263,7 +263,8 @@ func (impl *DeploymentConfigurationServiceImpl) getCmCsConfigHistory(ctx context
263
263
var configData []* bean.ConfigData
264
264
configList := pipeline.ConfigsList {}
265
265
secretList := bean.SecretsList {}
266
- if configType == repository3 .CONFIGMAP_TYPE {
266
+ switch configType {
267
+ case repository3 .CONFIGMAP_TYPE :
267
268
if len (history .Data ) > 0 {
268
269
err = json .Unmarshal ([]byte (history .Data ), & configList )
269
270
if err != nil {
@@ -273,7 +274,7 @@ func (impl *DeploymentConfigurationServiceImpl) getCmCsConfigHistory(ctx context
273
274
}
274
275
resourceType = bean .CM
275
276
configData = configList .ConfigData
276
- } else if configType == repository3 .SECRET_TYPE {
277
+ case repository3 .SECRET_TYPE :
277
278
if len (history .Data ) > 0 {
278
279
err = json .Unmarshal ([]byte (history .Data ), & secretList )
279
280
if err != nil {
@@ -283,6 +284,7 @@ func (impl *DeploymentConfigurationServiceImpl) getCmCsConfigHistory(ctx context
283
284
}
284
285
resourceType = bean .CS
285
286
configData = secretList .ConfigData
287
+
286
288
}
287
289
288
290
resolvedDataMap , variableSnapshotMap , err := impl .scopedVariableManager .GetResolvedCMCSHistoryDtos (ctx , configType , adaptor .ReverseConfigListConvertor (configList ), history , adaptor .ReverseSecretListConvertor (secretList ))
@@ -632,7 +634,6 @@ func (impl *DeploymentConfigurationServiceImpl) getPublishedConfigData(ctx conte
632
634
}
633
635
634
636
func (impl * DeploymentConfigurationServiceImpl ) getPublishedPipelineStrategyConfig (ctx context.Context , appId int , envId int ) (* bean2.DeploymentAndCmCsConfig , error ) {
635
- pipelineStrategyJson := json.RawMessage {}
636
637
pipelineConfig := bean2 .NewDeploymentAndCmCsConfig ()
637
638
if envId == 0 {
638
639
return pipelineConfig , nil
@@ -649,6 +650,7 @@ func (impl *DeploymentConfigurationServiceImpl) getPublishedPipelineStrategyConf
649
650
} else if errors .IsNotFound (err ) {
650
651
return pipelineConfig , nil
651
652
}
653
+ pipelineStrategyJson := json.RawMessage {}
652
654
err = pipelineStrategyJson .UnmarshalJSON ([]byte (pipelineStrategy .CodeEditorValue .Value ))
653
655
if err != nil {
654
656
impl .logger .Errorw ("getDeploymentTemplateForEnvLevel, error in unmarshalling string pipelineStrategyHistory data into json Raw message" , "err" , err )
0 commit comments