mirror of
https://github.com/projectcapsule/capsule.git
synced 2026-08-22 22:16:46 +00:00
47 lines
1.2 KiB
Go
47 lines
1.2 KiB
Go
//+build e2e
|
|
|
|
/*
|
|
Copyright 2020 Clastix Labs.
|
|
|
|
Licensed under the Apache License, Version 2.0 (the "License");
|
|
you may not use this file except in compliance with the License.
|
|
You may obtain a copy of the License at
|
|
|
|
http://www.apache.org/licenses/LICENSE-2.0
|
|
|
|
Unless required by applicable law or agreed to in writing, software
|
|
distributed under the License is distributed on an "AS IS" BASIS,
|
|
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
See the License for the specific language governing permissions and
|
|
limitations under the License.
|
|
*/
|
|
|
|
package e2e
|
|
|
|
import (
|
|
"context"
|
|
|
|
. "github.com/onsi/ginkgo"
|
|
. "github.com/onsi/gomega"
|
|
metav1 "k8s.io/apimachinery/pkg/apis/meta/v1"
|
|
|
|
"github.com/clastix/capsule/api/v1alpha1"
|
|
)
|
|
|
|
var _ = Describe("creating a Namespace creation with no Tenant assigned", func() {
|
|
It("should fail", func() {
|
|
tnt := &v1alpha1.Tenant{
|
|
Spec: v1alpha1.TenantSpec{
|
|
Owner: v1alpha1.OwnerSpec{
|
|
Name: "missing",
|
|
Kind: "User",
|
|
},
|
|
},
|
|
}
|
|
ns := NewNamespace("no-namespace")
|
|
cs := ownerClient(tnt)
|
|
_, err := cs.CoreV1().Namespaces().Create(context.TODO(), ns, metav1.CreateOptions{})
|
|
Expect(err).ShouldNot(Succeed())
|
|
})
|
|
})
|