namespaceExists checks if the namespace exists
(ctx context.Context, store namespaces.Store, namespace string)
| 51 | |
| 52 | // namespaceExists checks if the namespace exists |
| 53 | func namespaceExists(ctx context.Context, store namespaces.Store, namespace string) error { |
| 54 | nsList, err := store.List(ctx) |
| 55 | if err != nil { |
| 56 | return err |
| 57 | } |
| 58 | if slices.Contains(nsList, namespace) { |
| 59 | return nil |
| 60 | } |
| 61 | |
| 62 | return fmt.Errorf("namespace %s: %w", namespace, errdefs.ErrNotFound) |
| 63 | } |