Skip to content
This repository has been archived by the owner on Jun 19, 2024. It is now read-only.

Commit

Permalink
(Chore) : Update Kubernetes client to 4.1.1
Browse files Browse the repository at this point in the history
+ Updated kubernetes-client to 4.1.1
+ Removed references to PolicyBinding since it is removed from kubernetes
+ Updated license headers for failing license check, added entry to changelog
  • Loading branch information
rohanKanojia committed Dec 26, 2018
1 parent 7ee77fe commit f4a3459
Show file tree
Hide file tree
Showing 11 changed files with 10 additions and 67 deletions.
1 change: 1 addition & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@ After this we will switch probably to real [Semantic Versioning 2.0.0](http://se

* Feature 729: Select custom resources depending on environment.
* Feature 601: Adds healthcheck for webapp
* Fix 1460: Upgraded kubernetes client to 4.1.1

### 4.0.0-M2 (2018-12-14)
* Fix 10: Make VolumeConfiguration more flexible
Expand Down
58 changes: 0 additions & 58 deletions core/src/main/java/io/fabric8/maven/core/service/ApplyService.java
Original file line number Diff line number Diff line change
Expand Up @@ -56,7 +56,6 @@
import io.fabric8.openshift.api.model.ImageStream;
import io.fabric8.openshift.api.model.ImageStreamSpec;
import io.fabric8.openshift.api.model.OAuthClient;
import io.fabric8.openshift.api.model.PolicyBinding;
import io.fabric8.openshift.api.model.Project;
import io.fabric8.openshift.api.model.ProjectRequest;
import io.fabric8.openshift.api.model.Role;
Expand Down Expand Up @@ -147,8 +146,6 @@ private void applyEntity(Object dto, String sourceName) throws Exception {
} else {
log.warn("Not connected to OpenShift cluster so cannot apply entity " + dto);
}
} else if (dto instanceof PolicyBinding) {
applyPolicyBinding((PolicyBinding) dto, sourceName);
} else if (dto instanceof RoleBinding) {
applyRoleBinding((RoleBinding) dto, sourceName);
} else if (dto instanceof Role) {
Expand Down Expand Up @@ -695,61 +692,6 @@ public void doCreateRoleBinding(RoleBinding entity, String namespace , String so
}
}

public void applyPolicyBinding(PolicyBinding entity, String sourceName) {
OpenShiftClient openShiftClient = getOpenShiftClient();
if (openShiftClient != null) {
String id = getName(entity);

Objects.requireNonNull(id, "No name for " + entity + " " + sourceName);
String namespace = KubernetesHelper.getNamespace(entity);
if (StringUtils.isBlank(namespace)) {
namespace = getNamespace();
}
applyNamespace(namespace);
PolicyBinding old = openShiftClient.policyBindings().inNamespace(namespace).withName(id).get();
if (isRunning(old)) {
if (UserConfigurationCompare.configEqual(entity, old)) {
log.info("PolicyBinding has not changed so not doing anything");
} else {
if (isRecreateMode()) {
log.info("Deleting PolicyBinding: " + id);
openShiftClient.policyBindings().inNamespace(namespace).withName(id).delete();
doCreatePolicyBinding(entity, namespace, sourceName);
} else {
log.info("Updating PolicyBinding from " + sourceName);
try {
String resourceVersion = KubernetesHelper.getResourceVersion(old);
ObjectMeta metadata = getOrCreateMetadata(entity);
metadata.setNamespace(namespace);
metadata.setResourceVersion(resourceVersion);
Object answer = openShiftClient.policyBindings().inNamespace(namespace).withName(id).replace(entity);
logGeneratedEntity("Updated PolicyBinding: ", namespace, entity, answer);
} catch (Exception e) {
onApplyError("Failed to update PolicyBinding from " + sourceName + ". " + e + ". " + entity, e);
}
}
}
} else {
if (!isAllowCreate()) {
log.warn("Creation disabled so not creating PolicyBinding from " + sourceName + " namespace " + namespace + " name " + getName(entity));
} else {
doCreatePolicyBinding(entity, namespace, sourceName);
}
}
}
}

public void doCreatePolicyBinding(PolicyBinding entity, String namespace , String sourceName) {
OpenShiftClient openShiftClient = getOpenShiftClient();
if (openShiftClient != null) {
try {
openShiftClient.policyBindings().inNamespace(namespace).create(entity);
} catch (Exception e) {
onApplyError("Failed to create PolicyBinding from " + sourceName + ". " + e, e);
}
}
}

public void applyImageStream(ImageStream entity, String sourceName) {
OpenShiftClient openShiftClient = getOpenShiftClient();
if (openShiftClient != null) {
Expand Down
2 changes: 1 addition & 1 deletion it/src/it/custom-environment/expected/kubernetes.yml
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
#
# Copyright 2018 Red Hat, Inc.
# Copyright 2016 Red Hat, Inc.
#
# Red Hat licenses this file to you under the Apache License, version
# 2.0 (the "License"); you may not use this file except in compliance
Expand Down
2 changes: 1 addition & 1 deletion it/src/it/custom-environment/expected/openshift.yml
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
#
# Copyright 2018 Red Hat, Inc.
# Copyright 2016 Red Hat, Inc.
#
# Red Hat licenses this file to you under the Apache License, version
# 2.0 (the "License"); you may not use this file except in compliance
Expand Down
2 changes: 1 addition & 1 deletion it/src/it/custom-environment/invoker.properties
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
#
# Copyright 2018 Red Hat, Inc.
# Copyright 2016 Red Hat, Inc.
#
# Red Hat licenses this file to you under the Apache License, version
# 2.0 (the "License"); you may not use this file except in compliance
Expand Down
2 changes: 1 addition & 1 deletion it/src/it/custom-environment/pom.xml
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
<?xml version="1.0" encoding="UTF-8"?>
<!--
Copyright 2018 Red Hat, Inc.
Copyright 2016 Red Hat, Inc.
Red Hat licenses this file to you under the Apache License, version
2.0 (the "License"); you may not use this file except in compliance
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
#
# Copyright 2018 Red Hat, Inc.
# Copyright 2016 Red Hat, Inc.
#
# Red Hat licenses this file to you under the Apache License, version
# 2.0 (the "License"); you may not use this file except in compliance
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/**
* Copyright 2018 Red Hat, Inc.
* Copyright 2016 Red Hat, Inc.
*
* Red Hat licenses this file to you under the Apache License, version
* 2.0 (the "License"); you may not use this file except in compliance
Expand Down
2 changes: 1 addition & 1 deletion it/src/it/custom-environment/verify.groovy
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/**
* Copyright 2018 Red Hat, Inc.
* Copyright 2016 Red Hat, Inc.
*
* Red Hat licenses this file to you under the Apache License, version
* 2.0 (the "License"); you may not use this file except in compliance
Expand Down
2 changes: 1 addition & 1 deletion parent/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -64,7 +64,7 @@
<jmockit.version>1.43</jmockit.version>
<version.maven>3.3.1</version.maven>
<version.jacoco>0.8.2</version.jacoco>
<version.kubernetes-client>4.1.0</version.kubernetes-client>
<version.kubernetes-client>4.1.1</version.kubernetes-client>
<version.openshift-client>${version.kubernetes-client}</version.openshift-client>
<version.mockwebserver>0.0.13</version.mockwebserver>
<version.docker-maven-plugin>0.28.0</version.docker-maven-plugin>
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/**
* Copyright 2018 Red Hat, Inc.
* Copyright 2016 Red Hat, Inc.
*
* Red Hat licenses this file to you under the Apache License, version
* 2.0 (the "License"); you may not use this file except in compliance
Expand Down

0 comments on commit f4a3459

Please sign in to comment.