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

chore: upgrade to the latest sundrio. #1457

Merged
merged 1 commit into from
Mar 27, 2019
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@
* Fix #1425: Preserve labels and fields when using CRD's withResourceVersion()

Dependency Upgrade
* Upgrade Sundrio to 0.16.5
* Upgrade Sundrio to 0.17.0
* Upgrade to Bean Validation 2.0

New Feature
Expand Down
12 changes: 0 additions & 12 deletions kubernetes-tests/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -63,18 +63,6 @@
<scope>test</scope>
</dependency>


<dependency>
<groupId>org.bouncycastle</groupId>
<artifactId>bcprov-ext-jdk15on</artifactId>
<version>${bouncycastle.version}</version>
</dependency>
<dependency>
<groupId>org.bouncycastle</groupId>
<artifactId>bcpkix-jdk15on</artifactId>
<version>${bouncycastle.version}</version>
</dependency>

<dependency>
<groupId>io.fabric8</groupId>
<artifactId>mockwebserver</artifactId>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,9 @@
import static org.junit.Assert.assertNull;
import static org.junit.Assert.assertTrue;

import io.fabric8.kubernetes.api.builder.TypedVisitor;
import io.fabric8.kubernetes.api.model.ContainerFluent;
import io.fabric8.openshift.api.model.DeploymentConfigSpecFluent;
import org.junit.Rule;
import org.junit.Test;

Expand All @@ -31,6 +34,8 @@
import io.fabric8.openshift.api.model.DeploymentConfigListBuilder;
import io.fabric8.openshift.client.OpenShiftClient;

import java.util.concurrent.atomic.AtomicBoolean;

public class DeploymentConfigTest {
@Rule
public OpenShiftServer server = new OpenShiftServer();
Expand Down Expand Up @@ -180,4 +185,59 @@ public void testDeployingLatestHandlesMissingLatestVersion() {
assertNotNull(deploymentConfig);
assertEquals(new Long(1), deploymentConfig.getStatus().getLatestVersion());
}

//This is a test that verifies a recent fix (sundrio #135).
//According to this issue when editing a list of buildables using predicates, the object visitors get overwrriten.
@Test
public void testDeploymentConfigVisitor() {
AtomicBoolean visitedContainer = new AtomicBoolean();

DeploymentConfig dc1 = new DeploymentConfigBuilder()
.withNewMetadata()
.withName("dc1")
.endMetadata()
.withNewSpec()
.withReplicas(1)
.addToSelector("name", "dc1")
.addNewTrigger()
.withType("ImageChange")
.withNewImageChangeParams()
.withAutomatic(true)
.withContainerNames("container")
.withNewFrom()
.withKind("ImageStreamTag")
.withName("image:1.0")
.endFrom()
.endImageChangeParams()
.endTrigger()
.withNewTemplate()
.withNewSpec()
.addNewContainer()
.withName("container")
.withImage("image")
.endContainer()
.endSpec()
.endTemplate()
.endSpec()
.build();

DeploymentConfig dc2 = new DeploymentConfigBuilder(dc1)
.accept(new TypedVisitor<DeploymentConfigSpecFluent<?>>() {
@Override
public void visit(DeploymentConfigSpecFluent<?> spec) {
spec.editMatchingTrigger(b -> b.buildImageChangeParams().getContainerNames().contains("container"))
.withType("ImageChange")
.endTrigger();
}
})
.accept(new TypedVisitor<ContainerFluent<?>>() {
@Override
public void visit(ContainerFluent<?> container) {
container.addNewEnv().withName("FOO").withValue("BAR").endEnv();
visitedContainer.set(true);

}
}).build();
assertTrue(visitedContainer.get());
}
}
3 changes: 1 addition & 2 deletions pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -104,7 +104,7 @@
<snakeyaml.version>1.24</snakeyaml.version>
<bouncycastle.version>1.61</bouncycastle.version>
<scr.annotations.version>1.9.12</scr.annotations.version>
<sundrio.version>0.14.6</sundrio.version>
<sundrio.version>0.17.0</sundrio.version>
<validation.api.version>1.1.0.Final</validation.api.version>
<maven.bundle.plugin.version>2.5.4</maven.bundle.plugin.version>
<maven.buildhelper.plugin.version>1.10</maven.buildhelper.plugin.version>
Expand All @@ -113,7 +113,6 @@
<maven.surefire.plugin.version>3.0.0-M1</maven.surefire.plugin.version>
<maven.scr.plugin.version>1.22.0</maven.scr.plugin.version>
<scr.annotations.version>1.12.0</scr.annotations.version>
<sundrio.version>0.16.5</sundrio.version>
<validation.api.version>2.0.1.Final</validation.api.version>
<maven.bundle.plugin.version>4.1.0</maven.bundle.plugin.version>
<maven.buildhelper.plugin.version>3.0.0</maven.buildhelper.plugin.version>
Expand Down