Skip to content

Commit 596b86b

Browse files
committed
remove getResolvedConfigDataForValues
1 parent a720200 commit 596b86b

File tree

4 files changed

+1
-39
lines changed

4 files changed

+1
-39
lines changed

api/restHandler/DeploymentConfigurationRestHandler.go

Lines changed: 0 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,6 @@ package restHandler
22

33
import (
44
"context"
5-
"encoding/json"
65
"fmt"
76
"github.com/devtron-labs/devtron/api/restHandler/common"
87
"github.com/devtron-labs/devtron/pkg/auth/authorisation/casbin"
@@ -91,20 +90,6 @@ func (handler *DeploymentConfigurationRestHandlerImpl) GetConfigData(w http.Resp
9190
common.WriteJsonResp(w, err, nil, http.StatusBadRequest)
9291
return
9392
}
94-
switch r.Method {
95-
case http.MethodPost:
96-
if r.ContentLength > 0 {
97-
valuesPayload := &bean.ValuesDto{}
98-
decoder := json.NewDecoder(r.Body)
99-
err = decoder.Decode(valuesPayload)
100-
if err != nil {
101-
handler.logger.Errorw("error in decoding the request payload", "err", err, "requestBody", r.Body)
102-
common.WriteJsonResp(w, err, nil, http.StatusBadRequest)
103-
return
104-
}
105-
configDataQueryParams.Values = valuesPayload.Values
106-
}
107-
}
10893

10994
configDataQueryParams.UserId = userId
11095
//RBAC START

api/router/DeploymentConfigRouter.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -26,6 +26,6 @@ func (router DeploymentConfigurationRouterImpl) initDeploymentConfigurationRoute
2626
Methods("GET")
2727
configRouter.Path("/data").
2828
HandlerFunc(router.deploymentGroupRestHandler.GetConfigData).
29-
Methods("GET", "POST")
29+
Methods("GET")
3030

3131
}

pkg/configDiff/DeploymentConfigurationService.go

Lines changed: 0 additions & 22 deletions
Original file line numberDiff line numberDiff line change
@@ -142,33 +142,11 @@ func (impl *DeploymentConfigurationServiceImpl) GetAllConfigData(ctx context.Con
142142
return impl.getConfigDataForCdRollback(ctx, configDataQueryParams, userHasAdminAccess)
143143
case bean2.DeploymentHistory.ToString():
144144
return impl.getConfigDataForDeploymentHistory(ctx, configDataQueryParams, userHasAdminAccess)
145-
case bean2.ResolveData.ToString():
146-
// this only supports resolution of deployment template data as of now
147-
return impl.getResolvedConfigDataForValues(ctx, configDataQueryParams.Values, appId, envId)
148145
}
149146
// this would be the default case
150147
return impl.getConfigDataForAppConfiguration(ctx, configDataQueryParams, appId, envId, clusterId, userHasAdminAccess)
151148
}
152149

153-
func (impl *DeploymentConfigurationServiceImpl) getResolvedConfigDataForValues(ctx context.Context, values string, appId, envId int) (*bean2.DeploymentAndCmCsConfigDto, error) {
154-
configDataDto := &bean2.DeploymentAndCmCsConfigDto{}
155-
var err error
156-
deploymentTemplateRequest := generateManifest.DeploymentTemplateRequest{
157-
AppId: appId,
158-
RequestDataMode: generateManifest.Values,
159-
}
160-
if envId > 0 {
161-
deploymentTemplateRequest.EnvId = envId
162-
}
163-
resolvedTemplate, _, err := impl.deploymentTemplateService.ResolveTemplateVariables(ctx, values, deploymentTemplateRequest)
164-
if err != nil {
165-
impl.logger.Errorw("error in getting resolved data for cm draft data ", "appId", appId, "err", err)
166-
return nil, err
167-
}
168-
169-
return configDataDto.WithDeploymentTemplateData(bean2.NewDeploymentAndCmCsConfig().WithResolvedValue(json.RawMessage(resolvedTemplate))), nil
170-
}
171-
172150
func (impl *DeploymentConfigurationServiceImpl) getConfigDataForCdRollback(ctx context.Context, configDataQueryParams *bean2.ConfigDataQueryParams, userHasAdminAccess bool) (*bean2.DeploymentAndCmCsConfigDto, error) {
173151
// wfrId is expected in this case to return the expected data
174152
return impl.getConfigDataForDeploymentHistory(ctx, configDataQueryParams, userHasAdminAccess)

pkg/configDiff/bean/bean.go

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -175,7 +175,6 @@ type ConfigDataQueryParams struct {
175175
UserId int32 `schema:"-"`
176176
WfrId int `schema:"wfrId"`
177177
ConfigArea string `schema:"configArea"`
178-
Values string `schema:"values"`
179178
}
180179

181180
// FilterCriteria []string `schema:"filterCriteria"`

0 commit comments

Comments
 (0)