mirror of
https://github.com/k3s-io/kubernetes.git
synced 2025-08-24 11:01:26 +00:00
kubelet: validate service names with slashes
Signed-off-by: Stephen Kitt <skitt@redhat.com>
This commit is contained in:
parent
dbfab994bf
commit
9f2a02a723
@ -136,6 +136,7 @@ func Test_validateServices(t *testing.T) {
|
||||
serviceColon = "svc:foo"
|
||||
invalidServiceNewline = "svc\n"
|
||||
invalidServiceNewlineDot = "svc.foo\n"
|
||||
invalidServiceSlash = "svc/foo"
|
||||
)
|
||||
tests := []struct {
|
||||
name string
|
||||
@ -150,6 +151,7 @@ func Test_validateServices(t *testing.T) {
|
||||
{name: "colon service", services: []string{serviceColon}},
|
||||
{name: "invalid service new line", services: []string{invalidServiceNewline}, wantErr: true},
|
||||
{name: "invalid service with dot", services: []string{invalidServiceNewlineDot}, wantErr: true},
|
||||
{name: "invalid service with slash", services: []string{invalidServiceSlash}, wantErr: true},
|
||||
{name: "long service", services: []string{strings.Repeat(service1, 100)}, wantErr: true},
|
||||
{name: "max number of services", services: []string{service1, service2, serviceDot, serviceUnderscore, serviceAt}, wantErr: true},
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user