Use names with dash for k8s, but not for directories.
This commit is contained in:
parent
eea4afac72
commit
5d5b0c07c5
3 changed files with 7 additions and 7 deletions
|
|
@ -24,7 +24,7 @@ package org.jdrupes.vmoperator.manager;
|
||||||
public class Constants {
|
public class Constants {
|
||||||
|
|
||||||
/** The Constant VM_OP_NAME. */
|
/** The Constant VM_OP_NAME. */
|
||||||
public static final String VM_OP_NAME = "vmoperator";
|
public static final String VM_OP_NAME = "vm-operator";
|
||||||
|
|
||||||
/** The Constant VM_OP_GROUP. */
|
/** The Constant VM_OP_GROUP. */
|
||||||
public static final String VM_OP_GROUP = "vmoperator.jdrupes.org";
|
public static final String VM_OP_GROUP = "vmoperator.jdrupes.org";
|
||||||
|
|
@ -33,7 +33,7 @@ public class Constants {
|
||||||
public static final String VM_OP_KIND_VM = "VirtualMachine";
|
public static final String VM_OP_KIND_VM = "VirtualMachine";
|
||||||
|
|
||||||
/** The Constant APP_NAME. */
|
/** The Constant APP_NAME. */
|
||||||
public static final String APP_NAME = "vmrunner";
|
public static final String APP_NAME = "vm-runner";
|
||||||
|
|
||||||
/** The Constant STATE_RUNNING. */
|
/** The Constant STATE_RUNNING. */
|
||||||
public static final String STATE_RUNNING = "Running";
|
public static final String STATE_RUNNING = "Running";
|
||||||
|
|
|
||||||
|
|
@ -63,7 +63,7 @@ public class Manager extends Component {
|
||||||
|
|
||||||
// Configuration store with file in /etc/opt (default)
|
// Configuration store with file in /etc/opt (default)
|
||||||
File config = new File(cmdLine.getOptionValue('c',
|
File config = new File(cmdLine.getOptionValue('c',
|
||||||
"/etc/opt/" + VM_OP_NAME + "/config.yaml"));
|
"/etc/opt/" + VM_OP_NAME.replace("-", "") + "/config.yaml"));
|
||||||
// Don't rely on night config to produce a good exception
|
// Don't rely on night config to produce a good exception
|
||||||
// for this simple case
|
// for this simple case
|
||||||
if (!Files.isReadable(config.toPath())) {
|
if (!Files.isReadable(config.toPath())) {
|
||||||
|
|
@ -86,8 +86,8 @@ public class Manager extends Component {
|
||||||
static {
|
static {
|
||||||
try {
|
try {
|
||||||
InputStream props;
|
InputStream props;
|
||||||
var path
|
var path = FsdUtils.findConfigFile(VM_OP_NAME.replace("-", ""),
|
||||||
= FsdUtils.findConfigFile(VM_OP_NAME, "logging.properties");
|
"logging.properties");
|
||||||
if (path.isPresent()) {
|
if (path.isPresent()) {
|
||||||
props = Files.newInputStream(path.get());
|
props = Files.newInputStream(path.get());
|
||||||
} else {
|
} else {
|
||||||
|
|
|
||||||
|
|
@ -118,8 +118,8 @@ public class VmWatcher extends Component {
|
||||||
|
|
||||||
ListOptions opts = new ListOptions();
|
ListOptions opts = new ListOptions();
|
||||||
opts.setLabelSelector(
|
opts.setLabelSelector(
|
||||||
"app.kubernetes.io/managed-by=vmoperator,"
|
"app.kubernetes.io/managed-by=" + Constants.VM_OP_NAME + ","
|
||||||
+ "app.kubernetes.io/name=vmrunner");
|
+ "app.kubernetes.io/name=" + Constants.APP_NAME);
|
||||||
for (String resource : List.of("apps/v1/statefulsets",
|
for (String resource : List.of("apps/v1/statefulsets",
|
||||||
"v1/configmaps", "v1/secrets")) {
|
"v1/configmaps", "v1/secrets")) {
|
||||||
var resParts = new LinkedList<>(List.of(resource.split("/")));
|
var resParts = new LinkedList<>(List.of(resource.split("/")));
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue