Merge branch 'main' into testing
This commit is contained in:
commit
2ea6d9457d
8 changed files with 15 additions and 6 deletions
|
|
@ -3,9 +3,9 @@
|
||||||
The CRD must be deployed independently. Apart from that, the
|
The CRD must be deployed independently. Apart from that, the
|
||||||
`kustomize.yaml`
|
`kustomize.yaml`
|
||||||
|
|
||||||
* creates a small cdrom image repository and
|
* creates a small cdrom image repository and
|
||||||
|
|
||||||
* deploys the operator in namespace `vmop-dev` with a replica of 0.
|
* deploys the operator in namespace `vmop-dev` with a replica of 0.
|
||||||
|
|
||||||
This allows you to run the manager in your IDE.
|
This allows you to run the manager in your IDE.
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -98,6 +98,8 @@ import org.yaml.snakeyaml.constructor.SafeConstructor;
|
||||||
channel.setAssociated(PrevData.class, prevData);
|
channel.setAssociated(PrevData.class, prevData);
|
||||||
|
|
||||||
// Combine template and data and parse result
|
// Combine template and data and parse result
|
||||||
|
logger.fine(() -> "Create/update configmap "
|
||||||
|
+ DataPath.<String> get(model, "cr", "name").orElse("unknown"));
|
||||||
model.put("adjustCloudInitMeta", adjustCloudInitMetaModel);
|
model.put("adjustCloudInitMeta", adjustCloudInitMetaModel);
|
||||||
prevData.added.put("adjustCloudInitMeta", adjustCloudInitMetaModel);
|
prevData.added.put("adjustCloudInitMeta", adjustCloudInitMetaModel);
|
||||||
var fmTemplate = fmConfig.getTemplate("runnerConfig.ftl.yaml");
|
var fmTemplate = fmConfig.getTemplate("runnerConfig.ftl.yaml");
|
||||||
|
|
|
||||||
|
|
@ -182,7 +182,7 @@ public class Controller extends Component {
|
||||||
fire(new Exit(2));
|
fire(new Exit(2));
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
logger.fine(() -> "Controlling namespace \"" + namespace + "\".");
|
logger.config(() -> "Controlling namespace \"" + namespace + "\".");
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
|
|
||||||
|
|
@ -155,9 +155,11 @@ public class DisplaySecretReconciler extends Component {
|
||||||
}
|
}
|
||||||
|
|
||||||
// Create secret
|
// Create secret
|
||||||
|
var secretName = vmDef.name() + "-" + DisplaySecret.NAME;
|
||||||
|
logger.fine(() -> "Create/update secret " + secretName);
|
||||||
var secret = new V1Secret();
|
var secret = new V1Secret();
|
||||||
secret.setMetadata(new V1ObjectMeta().namespace(vmDef.namespace())
|
secret.setMetadata(new V1ObjectMeta().namespace(vmDef.namespace())
|
||||||
.name(vmDef.name() + "-" + DisplaySecret.NAME)
|
.name(secretName)
|
||||||
.putLabelsItem("app.kubernetes.io/name", APP_NAME)
|
.putLabelsItem("app.kubernetes.io/name", APP_NAME)
|
||||||
.putLabelsItem("app.kubernetes.io/component", DisplaySecret.NAME)
|
.putLabelsItem("app.kubernetes.io/component", DisplaySecret.NAME)
|
||||||
.putLabelsItem("app.kubernetes.io/instance", vmDef.name()));
|
.putLabelsItem("app.kubernetes.io/instance", vmDef.name()));
|
||||||
|
|
|
||||||
|
|
@ -36,6 +36,7 @@ import java.util.logging.Logger;
|
||||||
import org.jdrupes.vmoperator.common.K8sV1ServiceStub;
|
import org.jdrupes.vmoperator.common.K8sV1ServiceStub;
|
||||||
import org.jdrupes.vmoperator.common.VmDefinition;
|
import org.jdrupes.vmoperator.common.VmDefinition;
|
||||||
import org.jdrupes.vmoperator.manager.events.VmChannel;
|
import org.jdrupes.vmoperator.manager.events.VmChannel;
|
||||||
|
import org.jdrupes.vmoperator.util.DataPath;
|
||||||
import org.jdrupes.vmoperator.util.GsonPtr;
|
import org.jdrupes.vmoperator.util.GsonPtr;
|
||||||
import org.yaml.snakeyaml.LoaderOptions;
|
import org.yaml.snakeyaml.LoaderOptions;
|
||||||
import org.yaml.snakeyaml.Yaml;
|
import org.yaml.snakeyaml.Yaml;
|
||||||
|
|
@ -107,6 +108,8 @@ import org.yaml.snakeyaml.constructor.SafeConstructor;
|
||||||
}
|
}
|
||||||
|
|
||||||
// Combine template and data and parse result
|
// Combine template and data and parse result
|
||||||
|
logger.fine(() -> "Create/update load balancer service for "
|
||||||
|
+ DataPath.<String> get(model, "cr", "name").orElse("unknown"));
|
||||||
var fmTemplate = fmConfig.getTemplate("runnerLoadBalancer.ftl.yaml");
|
var fmTemplate = fmConfig.getTemplate("runnerLoadBalancer.ftl.yaml");
|
||||||
StringWriter out = new StringWriter();
|
StringWriter out = new StringWriter();
|
||||||
fmTemplate.process(model, out);
|
fmTemplate.process(model, out);
|
||||||
|
|
|
||||||
|
|
@ -264,7 +264,7 @@ public class Manager extends Component {
|
||||||
*/
|
*/
|
||||||
@Handler(priority = -1000)
|
@Handler(priority = -1000)
|
||||||
public void onStop(Stop event) {
|
public void onStop(Stop event) {
|
||||||
logger.fine(() -> "Application stopped.");
|
logger.info(() -> "Application stopped.");
|
||||||
}
|
}
|
||||||
|
|
||||||
static {
|
static {
|
||||||
|
|
|
||||||
|
|
@ -139,6 +139,7 @@ import org.yaml.snakeyaml.constructor.SafeConstructor;
|
||||||
|
|
||||||
// Generate PVC
|
// Generate PVC
|
||||||
var runnerDataPvcName = vmDef.name() + "-runner-data";
|
var runnerDataPvcName = vmDef.name() + "-runner-data";
|
||||||
|
logger.fine(() -> "Create/update pvc " + runnerDataPvcName);
|
||||||
model.put("runnerDataPvcName", runnerDataPvcName);
|
model.put("runnerDataPvcName", runnerDataPvcName);
|
||||||
if (!specChanged) {
|
if (!specChanged) {
|
||||||
// Augmenting the model is all we have to do
|
// Augmenting the model is all we have to do
|
||||||
|
|
@ -180,6 +181,7 @@ import org.yaml.snakeyaml.constructor.SafeConstructor;
|
||||||
}
|
}
|
||||||
|
|
||||||
// Generate PVC
|
// Generate PVC
|
||||||
|
logger.fine(() -> "Create/update pvc " + pvcName);
|
||||||
model.put("disk", diskDef);
|
model.put("disk", diskDef);
|
||||||
var fmTemplate = fmConfig.getTemplate("runnerDiskPvc.ftl.yaml");
|
var fmTemplate = fmConfig.getTemplate("runnerDiskPvc.ftl.yaml");
|
||||||
StringWriter out = new StringWriter();
|
StringWriter out = new StringWriter();
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue