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

Attempts to fetch workspace from Master if all slaves are offline #140

Closed
wants to merge 5 commits into from

Conversation

alokjoshi89
Copy link

No description provided.

Copy link
Contributor

@iocanel iocanel left a comment

Choose a reason for hiding this comment

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

I love the idea.
I added a comment about the NPE fix, which is redundant.

I'd like a comment in the readme about this feature.

LOGGER.info("Workspace exists ? " + workspace.exists());
if (workspace.exists()) {
return new FilePath(workspace);
if(job != null) {
Copy link
Contributor

Choose a reason for hiding this comment

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

There is no need to add a null check before an instanceof.
http://docs.oracle.com/javase/specs/jls/se7/html/jls-15.html#jls-15.20.2

Copy link
Author

Choose a reason for hiding this comment

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

This makes sense. I'll change it.

Copy link
Author

@alokjoshi89 alokjoshi89 Feb 23, 2017

Choose a reason for hiding this comment

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

Where should I add the comment about this in readme? I am not sure about the proper location; I was thinking at the end of the file with header 'Workspace support from Master' and details in the body?

LOGGER.info("Nodes went offline. Hence fetching it through master");
if (job instanceof AbstractProject) {
String assignedLabel = ((AbstractProject) job).getAssignedLabelString();
KubernetesCloud kubernetesCloud = Hudson.getInstance().clouds.get(KubernetesCloud.class);
Copy link
Contributor

Choose a reason for hiding this comment

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

You can have multiple KubernetesClouds, each with a different id

String workspacePath = filePath.toString();
LOGGER.info("Workspace Path: " + workspacePath);
File workspace = new File(workspacePath);
LOGGER.info("Workspace exists ? " + workspace.exists());
Copy link
Contributor

Choose a reason for hiding this comment

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

These logging statements should be level FINE

@alokjoshi89
Copy link
Author

Closing this PR as I messed up part of the code. Will create a new one.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants