Skip to content

Commit

Permalink
Fix code review failures
Browse files Browse the repository at this point in the history
  • Loading branch information
thegridman committed Feb 26, 2025
1 parent bce5c0f commit cbc7473
Show file tree
Hide file tree
Showing 2 changed files with 19 additions and 5 deletions.
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/*
* Copyright (c) 2021, 2023, Oracle and/or its affiliates.
* Copyright (c) 2021, 2025, Oracle and/or its affiliates.
* Licensed under the Universal Permissive License v 1.0 as shown at
* http://oss.oracle.com/licenses/upl.
*/
Expand Down Expand Up @@ -292,7 +292,8 @@ void initCohCtl() {
}

// If we have a COHCTL_HOME env var or property try to create the config there
if (cohCtlHome != null && !cohCtlHome.isEmpty() && tryCreateConfig(new File(cohCtlHome), connectionType, protocol, port, clusterName)) {
if (cohCtlHome != null && !cohCtlHome.isEmpty()
&& tryCreateConfig(new File(cohCtlHome), connectionType, protocol, port, clusterName)) {
return;
}

Expand All @@ -313,10 +314,12 @@ void initCohCtl() {
}
else {
if (!fileCohCtlHome.exists()) {
LOGGER.error("CoherenceOperator: Cannot create cohctl config, directory " + fileCohCtlHome + " does not exist");
LOGGER.error("CoherenceOperator: Cannot create cohctl config, directory "
+ fileCohCtlHome + " does not exist");
}
else {
LOGGER.error("CoherenceOperator: Cannot create cohctl config, location " + fileCohCtlHome + " is not a directory");
LOGGER.error("CoherenceOperator: Cannot create cohctl config, location "
+ fileCohCtlHome + " is not a directory");
}
}
}
Expand All @@ -334,6 +337,17 @@ void initCohCtl() {
}
}

/**
* Try to create the Coherence CLI configuration.
*
* @param home the location of the CLI home directory
* @param connectionType the type of the connection http or https
* @param protocol the protocol for the connection http or https
* @param port the management over REST port
* @param clusterName the cluster name
*
* @return {@code true} of the configuration was created
*/
protected boolean tryCreateConfig(File home, String connectionType, String protocol, String port, String clusterName) {
File configFile = new File(home, "cohctl.yaml");

Expand Down
2 changes: 1 addition & 1 deletion runner/main.go
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/*
* Copyright (c) 2020, 2022, Oracle and/or its affiliates.
* Copyright (c) 2020, 2025, Oracle and/or its affiliates.
* Licensed under the Universal Permissive License v 1.0 as shown at
* http://oss.oracle.com/licenses/upl.
*/
Expand Down

0 comments on commit cbc7473

Please sign in to comment.