Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add support for namespace to commands #519

Merged
merged 1 commit into from
Sep 22, 2019

Conversation

alexellis
Copy link
Member

Signed-off-by: Alex Ellis (OpenFaaS Ltd) [email protected]

Description

Add support for namespace to commands

Motivation and Context

This is being added for #511, so that the list, update, delete
and read endpoints all can take an optional namespace override.

How Has This Been Tested?

Tested with k3s 1.15 and two namespaces. Also tested that kube-
system is blocked for those commands.

alext:faas-netes alex$ kubectl get deploy -n openfaas-fn
NAME   READY   UP-TO-DATE   AVAILABLE   AGE
cows   1/1     1            1           38h
alext:faas-netes alex$ kubectl get deploy -n fn
NAME       READY   UP-TO-DATE   AVAILABLE   AGE
nodeinfo   2/2     2            2           38h
alext:faas-netes alex$ 
alext:faas-netes alex$ curl -s $AUTH/system/functions?namespace=openfaas-fn |jq
[
  {
    "name": "cows",
    "image": "alexellis2/ascii-cows-openfaas:0.1",
    "invocationCount": 0,
    "replicas": 1,
    "envProcess": "",
    "availableReplicas": 1,
    "labels": {
      "faas_function": "cows"
    },
    "annotations": {
      "prometheus.io.scrape": "false"
    },
    "namespace": "openfaas-fn"
  }
]
alext:faas-netes alex$ curl -s $AUTH/system/functions?namespace=fn |jq
[
  {
    "name": "nodeinfo",
    "image": "functions/nodeinfo:latest",
    "invocationCount": 0,
    "replicas": 2,
    "envProcess": "",
    "availableReplicas": 2,
    "labels": {
      "com.openfaas.scale.max": "5",
      "com.openfaas.scale.min": "2",
      "faas_function": "nodeinfo"
    },
    "annotations": {
      "prometheus.io.scrape": "false"
    },
    "namespace": "fn"
  }
]

Types of changes

  • Bug fix (non-breaking change which fixes an issue)
  • New feature (non-breaking change which adds functionality)
  • Breaking change (fix or feature that would cause existing functionality to change)

This is being added for #511, so that the list, update, delete
and read endpoints all can take an optional namespace override.

Tested with k3s 1.15 and two namespaces. Also tested that kube-
system is blocked for those commands.

Signed-off-by: Alex Ellis (OpenFaaS Ltd) <[email protected]>
@alexellis alexellis merged commit c5a1b7b into master Sep 22, 2019
@alexellis alexellis deleted the openfaasltd/namespace-switching branch September 22, 2019 08:44
@alexellis alexellis mentioned this pull request Sep 22, 2019
32 tasks
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant