add fake namespace uid for npc test
This commit is contained in:
1 parent
0789670344
commit
2ec3e1ef1a
1 file changed
+8
@@ -155,6 +155,7 @@ func TestRegressionPolicyNamespaceOrdering3059(t *testing.T) {
|
||||
sourceNamespace := &coreapi.Namespace{
|
||||
ObjectMeta: metav1.ObjectMeta{
|
||||
Name: "source",
|
||||
UID: "source",
|
||||
Labels: map[string]string{
|
||||
"app": "source",
|
||||
},
|
||||
@@ -164,6 +165,7 @@ func TestRegressionPolicyNamespaceOrdering3059(t *testing.T) {
|
||||
destinationNamespace := &coreapi.Namespace{
|
||||
ObjectMeta: metav1.ObjectMeta{
|
||||
Name: "destination",
|
||||
UID: "destination",
|
||||
},
|
||||
}
|
||||
|
||||
@@ -244,6 +246,7 @@ func TestDefaultAllow(t *testing.T) {
|
||||
defaultNamespace := &coreapi.Namespace{
|
||||
ObjectMeta: metav1.ObjectMeta{
|
||||
Name: "default",
|
||||
UID: "default",
|
||||
},
|
||||
}
|
||||
controller.AddNamespace(defaultNamespace)
|
||||
@@ -373,6 +376,7 @@ func TestOutOfOrderPodEvents(t *testing.T) {
|
||||
defaultNamespace := &coreapi.Namespace{
|
||||
ObjectMeta: metav1.ObjectMeta{
|
||||
Name: "default",
|
||||
UID: "default",
|
||||
},
|
||||
}
|
||||
client.CoreV1().Namespaces().Create(defaultNamespace)
|
||||
@@ -457,6 +461,7 @@ func TestNewTargetSelector(t *testing.T) {
|
||||
defaultNamespace := &coreapi.Namespace{
|
||||
ObjectMeta: metav1.ObjectMeta{
|
||||
Name: "default",
|
||||
UID: "default",
|
||||
},
|
||||
}
|
||||
client.CoreV1().Namespaces().Create(defaultNamespace)
|
||||
@@ -535,11 +540,13 @@ func TestEgressPolicyWithIPBlock(t *testing.T) {
|
||||
defaultNamespace := &coreapi.Namespace{
|
||||
ObjectMeta: metav1.ObjectMeta{
|
||||
Name: "default",
|
||||
UID: "default",
|
||||
},
|
||||
}
|
||||
nonDefaultNamespace := &coreapi.Namespace{
|
||||
ObjectMeta: metav1.ObjectMeta{
|
||||
Name: "non-default",
|
||||
UID: "non-default",
|
||||
},
|
||||
}
|
||||
client.CoreV1().Namespaces().Create(defaultNamespace)
|
||||
@@ -630,6 +637,7 @@ func TestIngressPolicyWithIPBlockAndPortSpecified(t *testing.T) {
|
||||
defaultNamespace := &coreapi.Namespace{
|
||||
ObjectMeta: metav1.ObjectMeta{
|
||||
Name: "default",
|
||||
UID: "default",
|
||||
},
|
||||
}
|
||||
|
||||
|
||||
Reference in new issue
Block a user