Skip to content

Commit a053f15

Browse files
committed
add name validation in namespace.Inspect
Signed-off-by: Mike Interlandi <[email protected]>
1 parent 343d0a9 commit a053f15

File tree

1 file changed

+4
-0
lines changed

1 file changed

+4
-0
lines changed

pkg/cmd/namespace/inspect.go

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -30,6 +30,10 @@ import (
3030
func Inspect(ctx context.Context, client *containerd.Client, inspectedNamespaces []string, options types.NamespaceInspectOptions) error {
3131
result := make([]interface{}, len(inspectedNamespaces))
3232
for index, ns := range inspectedNamespaces {
33+
if err := validateNamespaceName(ns); err != nil {
34+
return err
35+
}
36+
3337
ctx = namespaces.WithNamespace(ctx, ns)
3438
labels, err := client.NamespaceService().Labels(ctx, ns)
3539
if err != nil {

0 commit comments

Comments
 (0)