Open rockoo opened 5 years ago
Version: v2.2.2 Was able to reproduce this by:
Results: Changes both rules to api-v2
@tfiduccia can you reproduce this on 2.1.x?
Root cause:
The ingress hosts/rules/targets information is stored in under the annotation field.cattle.io/ingressState
in the format of key := fmt.Sprintf("%s/%s/%s/%s/%s", name, namespace, host, path, port)
. When building this key, currently for any host with xip.io, we ignore the actual value causing key conflicts. Hence the last available service/workload is stored.
func GetStateKey(name, namespace, host string, path string, port string) string {
logrus.Infof("MP: GetStateKey: name: %v, namespace: %v, host: %v, path: %v, port: %v", name, namespace, host, path, port)
//ipDomain := settings.IngressIPDomain.Get()
//if ipDomain != "" && strings.HasSuffix(host, ipDomain) {
// host = ipDomain
//}
key := fmt.Sprintf("%s/%s/%s/%s/%s", name, namespace, host, path, port)
logrus.Infof("MP key: %v", key)
return base64.URLEncoding.EncodeToString([]byte(key))
}
Fix would be to not ignore the host blindly based on the suffix. But this would require code changes to handle this new key in multiple controllers. (ingress, ingresshostgen, store).
In case of upgrades, need to check for oldkey and see if the host info is missing and repopulate it accordingly.
Edit ingress controller:
Both rules now show target 2 workload as selected.
v2.2.1
UI:v2.2.19
ingresses.run