Update all salt providers to force explicit namespace creation; update e2e

This commit is contained in:
derekwaynecarr
2015-05-22 16:46:52 -04:00
parent f015a21026
commit 3e8b1d5e01
10 changed files with 64 additions and 10 deletions

View File

@@ -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{