Skip to content

Commit 92c7643

Browse files
cm cs handling for inheriting data type (#4189)
1 parent b3fdf7b commit 92c7643

File tree

1 file changed

+4
-3
lines changed

1 file changed

+4
-3
lines changed

api/restHandler/CoreAppRestHandler.go

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -887,6 +887,10 @@ func (handler CoreAppRestHandlerImpl) buildAppConfigMaps(appId int, envId int, c
887887

888888
//set data
889889
data := configMap.Data
890+
if configMap.Data == nil {
891+
//it means env cm is inheriting from base cm
892+
data = configMap.DefaultData
893+
}
890894
var dataObj map[string]interface{}
891895
if data != nil {
892896
err := json.Unmarshal([]byte(data), &dataObj)
@@ -973,9 +977,6 @@ func (handler CoreAppRestHandlerImpl) buildAppEnvironmentSecrets(appId int, envI
973977
handler.logger.Errorw("service err, CSEnvironmentFetchForEdit in GetAppAllDetail", "err", err, "appId", appId, "envId", envId)
974978
return nil, err, http.StatusInternalServerError
975979
}
976-
if secretConfig.Data == nil {
977-
secretDataWithData.ConfigData[0].Data = secretConfig.Data
978-
}
979980
secretDataWithData.ConfigData[0].DefaultData = secretConfig.DefaultData
980981

981982
secretRes, err, statusCode := handler.buildAppSecrets(appId, envId, secretDataWithData)

0 commit comments

Comments
 (0)