ListCluster return the list of name of cluster under the specified namespace
(ctx context.Context, ns string)
| 137 | |
| 138 | // ListCluster return the list of name of cluster under the specified namespace |
| 139 | func (s *ClusterStore) ListCluster(ctx context.Context, ns string) ([]string, error) { |
| 140 | entries, err := s.e.List(ctx, buildClusterPrefix(ns)) |
| 141 | if err != nil { |
| 142 | return nil, err |
| 143 | } |
| 144 | keys := make([]string, len(entries)) |
| 145 | for i, entry := range entries { |
| 146 | keys[i] = entry.Key |
| 147 | } |
| 148 | return keys, nil |
| 149 | } |
| 150 | |
| 151 | func (s *ClusterStore) existsCluster(ctx context.Context, ns, cluster string) (bool, error) { |
| 152 | return s.e.Exists(ctx, buildClusterKey(ns, cluster)) |