fix(kube): remove namespace enforcement

This fixes an issue where resources that hardcode the metadata.namespace parameter cannot be installed.

Signed-off-by: Matthew Fisher <matt.fisher@microsoft.com>
pull/6046/head
Matthew Fisher 6 years ago
parent d23d68d51c
commit b5d555e4ea
No known key found for this signature in database
GPG Key ID: 92AA783CBAAE8E3B

@ -114,7 +114,6 @@ func (c *Client) newBuilder() *resource.Builder {
ContinueOnError(). ContinueOnError().
NamespaceParam(c.namespace()). NamespaceParam(c.namespace()).
DefaultNamespace(). DefaultNamespace().
RequireNamespace().
Flatten() Flatten()
} }

@ -193,6 +193,11 @@ func TestBuild(t *testing.T) {
namespace: "test", namespace: "test",
reader: strings.NewReader(testInvalidServiceManifest), reader: strings.NewReader(testInvalidServiceManifest),
err: true, err: true,
}, {
name: "Valid input, deploying resources into different namespaces",
namespace: "test",
reader: strings.NewReader(namespacedGuestbookManifest),
count: 1,
}, },
} }
@ -444,3 +449,31 @@ spec:
ports: ports:
- containerPort: 80 - containerPort: 80
` `
const namespacedGuestbookManifest = `
apiVersion: extensions/v1beta1
kind: Deployment
metadata:
name: frontend
namespace: guestbook
spec:
replicas: 3
template:
metadata:
labels:
app: guestbook
tier: frontend
spec:
containers:
- name: php-redis
image: gcr.io/google-samples/gb-frontend:v4
resources:
requests:
cpu: 100m
memory: 100Mi
env:
- name: GET_HOSTS_FROM
value: dns
ports:
- containerPort: 80
`

Loading…
Cancel
Save