Update all salt providers to force explicit namespace creation; update e2e
This commit is contained in:
@@ -19,6 +19,7 @@ package exists
|
||||
import (
|
||||
"fmt"
|
||||
"io"
|
||||
"time"
|
||||
|
||||
"github.com/GoogleCloudPlatform/kubernetes/pkg/admission"
|
||||
"github.com/GoogleCloudPlatform/kubernetes/pkg/api"
|
||||
@@ -73,7 +74,14 @@ func (e *exists) Admit(a admission.Attributes) (err error) {
|
||||
if exists {
|
||||
return nil
|
||||
}
|
||||
return admission.NewForbidden(a, fmt.Errorf("Namespace %s does not exist", a.GetNamespace()))
|
||||
|
||||
// in case of latency in our caches, make a call direct to storage to verify that it truly exists or not
|
||||
_, err = e.client.Namespaces().Get(a.GetNamespace())
|
||||
if err != nil {
|
||||
return admission.NewForbidden(a, fmt.Errorf("Namespace %s does not exist", a.GetNamespace()))
|
||||
}
|
||||
|
||||
return nil
|
||||
}
|
||||
|
||||
// NewExists creates a new namespace exists admission control handler
|
||||
@@ -90,7 +98,7 @@ func NewExists(c client.Interface) admission.Interface {
|
||||
},
|
||||
&api.Namespace{},
|
||||
store,
|
||||
0,
|
||||
5*time.Minute,
|
||||
)
|
||||
reflector.Run()
|
||||
return &exists{
|
||||
|
Reference in New Issue
Block a user