Skip to content

Commit

Permalink
Merge pull request #1438 from dwalluck/kube-api
Browse files Browse the repository at this point in the history
Replace deprecated fabric8 kube APIs
  • Loading branch information
stuartwdouglas authored Mar 20, 2024
2 parents 9963b79 + c6d549a commit f576d94
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 4 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@
import io.fabric8.kubernetes.api.model.KubernetesResourceList;
import io.fabric8.kubernetes.client.KubernetesClient;
import io.fabric8.kubernetes.client.dsl.MixedOperation;
import io.fabric8.kubernetes.client.dsl.NonDeletingOperation;
import io.fabric8.kubernetes.client.dsl.Resource;
import io.quarkus.logging.Log;
import picocli.CommandLine;
Expand All @@ -34,13 +35,13 @@ public void run() {
if (!build.isEmpty()) {
ArtifactBuild request = client.withName(build).get();
request.getMetadata().setAnnotations(Map.of("jvmbuildservice.io/rebuild", "true"));
client.createOrReplace(request);
client.resource(request).unlock().createOr(NonDeletingOperation::update);
} else {
List<ArtifactBuild> items = client.list().getItems();
for (var request : items) {
if (!missing || request.getStatus().getState().equals("ArtifactBuildMissing")) {
request.getMetadata().setAnnotations(Map.of("jvmbuildservice.io/rebuild", "true"));
client.createOrReplace(request);
client.resource(request).unlock().createOr(NonDeletingOperation::update);
}
}
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -33,14 +33,14 @@ public void run() {
DependencyBuild item = client.withName(build).get();
item.getStatus().setState("");
// item.getStatus().setFailedBuildRecipes(Collections.emptyList());
client.updateStatus(item);
client.resource(item).updateStatus();
} else {
List<DependencyBuild> items = client.list().getItems();
for (var request : items) {
if (!failedOnly || request.getStatus().getState().equals("DependencyBuildStateFailed")) {
request.getStatus().setState("");
// request.getStatus().setFailedBuildRecipes(Collections.emptyList());
client.updateStatus(request);
client.resource(request).updateStatus();
}
}
}
Expand Down

0 comments on commit f576d94

Please sign in to comment.