Rename methods.

This commit is contained in:
Michael Lipp 2023-08-08 20:14:55 +02:00
parent 65306f27b3
commit cc77a81f8e
2 changed files with 10 additions and 10 deletions

View file

@ -103,12 +103,12 @@ public class Reconciler extends Component {
// Update state
if (event.type() != Type.DELETED) {
channel.setState(
channel.setVmDefinition(
patchCr(K8s.get(vmCrApi, defMeta).get().getRaw().deepCopy()));
}
// Get common data for all reconciles
JsonObject vmDef = channel.state();
JsonObject vmDef = channel.vmDefinition();
@SuppressWarnings("PMD.UseConcurrentHashMap")
Map<String, Object> model = new HashMap<>();
model.put("cr", vmDef);

View file

@ -31,7 +31,7 @@ public class VmChannel extends DefaultSubchannel {
private final EventPipeline pipeline;
private final ApiClient client;
private JsonObject state;
private JsonObject vmDefinition;
/**
* Instantiates a new watch channel.
@ -48,24 +48,24 @@ public class VmChannel extends DefaultSubchannel {
}
/**
* Sets the last known state of the resource.
* Sets the last known definition of the resource.
*
* @param state the state
* @param definition the definition
* @return the watch channel
*/
@SuppressWarnings("PMD.LinguisticNaming")
public VmChannel setState(JsonObject state) {
this.state = state;
public VmChannel setVmDefinition(JsonObject definition) {
this.vmDefinition = definition;
return this;
}
/**
* Returns the last known state of the resource.
* Returns the last known definition of the VM.
*
* @return the json object
*/
public JsonObject state() {
return state;
public JsonObject vmDefinition() {
return vmDefinition;
}
/**