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

Update Kubernetes Client to 6.X.X #532

Merged
merged 1 commit into from
Sep 8, 2023

Conversation

RoyalKarma
Copy link

Adding compatibility with Kubernetes Client 6.X.X.

Copy link
Contributor

@simkam simkam left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

comments in code, please fix all deletes in OpenShift.java, I commented only few of them

@mnovak1
Copy link
Contributor

mnovak1 commented Mar 23, 2023

@RoyalKarma thanks, we will need CI run with EAP Openshift TS before this gets merged.

core/pom.xml Outdated Show resolved Hide resolved
core/src/main/java/cz/xtf/core/openshift/OpenShift.java Outdated Show resolved Hide resolved
@@ -60,9 +60,9 @@
private IntOrString getPort() {
IntOrStringBuilder builder = new IntOrStringBuilder();
if (StringUtils.isNumeric(port)) {
builder.withIntVal(Integer.valueOf(port));
builder.withValue(Integer.valueOf(port));

Check notice

Code scanning / CodeQL

Missing catch of NumberFormatException Note

Potential uncaught 'java.lang.NumberFormatException'.
@RoyalKarma RoyalKarma force-pushed the update_kn_client branch 2 times, most recently from fe8dfa8 to 73d9f1d Compare May 9, 2023 16:25
jstourac added a commit to jstourac/intersmash that referenced this pull request May 25, 2023
jstourac added a commit to jstourac/intersmash that referenced this pull request May 25, 2023
@tommaso-borgato tommaso-borgato added this to the BACKLOG milestone Jun 22, 2023
@RoyalKarma RoyalKarma marked this pull request as ready for review July 12, 2023 09:47
@RoyalKarma RoyalKarma changed the title Draft: Update Kubernetes Client to 6.4.1 Update Kubernetes Client to 6.4.1 Jul 12, 2023
Copy link
Contributor

@mnovak1 mnovak1 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM, only question to update to latest version.

pom.xml Outdated Show resolved Hide resolved
@@ -85,7 +85,7 @@
String tempName = image.getRepo() + "-" + randomString();
ImageStream imageStream = image.getImageStream(tempName);
imageStream.getMetadata().setName(tempName);
openShift.imageStreams().createOrReplace(imageStream);
openShift.imageStreams().resource(imageStream).createOrReplace();

Check notice

Code scanning / CodeQL

Deprecated method or constructor invocation Note

Invoking
CreateOrReplaceable.createOrReplace
should be avoided because it has been deprecated.
Copy link
Contributor

@fabiobrz fabiobrz left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This seems to be working for Intersmash.

As a side note, projects depending on strimzi for Kafka would have issues since their latest release (0.36.1) supports Fabric8 Kubernetes client v. 6.7.2, which is not compatible with 6.8.1 (planned for 0.37).
Anyway, this is just a side note, as it's related to other projects' dependency configuration, rather than to the changes in this PR.

@RoyalKarma
Copy link
Author

RoyalKarma commented Sep 4, 2023

TS run after update to 6.8.1
edit: Test run: eap-8.x-openshift-ts-face/65/ : todo add screenshot

@RoyalKarma RoyalKarma changed the title Update Kubernetes Client to 6.4.1 Update Kubernetes Client to 6.X.X Sep 4, 2023
Copy link
Contributor

@simkam simkam left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

please squash commits

.withData(Collections.singletonMap(".dockerconfigjson", Base64.getEncoder().encodeToString(secret.getBytes())))
.build();
secrets().createOrReplace(pullSecret);
secrets().resource(pullSecret).createOrReplace();

Check notice

Code scanning / CodeQL

Deprecated method or constructor invocation Note

Invoking
CreateOrReplaceable.createOrReplace
should be avoided because it has been deprecated.
@@ -729,12 +735,13 @@
}

private boolean deleteReplicationController(ReplicationController replicationController) {
return replicationControllers().withName(replicationController.getMetadata().getName()).cascading(false).delete();
return !replicationControllers().withName(replicationController.getMetadata().getName()).cascading(false).delete()

Check notice

Code scanning / CodeQL

Deprecated method or constructor invocation Note

Invoking
Resource.cascading
should be avoided because it has been deprecated.
@@ -759,7 +766,7 @@
}

public DeploymentConfig updateDeploymentconfig(DeploymentConfig deploymentConfig) {
return deploymentConfigs().withName(deploymentConfig.getMetadata().getName()).replace(deploymentConfig);
return deploymentConfigs().withName(deploymentConfig.getMetadata().getName()).replace();

Check notice

Code scanning / CodeQL

Deprecated method or constructor invocation Note

Invoking
Replaceable.replace
should be avoided because it has been deprecated.
@@ -787,7 +794,7 @@
}

public boolean deleteDeploymentConfig(DeploymentConfig deploymentConfig, boolean cascading) {
return deploymentConfigs().withName(deploymentConfig.getMetadata().getName()).cascading(cascading).delete();
return !deploymentConfigs().withName(deploymentConfig.getMetadata().getName()).cascading(cascading).delete().isEmpty();

Check notice

Code scanning / CodeQL

Deprecated method or constructor invocation Note

Invoking
Resource.cascading
should be avoided because it has been deprecated.
@@ -869,7 +876,7 @@
}

public BuildConfig updateBuildConfig(BuildConfig buildConfig) {
return buildConfigs().withName(buildConfig.getMetadata().getName()).replace(buildConfig);
return buildConfigs().withName(buildConfig.getMetadata().getName()).replace();

Check notice

Code scanning / CodeQL

Deprecated method or constructor invocation Note

Invoking
Replaceable.replace
should be avoided because it has been deprecated.
@simkam simkam merged commit 49c6b3e into xtf-cz:master Sep 8, 2023
4 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants