Repository navigation
feat(functions/v2): add GCE labeling sample - #6432
Conversation
ace-n
left a comment
There was a problem hiding this comment.
LGTM other than the file-paths issue.
| @@ -16,9 +16,7 @@ | |||
| limitations under the License. | |||
| --> | |||
|
|
|||
There was a problem hiding this comment.
Did you mean to change this file?
I think we should put this sample in its own directory, e.g. functions/v2/cloudevent/label-compute-instance
There was a problem hiding this comment.
We probably want to restructure this directory without so much nesting. Currently it would be:
- helloworld/
- hello-gcs/
- pubsub/
- subscribe-to-topic/
- cloudevents/
- log-cloudevent/
- autolabelinstance/ (if moved into another project)
But we may just want to use the top level folder with individual files for functions
- helloworld/
- hello-gcs.java
- pubsub/
- subscribe-to-topic.java
- cloudevents/
- log-cloudevent.java
- autolabelinstance.java
Thoughts?
There was a problem hiding this comment.
I believe we previously decided to give each sample its own project (and thus, its own directory).
That being said, I'd be happy with functions/v2/label-compute-instance, if you want to remove the cloudevent part.
|
|
|
||
| private static final String PROJECT_ID = System.getenv("GOOGLE_CLOUD_PROJECT"); | ||
| private static final String ZONE = "us-central1-a"; | ||
| private static final String INSTANCE = "lite1"; |
There was a problem hiding this comment.
This sample only labels the GCE VM. I looked at the create a VM code and I am not sure I want to have create and delete an instance every test run; therefore I am using an already created VM. Thoughts?
There was a problem hiding this comment.
Your probably ok, but anything that creates using a fixed name will have problems in our testing environment.
lesv
left a comment
There was a problem hiding this comment.
I'd rather you were using released artifacts rather than an alpha or RC.
Take a look at your instance name, perhaps it should be a UUID if it were created multiple times for different versions of the language during testing. Also, you might wish to then look for stuff >24h old and delete them.
Fixes #issue
pom.xmlparent set to latestshared-configurationmvn clean verifyrequiredmvn -P lint checkstyle:checkrequiredmvn -P lint clean compile pmd:cpd-check spotbugs:checkadvisory only