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

Allow log requests to specify a namespace filter #37

Conversation

LucasRoesler
Copy link
Member

@LucasRoesler LucasRoesler commented Dec 15, 2019

What

  • Add Namespace field to the log request and response so that users
    can specify the namespace of the function. This is required to
    support the new multi-namespace support. Using this, a user can
    deploy a function with the same name to multiple namespaces. E.g. to
    dev and prod namespaces. The namespace field is required so that
    the user can target the specific deployment of the function. It is
    expected the that the empty namespace will be treated as "in the
    default namespace"

    Note that this does not actually implement any filtering logic, it
    only allows the log providers to accept and return the information.
    faas-provider and log-provider implementation will need to update
    and handle the new field accordingly.

Resolves #30

Supports openfaas/faas-netes#511

Signed-off-by: Lucas Roesler [email protected]

**What**
- Add `Namespace` field to the log request and response so that users
  can specify the namespace of the function.  This is required to
  support the new multi-namespace support. Using this, a user can
  deploy a function with the same name to multiple namespaces. E.g. to
  `dev` and `prod` namespaces. The namespace field is required so that
  the user can target the specific deployment of the function.  It is
  expected the that the empty namespace will be treated as "in the
  default namespace"

  Note that this does not actually implement any filtering logic, it
  only allows the log providers to accept and return the information.
  faas-provider and log-provider implementation will need to update
  and handle the new field accordingly.

Signed-off-by: Lucas Roesler <[email protected]>
@LucasRoesler LucasRoesler self-assigned this Dec 15, 2019
@@ -103,12 +103,6 @@ func Test_GETRequestParsing(t *testing.T) {
err: "",
expectedRequest: Request{Name: "foobar"},
},
{
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This test was a copy/paste duplicate of the one above it. I probably accidentally included it during the initial implementation

@alexellis
Copy link
Member

Does this require any testing?

@LucasRoesler
Copy link
Member Author

All it does is add a new field to the jsonnand because it is a new field, it is backwards compatible. The query string parsing of the new field is already tested with the modified unit test

@alexellis
Copy link
Member

I'll take that as a no/already covered. 👍

Copy link
Member

@alexellis alexellis left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Approved

@alexellis alexellis merged commit d6579bd into openfaas:master Dec 15, 2019
@alexellis
Copy link
Member

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.

Add namespace support for logs
2 participants