-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
Added fabric8.openshift.setImageTriggerAutomatic flag which would be able to enable/disable automatic deployments.
- Loading branch information
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -50,7 +50,7 @@ public DeploymentOpenShiftConverter(PlatformMode mode, Long openshiftDeployTimeo | |
} | ||
|
||
@Override | ||
public HasMetadata convert(HasMetadata item, boolean trimImageInContainerSpec) { | ||
public HasMetadata convert(HasMetadata item, boolean trimImageInContainerSpec, boolean setImageTriggerAutomatic) { | ||
Deployment resource = (Deployment) item; | ||
DeploymentConfigBuilder builder = new DeploymentConfigBuilder(); | ||
builder.withMetadata(resource.getMetadata()); | ||
|
@@ -119,14 +119,24 @@ public HasMetadata convert(HasMetadata item, boolean trimImageInContainerSpec) { | |
specBuilder.addNewTrigger() | ||
.withType("ImageChange") | ||
.withNewImageChangeParams() | ||
.withAutomatic(true) | ||
.withAutomatic(setImageTriggerAutomatic) | ||
.withNewFrom() | ||
.withKind("ImageStreamTag") | ||
.withName(image.getSimpleName() + ":" + tag) | ||
.endFrom() | ||
.withContainerNames(containerName) | ||
.endImageChangeParams() | ||
.endTrigger(); | ||
|
||
if(!setImageTriggerAutomatic) { | ||
specBuilder.editLastTrigger() | ||
.editImageChangeParams() | ||
.editFrom() | ||
.withNamespace(image.getUser()) | ||
This comment has been minimized.
Sorry, something went wrong.
This comment has been minimized.
Sorry, something went wrong.
rohanKanojia
Author
Owner
|
||
.endFrom() | ||
.endImageChangeParams() | ||
.endTrigger(); | ||
} | ||
} | ||
} | ||
if(trimImageInContainerSpec) { | ||
|
Do we want it here? As they are two different things. I would like to always specify the namespace.