cli(actions): preserve action definition in metadata apply (fix… (#3993)

This commit is contained in:
Aravind Shankar 2020-03-03 12:36:07 +05:30 committed by GitHub
parent b87063dc05
commit 28941b4eef
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -213,6 +213,8 @@ input SampleInput {
sdlFromResp.Actions[actionIndex].Permissions = oldAction.Actions[oldActionIndex].Permissions
sdlFromResp.Actions[actionIndex].Definition.Kind = oldAction.Actions[oldActionIndex].Definition.Kind
sdlFromResp.Actions[actionIndex].Definition.Handler = oldAction.Actions[oldActionIndex].Definition.Handler
sdlFromResp.Actions[actionIndex].Definition.ForwardClientHeaders = oldAction.Actions[oldActionIndex].Definition.ForwardClientHeaders
sdlFromResp.Actions[actionIndex].Definition.Headers = oldAction.Actions[oldActionIndex].Definition.Headers
break
}
}
@ -446,10 +448,6 @@ func (a *ActionConfig) Build(metadata *yaml.MapSlice) error {
return fmt.Errorf("custom type %s is not present in %s", customType.Name, graphqlFileName)
}
}
for index, action := range sdlFromResp.Actions {
sdlFromResp.Actions[index].Definition.Kind = a.ActionConfig.Kind
sdlFromResp.Actions[index].Definition.Handler = a.ActionConfig.HandlerWebhookBaseURL + "/" + action.Name
}
if len(sdlFromResp.Actions) != 0 {
actionItem := yaml.MapItem{
Key: "actions",