glog.Errorf("user error! more than one deployment is selecting replica set %s/%s with labels: %#v, returning %s/%s",rs.Namespace,rs.Name,rs.Labels,deployments[0].Namespace,deployments[0].Name)
glog.Errorf("user error! more than one deployment is selecting pod %s/%s with labels: %#v, returning %s/%s",pod.Namespace,pod.Name,pod.Labels,deployments[0].Namespace,deployments[0].Name)
}
}
}
glog.V(4).Infof("No deployments found for pod %v, deployment controller will avoid syncing.",pod.Name)
return&deployments[0]
returnnil
}
}
// When a pod is created, ensure its controller syncs
// When a pod is created, ensure its controller syncs
// We don't care if the overlapping annotation update failed or not (we don't make decision on it)
d,_=dc.markDeploymentOverlap(d,other.Name)
other,_=dc.markDeploymentOverlap(other,d.Name)
// Skip syncing this one if older overlapping one is found
// TODO: figure out a better way to determine which deployment to skip,
// either with controller reference, or with validation.
// Using oldest active replica set to determine which deployment to skip wouldn't make much difference,
// since new replica set hasn't been created after selector update
ifutil.SelectorUpdatedBefore(other,d){
returnfmt.Errorf("found deployment %s/%s has overlapping selector with an older deployment %s/%s, skip syncing it",d.Namespace,d.Name,other.Namespace,other.Name)
}
}
}
if!overlapping{
// We don't care if the overlapping annotation update failed or not (we don't make decision on it)
fmt.Fprintf(out,"!!!WARNING!!! This deployment has overlapping label selector with deployment %q and won't behave as expected. Please fix it before continue.\n",overlapWith)