Skip to content
This repository was archived by the owner on Dec 15, 2021. It is now read-only.

Add CORS support #1008

Merged
merged 7 commits into from
Mar 13, 2019
Merged

Add CORS support #1008

merged 7 commits into from
Mar 13, 2019

Conversation

imishravmw
Copy link
Contributor

@imishravmw imishravmw commented Mar 7, 2019

Issue Ref: [Issue number related to this PR or None]
934
Description:
Support for CORS for HTTP endpoints is expected here. This pull request provides cors flag while creating HTTP trigger.

[PR Description]
cors flag has been added to below command
kubeless trigger http create
cors-enable flag is a boolean flag, by default it is false to be backward compatible.
if cors-enable flag is true, then one can specify cors-domain which will set that only for this cors-domain, cors will be enabled.
Tests have been added to http-trigger repo.
TODOs:

  • Ready to review
  • Automated Tests
  • Docs

@andresmgot
Copy link
Contributor

Like I said in your other PR, I would make this about adding annotations instead. You can use a StringSlice like the label flag in the function deploy command:
https://github.com/kubeless/kubeless/blob/master/cmd/kubeless/function/deploy.go#L275

@imishravmw
Copy link
Contributor Author

@andresmgot
circleci build is failing because of following error

github.com/kubeless/kubeless/cmd/kubeless/trigger/http

cmd/kubeless/trigger/http/create.go:106:19: httpTrigger.Spec.CorsEnable undefined (type "github.com/kubeless/kubeless/vendor/github.com/kubeless/http-trigger/pkg/apis/kubeless/v1beta1".HTTPTriggerSpec has no field or method CorsEnable)

even though earlier PR has been merged and code is there in master branch, any idea ,what could be causing this failure.

@andresmgot
Copy link
Contributor

ah, true, you need to update the vendor dependency. You can do that executing:

dep ensure -v -update github.com/kubeless/http-trigger

@imishravmw
Copy link
Contributor Author

imishravmw commented Mar 13, 2019

@andresmgot build has passed, thanks, you can merge this PR , and should we close CORS issues as well. there are two CORS related issue in kubeless repo.

Copy link
Contributor

@andresmgot andresmgot left a comment

Choose a reason for hiding this comment

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

Thanks @imishravmw !

@andresmgot andresmgot merged commit 4064c41 into vmware-archive:master Mar 13, 2019
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants