Skip to content

Commit ca23fc8

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

File tree

1 file changed

+4
-0
lines changed

1 file changed

+4
-0
lines changed

pkg/cmd/namespace/create.go

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -25,6 +25,10 @@ import (
2525
)
2626

2727
func Create(ctx context.Context, client *containerd.Client, namespace string, options types.NamespaceCreateOptions) error {
28+
if err := validateNamespaceName(namespace); err != nil {
29+
return err
30+
}
31+
2832
labelsArg := objectWithLabelArgs(options.Labels)
2933
namespaces := client.NamespaceService()
3034
return namespaces.Create(ctx, namespace, labelsArg)

0 commit comments

Comments
 (0)