VFS: Be more lenient in List if ClusterVFS.find can't read the cluster

I believe S3 eventual consistency doesn't really guarantee much here,
so a delete by one kops instance and a list by another could easily
generate this.

Fixes #917
This commit is contained in:
Zach Loafman 2016-11-16 16:58:12 -08:00
parent 95f39ccc32
commit b67e805357
1 changed files with 4 additions and 2 deletions

View File

@ -69,11 +69,13 @@ func (c *ClusterVFS) List(options k8sapi.ListOptions) (*api.ClusterList, error)
for _, clusterName := range names {
cluster, err := c.find(clusterName)
if err != nil {
return nil, err
glog.Warningf("cluster %q found in state store listing, but cannot be loaded: %v", clusterName, err)
continue
}
if cluster == nil {
return nil, fmt.Errorf("cluster not found %q", clusterName)
glog.Warningf("cluster %q found in state store listing, but doesn't exist now", clusterName)
continue
}
items = append(items, *cluster)