AmadeusITGroup / Redis-Operator

Redis Operator creates/configures/manages Redis clusters atop Kubernetes
MIT License
167 stars 62 forks source link

Controller confuses multiple RedisClusters in different namespaces that have the same name. #42

Closed mtomwing closed 5 years ago

mtomwing commented 5 years ago

Basically if we have a RedisCluster{Name: Foo, Namespace: Bar} and another one RedisCluster{Name: Foo, Namespace: Baz}, the controller will attempt to manage their combined pods together.

Source of this might be here: https://github.com/AmadeusITGroup/Redis-Operator/blob/b165194f4f4c56843815e664eae5342714a9ce9d/pkg/controller/pod/control.go#L58

// GetRedisClusterPods return list of Pod attached to a RedisCluster
func (p *RedisClusterControl) GetRedisClusterPods(redisCluster *rapi.RedisCluster) ([]*kapiv1.Pod, error) {
    selector, err := CreateRedisClusterLabelSelector(redisCluster)
    if err != nil {
        return nil, err
    }
    return p.PodLister.List(selector)
}

I don't see any reference to namespace in the selector itself, or here. So my best guess is that this function is returning all redis pods across the 2 example namespaces.

mtomwing commented 5 years ago

Thanks :+1: