-
Notifications
You must be signed in to change notification settings - Fork 111
[OSJC-275] Add volumes to deploymentconfigs #232
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
Merged
Merged
Changes from all commits
Commits
File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
42 changes: 42 additions & 0 deletions
42
src/main/java/com/openshift/internal/restclient/model/volume/HostPathVolumeSource.java
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,42 @@ | ||
/******************************************************************************* | ||
* Copyright (c) 2016 Red Hat, Inc. | ||
* Distributed under license by Red Hat, Inc. All rights reserved. | ||
* This program is made available under the terms of the | ||
* Eclipse Public License v1.0 which accompanies this distribution, | ||
* and is available at http://www.eclipse.org/legal/epl-v10.html | ||
* | ||
* Contributors: | ||
* Red Hat, Inc. - initial API and implementation | ||
******************************************************************************/ | ||
package com.openshift.internal.restclient.model.volume; | ||
|
||
import static com.openshift.internal.util.JBossDmrExtentions.*; | ||
|
||
import org.jboss.dmr.ModelNode; | ||
|
||
import com.openshift.restclient.model.volume.IHostPathVolumeSource; | ||
|
||
/** | ||
* Implementation of a hostpath volume source | ||
* @author jeff.cantrill | ||
* | ||
*/ | ||
public class HostPathVolumeSource extends VolumeSource implements IHostPathVolumeSource{ | ||
|
||
private static final String PATH = "hostPath.path"; | ||
|
||
public HostPathVolumeSource(ModelNode node) { | ||
super(node); | ||
} | ||
|
||
@Override | ||
public String getPath() { | ||
return asString(getNode(), getPropertyKeys(), PATH); | ||
} | ||
|
||
@Override | ||
public void setPath(String path) { | ||
set(getNode(), getPropertyKeys(), PATH, path); | ||
} | ||
|
||
} |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
27 changes: 27 additions & 0 deletions
27
src/main/java/com/openshift/restclient/model/volume/IHostPathVolumeSource.java
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,27 @@ | ||
/******************************************************************************* | ||
* Copyright (c) 2016 Red Hat, Inc. | ||
* Distributed under license by Red Hat, Inc. All rights reserved. | ||
* This program is made available under the terms of the | ||
* Eclipse Public License v1.0 which accompanies this distribution, | ||
* and is available at http://www.eclipse.org/legal/epl-v10.html | ||
* | ||
* Contributors: | ||
* Red Hat, Inc. - initial API and implementation | ||
******************************************************************************/ | ||
package com.openshift.restclient.model.volume; | ||
|
||
/** | ||
* VolumeSource for hostpath volumes of a pod | ||
* @author jeff.cantrill | ||
* | ||
*/ | ||
public interface IHostPathVolumeSource extends IVolumeSource { | ||
|
||
/** | ||
* Host path mapped into a pod | ||
* @return | ||
*/ | ||
String getPath(); | ||
|
||
void setPath(String path); | ||
} |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
51 changes: 51 additions & 0 deletions
51
src/test/java/com/openshift/internal/restclient/model/v1/HostPathVolumeSourceTest.java
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,51 @@ | ||
/******************************************************************************* | ||
* Copyright (c) 2016 Red Hat, Inc. | ||
* Distributed under license by Red Hat, Inc. All rights reserved. | ||
* This program is made available under the terms of the | ||
* Eclipse Public License v1.0 which accompanies this distribution, | ||
* and is available at http://www.eclipse.org/legal/epl-v10.html | ||
* | ||
* Contributors: | ||
* Red Hat, Inc. - initial API and implementation | ||
******************************************************************************/ | ||
package com.openshift.internal.restclient.model.v1; | ||
|
||
import static org.hamcrest.CoreMatchers.is; | ||
import static org.junit.Assert.assertThat; | ||
|
||
import org.jboss.dmr.ModelNode; | ||
import org.junit.Before; | ||
import org.junit.Test; | ||
|
||
import com.openshift.internal.restclient.model.ModelNodeBuilder; | ||
import com.openshift.internal.restclient.model.volume.VolumeSource; | ||
import com.openshift.restclient.model.volume.IHostPathVolumeSource; | ||
|
||
public class HostPathVolumeSourceTest { | ||
|
||
private IHostPathVolumeSource source; | ||
|
||
@Before | ||
public void setUp() throws Exception { | ||
ModelNode node = new ModelNodeBuilder() | ||
.set("name", "somevolumesourcename") | ||
.set("hostPath", new ModelNodeBuilder() | ||
.set("path", "/foo").build()).build(); | ||
source = (IHostPathVolumeSource) VolumeSource.create(node); | ||
} | ||
|
||
@Test | ||
public void testName() { | ||
assertThat(source.getName(), is("somevolumesourcename")); | ||
source.setName("thenewname"); | ||
assertThat(source.getName(), is("thenewname")); | ||
} | ||
|
||
@Test | ||
public void testPath() { | ||
assertThat(source.getPath(), is("/foo")); | ||
source.setPath("thenewpath"); | ||
assertThat(source.getPath(), is("thenewpath")); | ||
} | ||
|
||
} |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
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.
dare to correct identation for great and consistent code formatting experience?
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.
fixed. Modified my IDE to replace all tabs with spaces