private static EntityPatcher<Pod> podPatcher() {
return (KubernetesClient client, String namespace, Pod newObj, Pod oldObj) -> {
if (UserConfigurationCompare.configEqual(newObj, oldObj)) {
return oldObj;
}
DoneablePod entity =
client.pods()
.inNamespace(namespace)
.withName(oldObj.getMetadata().getName())
.edit();
if (!UserConfigurationCompare.configEqual(newObj.getMetadata(), oldObj.getMetadata())) {
entity.withMetadata(newObj.getMetadata());
}
if(!UserConfigurationCompare.configEqual(newObj.getSpec(), oldObj.getSpec())) {
entity.withSpec(newObj.getSpec());
}
return entity.done();
};
}