-
Notifications
You must be signed in to change notification settings - Fork 126
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. |
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
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? |
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
properties
object on the function template, when compiling the functions. The resulting value, an object, is the result of merging alabels
property on theprovider
object and alabels
property on the function object. The function object'slabels
object takes priority, overriding properties on the provider objects'slabels
.If no
labels
properties are defined the result is an empty object.How can we verify it:
Use the following
serverless.yml
file in association with thegoogle-nodejs
template, 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
app
label with the valuegoogle-nodejs-example
and atest
label with the valuefunction-label
Todos:
Is this ready for review?: YES
Is it a breaking change?: NO