Skip to content

Commit

Permalink
Merge pull request #238 from GLYASAI/V5.1
Browse files Browse the repository at this point in the history
 [FIX] can not offline third-party service
  • Loading branch information
barnettZQG committed Mar 14, 2019
2 parents 5cb4fd8 + 7b6328b commit 7bf1092
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 9 deletions.
9 changes: 7 additions & 2 deletions api/handler/gateway_action.go
Original file line number Diff line number Diff line change
Expand Up @@ -564,11 +564,16 @@ func (g *GatewayAction) RuleConfig(req *apimodel.RuleConfigReq) error {
Key: "proxy-body-size",
Value: strconv.Itoa(req.Body.ProxyBodySize),
})
setheaders := make(map[string]string)
for _, item := range req.Body.SetHeaders {
// filter same key
setheaders["set-header-" + item.Key] = item.Value
}
for k, v := range setheaders {
configs = append(configs, &model.GwRuleConfig{
RuleID: req.RuleID,
Key: "set-header-" + item.Key,
Value: item.Value,
Key: k,
Value: v,
})
}

Expand Down
8 changes: 1 addition & 7 deletions worker/appm/thirdparty/thirdparty.go
Original file line number Diff line number Diff line change
Expand Up @@ -335,6 +335,7 @@ func (t *thirdparty) runUpdate(event discovery.Event) {
for _, item := range eps {
deleteEndpoints(item, t.clientset)
}
return
}

endpoints, err := t.createK8sEndpoints(as, []*v1.RbdEndpoint{ep})
Expand Down Expand Up @@ -427,13 +428,6 @@ func (t *thirdparty) runDelete(sid string) {
t.store.OnDelete(ep)
}
}
if cm := as.GetRbdEndpiontsCM(); cm != nil {
err := t.clientset.CoreV1().ConfigMaps(cm.Namespace).Delete(cm.Name, &metav1.DeleteOptions{})
if err != nil && !errors.IsNotFound(err) {
logrus.Warningf("error deleting config map: %v", err)
}
t.store.OnDelete(cm)
}
}

// CreateRbdEpConfigmap creates a configmap to store rbd endpoints.
Expand Down

0 comments on commit 7bf1092

Please sign in to comment.