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

feat(cloudrun): Adding cloudrun provider functionality in orca. #4279

Merged
merged 2 commits into from
Oct 13, 2022
Merged

feat(cloudrun): Adding cloudrun provider functionality in orca. #4279

merged 2 commits into from
Oct 13, 2022

Conversation

sanopsmx
Copy link
Contributor

@sanopsmx sanopsmx commented Jul 6, 2022

This is part of spinnaker/governance#302

Adding cloudrun provider functionality in orca.

@spinnakerbot
Copy link
Contributor

We prefer that non-test backend code be written in Java or Kotlin, rather than Groovy. The following files have been added and written in Groovy:

  • orca-clouddriver/src/main/groovy/com/netflix/spinnaker/orca/clouddriver/tasks/providers/cloudrun/CloudrunServerGroupCreator.groovy

See our server-side commit conventions here.

@mattgogerly
Copy link
Member

mattgogerly commented Jul 22, 2022

@sanopsmx any chance CloudrunServerGroupCreator could be rewritten in Java?

@sanopsmx
Copy link
Contributor Author

@sanopsmx any chance CloudrunServerGroupCreator could be rewritten in Java? LGTM otherwise

Will write and test and check in. Give me sometime..i will write it in java and check in.

@sanopsmx
Copy link
Contributor Author

@sanopsmx any chance CloudrunServerGroupCreator could be rewritten in Java? LGTM otherwise

Modified the code from groovy to java.

Copy link
Member

@mattgogerly mattgogerly left a comment

Choose a reason for hiding this comment

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

Couple of comments. Can you add some tests for the new functionality as well please?

@@ -49,6 +50,7 @@ class DetermineSourceServerGroupTask implements RetryableTask {

@Override
TaskResult execute(StageExecution stage) {

Copy link
Member

Choose a reason for hiding this comment

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

nit: space not needed

Copy link
Contributor Author

Choose a reason for hiding this comment

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

done

@Component
public class CloudrunServerGroupCreator implements ServerGroupCreator {

@Autowired ObjectMapper objectMapper;
Copy link
Member

Choose a reason for hiding this comment

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

Constructor injection is preferred over property injection

Copy link
Contributor Author

Choose a reason for hiding this comment

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

done

try {
yamlMap = yamlReader.readValue(configStr, LinkedHashMap.class);
if (yamlMap.get("metadata") != null
&& ((LinkedHashMap<String, Object>) yamlMap.get("metadata")).get("labels") != null
Copy link
Member

Choose a reason for hiding this comment

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

Is the cast to LinkedHashMap necessary here or can it just be Map?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

done

@sanopsmx
Copy link
Contributor Author

Couple of comments. Can you add some tests for the new functionality as well please?

Added test cases and sent it for review.

Copy link
Contributor

@skandragon skandragon left a comment

Choose a reason for hiding this comment

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

LGTM

@skandragon skandragon merged commit 5a9aefd into spinnaker:master Oct 13, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants