Skip to content

Commit

Permalink
Bump fabric8 kubernetes-client from 4.1.3 to 4.6.1
Browse files Browse the repository at this point in the history
* Bump sundrio.version from 0.16.4 to 0.17.2
* Remove KubernetesDeserializer thread safety workaround.
* Simplify code used to turn off HTTP/2, utilizing new method in KC 4.4.0
* Remove generic parameter from KubernetesResource (relates to fabric8io/kubernetes-client#1661)
* Workaround Fabric8 API change by making cascade desire explict (see fabric8io/kubernetes-client#1840)
  • Loading branch information
k-wall committed Oct 30, 2019
1 parent 7dc419c commit ee65eb2
Show file tree
Hide file tree
Showing 20 changed files with 33 additions and 215 deletions.
6 changes: 0 additions & 6 deletions address-space-controller/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -142,12 +142,6 @@
<exclude>META-INF/*.RSA</exclude>
</excludes>
</filter>
<filter>
<artifact>io.fabric8:kubernetes-model</artifact>
<excludes>
<exclude>io/fabric8/kubernetes/internal/KubernetesDeserializer**</exclude>
</excludes>
</filter>
</filters>
</configuration>
</execution>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -112,14 +112,14 @@ public static boolean isStatefulSet(HasMetadata res) {

@Override
public void deleteResourcesNotIn(String [] uuids) {
client.apps().statefulSets().withLabel(LabelKeys.INFRA_TYPE).withLabelNotIn(LabelKeys.INFRA_UUID, uuids).delete();
client.secrets().withLabel(LabelKeys.INFRA_TYPE).withLabelNotIn(LabelKeys.INFRA_UUID, uuids).delete();
client.configMaps().withLabel(LabelKeys.INFRA_TYPE).withLabelNotIn(LabelKeys.INFRA_UUID, uuids).delete();
client.apps().deployments().withLabel(LabelKeys.INFRA_TYPE).withLabelNotIn(LabelKeys.INFRA_UUID, uuids).delete();
client.services().withLabel(LabelKeys.INFRA_TYPE).withLabelNotIn(LabelKeys.INFRA_UUID, uuids).delete();
client.apps().statefulSets().withLabel(LabelKeys.INFRA_TYPE).withLabelNotIn(LabelKeys.INFRA_UUID, uuids).withPropagationPolicy("Background").delete();
client.secrets().withLabel(LabelKeys.INFRA_TYPE).withLabelNotIn(LabelKeys.INFRA_UUID, uuids).withPropagationPolicy("Background").delete();
client.configMaps().withLabel(LabelKeys.INFRA_TYPE).withLabelNotIn(LabelKeys.INFRA_UUID, uuids).withPropagationPolicy("Background").delete();
client.apps().deployments().withLabel(LabelKeys.INFRA_TYPE).withLabelNotIn(LabelKeys.INFRA_UUID, uuids).withPropagationPolicy("Background").delete();
client.services().withLabel(LabelKeys.INFRA_TYPE).withLabelNotIn(LabelKeys.INFRA_UUID, uuids).withPropagationPolicy("Background").delete();
client.persistentVolumeClaims().withLabel(LabelKeys.INFRA_TYPE).withLabelNotIn(LabelKeys.INFRA_UUID, uuids).delete();
if (isOpenShift) {
client.adapt(OpenShiftClient.class).routes().withLabel(LabelKeys.INFRA_TYPE).withLabelNotIn(LabelKeys.INFRA_UUID, uuids).delete();
client.adapt(OpenShiftClient.class).routes().withLabel(LabelKeys.INFRA_TYPE).withLabelNotIn(LabelKeys.INFRA_UUID, uuids).withPropagationPolicy("Background").delete();
}
}

Expand Down
1 change: 1 addition & 0 deletions api-model/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -49,6 +49,7 @@
<dependency>
<groupId>org.slf4j</groupId>
<artifactId>slf4j-api</artifactId>
<scope>test</scope>
</dependency>
<dependency>
<groupId>com.google.guava</groupId>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@

@SuppressWarnings("serial")
public abstract class AbstractList<T extends HasMetadata> extends AbstractResource<T>
implements KubernetesResource<T>, KubernetesResourceList<T> {
implements KubernetesResource, KubernetesResourceList<T> {

@Valid
private ListMeta metadata = new ListMeta();
Expand Down

This file was deleted.

6 changes: 0 additions & 6 deletions api-server/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -148,12 +148,6 @@
<exclude>META-INF/*.RSA</exclude>
</excludes>
</filter>
<filter>
<artifact>io.fabric8:kubernetes-model</artifact>
<excludes>
<exclude>io/fabric8/kubernetes/internal/KubernetesDeserializer**</exclude>
</excludes>
</filter>
</filters>
</configuration>
</execution>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -134,7 +134,7 @@ public void deleteAddresses(String namespace) {
labels.put(LabelKeys.INFRA_UUID, infraUuid);
labels.put(LabelKeys.NAMESPACE, namespace);

client.configMaps().withLabels(labels).delete();
client.configMaps().withLabels(labels).withPropagationPolicy("Background").delete();
}

@Override
Expand Down Expand Up @@ -220,7 +220,7 @@ private ConfigMap create(Address address) {

@Override
public boolean deleteAddress(Address address) {
Boolean deleted = client.configMaps().withName(getConfigMapName(address.getMetadata().getNamespace(), address.getMetadata().getName())).delete();
Boolean deleted = client.configMaps().withName(getConfigMapName(address.getMetadata().getNamespace(), address.getMetadata().getName())).cascading(true).delete();
return deleted != null && deleted;
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -144,7 +144,7 @@ private ConfigMap create(AddressSpace addressSpace) {
@Override
public boolean deleteAddressSpace(AddressSpace addressSpace) {
String name = getConfigMapName(addressSpace.getMetadata().getNamespace(), addressSpace.getMetadata().getName());
Boolean deleted = client.configMaps().withName(name).delete();
Boolean deleted = client.configMaps().withName(name).cascading(true).delete();
return deleted != null && deleted;
}

Expand Down Expand Up @@ -187,7 +187,7 @@ public void deleteAddressSpaces(String namespace) {
Map<String, String> labels = new LinkedHashMap<>();
labels.put(LabelKeys.TYPE, "address-space");
labels.put(LabelKeys.NAMESPACE, namespace);
client.configMaps().withLabels(labels).delete();
client.configMaps().withLabels(labels).withPropagationPolicy("Background").delete();
}

private AddressSpace getAddressSpaceFromConfig(ConfigMap map) {
Expand Down
4 changes: 2 additions & 2 deletions pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -42,8 +42,8 @@
<maven.compiler.target>11</maven.compiler.target>

<avro.version>1.9.0</avro.version>
<fabric8.kubernetes-client.version>4.1.3</fabric8.kubernetes-client.version>
<sundrio.version>0.16.4</sundrio.version>
<fabric8.kubernetes-client.version>4.6.1</fabric8.kubernetes-client.version>
<sundrio.version>0.17.2</sundrio.version>
<vertx.version>3.7.1</vertx.version>
<slf4j.version>1.7.21</slf4j.version>
<logback.version>1.2.3</logback.version>
Expand Down
6 changes: 0 additions & 6 deletions service-broker/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -148,12 +148,6 @@
<exclude>META-INF/*.RSA</exclude>
</excludes>
</filter>
<filter>
<artifact>io.fabric8:kubernetes-model</artifact>
<excludes>
<exclude>io/fabric8/kubernetes/internal/KubernetesDeserializer**</exclude>
</excludes>
</filter>
</filters>
</configuration>
</execution>
Expand Down
8 changes: 0 additions & 8 deletions standard-controller/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -110,14 +110,6 @@
<mainClass>io.enmasse.controller.standard.StandardController</mainClass>
</transformer>
</transformers>
<filters>
<filter>
<artifact>io.fabric8:kubernetes-model</artifact>
<excludes>
<exclude>io/fabric8/kubernetes/internal/KubernetesDeserializer**</exclude>
</excludes>
</filter>
</filters>
</configuration>
</execution>
</executions>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -166,7 +166,7 @@ public void apply(HasMetadata resource, boolean patchPersistentVolumeClaims, boo

@Override
public void delete(KubernetesList resources) {
client.lists().delete(resources);
resources.getItems().forEach( resource -> client.resource(resource).cascading(true).delete());
}

@Override
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -537,7 +537,7 @@ public void createNamespace(String namespace) {
public void deleteNamespace(String namespace) throws Exception {
log.info("Following namespace will be removed - {}", namespace);
if (namespaceExists(namespace)) {
client.namespaces().withName(namespace).delete();
client.namespaces().withName(namespace).cascading(true).delete();

TestUtils.waitUntilCondition("Namespace will be deleted", phase ->
!namespaceExists(namespace), new TimeoutBudget(5, TimeUnit.MINUTES));
Expand All @@ -553,7 +553,7 @@ public boolean namespaceExists(String namespace) {

public void deletePod(String namespace, Map<String, String> labels) {
log.info("Delete pods with labels: {}", labels.toString());
client.pods().inNamespace(namespace).withLabels(labels).delete();
client.pods().inNamespace(namespace).withLabels(labels).withPropagationPolicy("Background").delete();
}

/***
Expand All @@ -578,7 +578,7 @@ public void createPodFromTemplate(String namespace, String configName) throws Ex
* @throws Exception
*/
public void deletePod(String namespace, String podName) {
client.pods().inNamespace(namespace).withName(podName).delete();
client.pods().inNamespace(namespace).withName(podName).cascading(true).delete();
log.info("Pod {} removed", podName);
}

Expand Down Expand Up @@ -647,7 +647,7 @@ public void createIngressFromResource(String namespace, Ingress resources) {
* @param ingressName ingress name
*/
public void deleteIngress(String namespace, String ingressName) {
client.extensions().ingresses().inNamespace(namespace).withName(ingressName).delete();
client.extensions().ingresses().inNamespace(namespace).withName(ingressName).cascading(true).delete();
log.info("Ingress {} deleted", ingressName);
}

Expand Down Expand Up @@ -696,7 +696,7 @@ public void createConfigmapFromResource(String namespace, ConfigMap resources) {
* @param configmapName configmap
*/
public void deleteConfigmap(String namespace, String configmapName) {
client.configMaps().inNamespace(namespace).withName(configmapName).delete();
client.configMaps().inNamespace(namespace).withName(configmapName).cascading(true).delete();
log.info("Configmap {} in namespace {} deleted", configmapName, namespace);
}

Expand All @@ -718,7 +718,7 @@ public boolean configmapExists(String namespace, String configmapName) {
* @param appName
*/
public void deleteDeployment(String namespace, String appName) {
client.apps().deployments().inNamespace(namespace).withName(appName).delete();
client.apps().deployments().inNamespace(namespace).withName(appName).cascading(true).delete();
log.info("Deployment {} removed", appName);
}

Expand All @@ -739,7 +739,7 @@ public boolean deploymentExists(String namespace, String appName) {
* @param serviceName service name
*/
public void deleteService(String namespace, String serviceName) {
client.services().inNamespace(namespace).withName(serviceName).delete();
client.services().inNamespace(namespace).withName(serviceName).cascading(true).delete();
log.info("Service {} removed", serviceName);
}

Expand Down Expand Up @@ -859,7 +859,7 @@ public String createServiceAccount(String name, String namespace) {
*/
public String deleteServiceAccount(String name, String namespace) {
log.info("Delete serviceaccount {} from namespace {}", name, namespace);
client.serviceAccounts().inNamespace(namespace).withName(name).delete();
client.serviceAccounts().inNamespace(namespace).withName(name).cascading(true).delete();
return "system:serviceaccount:" + namespace + ":" + name;
}

Expand Down Expand Up @@ -936,7 +936,7 @@ public void createSecret(String namespace, Secret resources) {
* @param secret secret name
*/
public void deleteSecret(String namespace, String secret) {
client.secrets().inNamespace(namespace).withName(secret).delete();
client.secrets().inNamespace(namespace).withName(secret).cascading(true).delete();
log.info("Secret {} deleted", secret);
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -121,6 +121,6 @@ public void deleteExternalEndpoint(String namespace, String name) {
if (!name.endsWith("-external")) {
name += "-external";
}
client.services().inNamespace(name).withName(name).delete();
client.services().inNamespace(name).withName(name).cascading(true).delete();
}
}
Loading

0 comments on commit ee65eb2

Please sign in to comment.