-
Notifications
You must be signed in to change notification settings - Fork 125
Add Google Cloud Platform Labels Support #95
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
Conversation
|
I intend to update the documentation in the main repo next, but that can't really be deployed until this is released. |
adnasa
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM.
let's hope you get yourself a merge soon 😉
| funcTemplate.properties.labels = _.assign({}, | ||
| _.get(this, 'serverless.service.provider.labels') || {}, | ||
| _.get(funcObject, 'labels') || {}, | ||
| ); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
yes, this makes much more sense now after your comment in #94
adnasa
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM.
let's hope you get yourself a merge soon 😉
|
I have created a PR on the main serverless repo for the documentation |
|
@pmuens are you able to review this? |
pmuens
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
What did you implement:
Closes #94
How did you implement it:
I added a new property to the
propertiesobject on the function template, when compiling the functions. The resulting value, an object, is the result of merging alabelsproperty on theproviderobject and alabelsproperty on the function object. The function object'slabelsobject takes priority, overriding properties on the provider objects'slabels.If no
labelsproperties are defined the result is an empty object.How can we verify it:
Use the following
serverless.ymlfile in association with thegoogle-nodejstemplate, changing the credentials and project values as necessary.Deploy the function then login the Google Cloud Platform console and go to the Functions section. Select the function you just deployed. On the right the pane should show an
applabel with the valuegoogle-nodejs-exampleand atestlabel with the valuefunction-labelTodos:
Is this ready for review?: YES
Is it a breaking change?: NO