summaryrefslogtreecommitdiffstats
path: root/cadi
diff options
context:
space:
mode:
authorInstrumental <jonathan.gathman@att.com>2019-07-24 14:42:22 -0500
committerInstrumental <jonathan.gathman@att.com>2019-07-24 14:47:51 -0500
commitb3a6814af9ab63fa59d0233f5d2ebb032f0b1597 (patch)
tree9b4579eb2efbc8fab6a6491df6114172642a1640 /cadi
parente9529d3deb86757d7b2eabaff4696c146cd0bad8 (diff)
update Agent for Helm
Issue-ID: AAF-904 Change-Id: I015cd19dcf95d1edfd86542750acc95447726120 Signed-off-by: Instrumental <jonathan.gathman@att.com>
Diffstat (limited to 'cadi')
-rw-r--r--cadi/aaf/src/main/java/org/onap/aaf/cadi/configure/Agent.java13
-rw-r--r--cadi/aaf/src/main/java/org/onap/aaf/cadi/register/RegistrationCreator.java19
-rw-r--r--cadi/core/src/main/java/org/onap/aaf/cadi/config/Config.java2
3 files changed, 29 insertions, 5 deletions
diff --git a/cadi/aaf/src/main/java/org/onap/aaf/cadi/configure/Agent.java b/cadi/aaf/src/main/java/org/onap/aaf/cadi/configure/Agent.java
index fda591e3..1a1d68da 100644
--- a/cadi/aaf/src/main/java/org/onap/aaf/cadi/configure/Agent.java
+++ b/cadi/aaf/src/main/java/org/onap/aaf/cadi/configure/Agent.java
@@ -123,6 +123,7 @@ public class Agent {
});
// Note: This is set by loadURLs. Use that function as singleton, not directly.
private static Map<String,String> aaf_urls = null;
+ private static boolean configNoPasswd = false;
public static void main(String[] args) {
@@ -160,6 +161,8 @@ public class Agent {
if(idx>=0 && idx<a.length()) {
hasEtc = a.substring(idx+1);
}
+ } else if(a.equals("--nopasswd")) {
+ configNoPasswd=true;
}
}
@@ -252,7 +255,7 @@ public class Agent {
System.out.println(" showpass <FQI> [<machine>]");
System.out.println(" check <FQI> [<machine>]");
System.out.println(" keypairgen <FQI>");
- System.out.println(" config <FQI>");
+ System.out.println(" config <FQI> [--nopasswd]");
System.out.println(" validate <NS>.props>");
System.out.println(" connectivity <NS>.props>");
System.out.println(" --- Additional Tool Access ---");
@@ -891,9 +894,11 @@ public class Agent {
cred.addEnc(Config.AAF_APPPASS, propAccess, null);
// only Ask for Password when starting scratch
} else if(propAccess.getProperty(Config.CADI_PROP_FILES)==null) {
- char[] pwd = AAFSSO.cons.readPassword("Password for %s (leave blank for NO password): ", fqi);
- if(pwd.length>0) {
- cred.addEnc(Config.AAF_APPPASS, new String(pwd));
+ if(!configNoPasswd) {
+ char[] pwd = AAFSSO.cons.readPassword("Password for %s (leave blank for NO password): ", fqi);
+ if(pwd.length>0) {
+ cred.addEnc(Config.AAF_APPPASS, new String(pwd));
+ }
}
}
diff --git a/cadi/aaf/src/main/java/org/onap/aaf/cadi/register/RegistrationCreator.java b/cadi/aaf/src/main/java/org/onap/aaf/cadi/register/RegistrationCreator.java
index 8b879e4f..fc3c18b0 100644
--- a/cadi/aaf/src/main/java/org/onap/aaf/cadi/register/RegistrationCreator.java
+++ b/cadi/aaf/src/main/java/org/onap/aaf/cadi/register/RegistrationCreator.java
@@ -55,6 +55,7 @@ public class RegistrationCreator {
RegistrationPropHolder ph = new RegistrationPropHolder(access, port);
+ String firstPrivateHostname = null;
// Now, loop through by Container
for(String le : Split.splitTrim(',', ph.lcontainer)) {
if(le.isEmpty()) {
@@ -81,7 +82,23 @@ public class RegistrationCreator {
}
locate.setName(ph.getEntryName(entry,dot_le));
- locate.setHostname(ph.getEntryFQDN(entry,dot_le));
+ /* Cover the situation where there is a Container, and multiple locator Entries,
+ * the first of which is the only real private FQDN
+ * example: oauth
+ * aaf_locator_entries=oauth,token,introspect
+ *
+ * Entries for token and introspect, but they point to oauth service.
+ */
+ String locateHostname;
+ if(le.isEmpty()) {
+ locateHostname=ph.getEntryFQDN(entry, dot_le);
+ } else if(firstPrivateHostname==null) {
+ firstPrivateHostname=locateHostname=ph.getEntryFQDN(entry, dot_le);
+ } else {
+ locateHostname=firstPrivateHostname;
+ }
+
+ locate.setHostname(locateHostname);
locate.setPort(ph.getEntryPort(dot_le));
String specificVersion = access.getProperty(Config.AAF_LOCATOR_VERSION + dot_le,null);
diff --git a/cadi/core/src/main/java/org/onap/aaf/cadi/config/Config.java b/cadi/core/src/main/java/org/onap/aaf/cadi/config/Config.java
index b53b54da..30508b7d 100644
--- a/cadi/core/src/main/java/org/onap/aaf/cadi/config/Config.java
+++ b/cadi/core/src/main/java/org/onap/aaf/cadi/config/Config.java
@@ -231,6 +231,8 @@ public class Config {
// let NS Owners choose with <ns>.certman aaf ignoreIPs" to ignoreIP Check for Configs
// Probably only want to allow in a DEV Env.
public static final String CM_ALLOW_IGNORE_IPS="cm_allow_ignore_ips";
+ // Docker doesn't have a default DNS. The property turns off IP Checking of DNSs before creating.
+ public static final String CM_ALWAYS_IGNORE_IPS="cm_always_ignore_ips";
public static final String PATHFILTER_URLPATTERN = "pathfilter_urlpattern";
public static final String PATHFILTER_STACK = "pathfilter_stack";