src/main/java/application/rest/v1/configmaps/KindActionMappingProcessor.java
/**
     * Check if mapping rule has an owner (kind), make sure it matches an owner kind in 
     * resource's ownerReferences array. 
     * @param mappingRuleOwner
     * @param resourceOwnerReferences
     * @return true if mapping rule does not specify owner kind 
     *         true if mapping rule specifies owner kind wildcard ('*') 
     *         false if mapping rule specifies owner kind (not wildcard) and resource has no owner refs
     * 
     *         true if resource has owner ref kind that matches mapping rule owner kind and rule has no owner 
     *           apiVersion or uid
     * 
     *         true if resource has owner ref kind that matches mapping rule owner kind
     *           and mapping rule owner apiVersion and/or uid match resource owner apiVersion and/or uid
     * 
     *         false if resource has owner ref kind that matches mapping rule owner kind 
     *           and mapping rule apiVersion and/or uid do not match resource owner apiVersion and/or uid
     *         
     *         false if mapping rule specifies owner kind (not wildcard) but resource has no matching owner ref kind
     */
Check if mapping rule has an owner (kind), make sure it matches an owner kind in
resource's ownerReferences array.
@param mappingRuleOwner
@param resourceOwnerReferences
@return true if mapping rule does not specify owner kind
true if mapping rule specifies owner kind wildcard ('*')
false if mapping rule specifies owner kind (not wildcard) and resource has no owner refs

true if resource has owner ref kind that matches mapping rule owner kind and rule has no owner
apiVersion or uid

true if resource has owner ref kind that matches mapping rule owner kind
and mapping rule owner apiVersion and/or uid match resource owner apiVersion and/or uid

false if resource has owner ref kind that matches mapping rule owner kind
and mapping rule apiVersion and/or uid do not match resource owner apiVersion and/or uid

false if mapping rule specifies owner kind (not wildcard) but resource has no matching owner ref kind
Check if mapping rule has an owner ( kind ) make sure it matches an owner kind in resource ' s ownerReferences array . @param mappingRuleOwner @param resourceOwnerReferences @return true if mapping rule does not specify owner kind true if mapping rule specifies owner kind wildcard ( ' * ' ) false if mapping rule specifies owner kind ( not wildcard ) and resource has no owner refs true if resource has owner ref kind that matches mapping rule owner kind and rule has no owner apiVersion or uid true if resource has owner ref kind that matches mapping rule owner kind and mapping rule owner apiVersion and / or uid match resource owner apiVersion and / or uid false if resource has owner ref kind that matches mapping rule owner kind and mapping rule apiVersion and / or uid do not match resource owner apiVersion and / or uid false if mapping rule specifies owner kind ( not wildcard ) but resource has no matching owner ref kind
private boolean ownerMatches(String mappingRuleOwnerKind, String mappingRuleOwnerAPI, String mappingRuleOwnerUID, OwnerRef[] resourceOwnerReferences) {
        if (Logger.isDebugEnabled()) 
           Logger.log(CLASS_NAME, "ownerMatches", Logger.LogType.DEBUG,"Parameters: "+
              "\nrule owner kind="+mappingRuleOwnerKind+
              "\nrule owner apiVersion="+mappingRuleOwnerAPI+
              "\nrule owner uid="+mappingRuleOwnerUID+
              "\nresource refs="+ownerRefsToString(resourceOwnerReferences)
            );
        if ( mappingRuleOwnerKind == null ) { 
            if (Logger.isDebugEnabled()) 
                Logger.log(CLASS_NAME, "ownerMatches", Logger.LogType.DEBUG, "true because mapping rule does not specify owner kind.");
            return true; 
        }
        else if ( mappingRuleOwnerKind.equals("*") ) { 
            if (Logger.isDebugEnabled()) 
                Logger.log(CLASS_NAME, "ownerMatches", Logger.LogType.DEBUG, "true because mapping rule specifies owner kind wildcard ('*').");
            return true; 
        }
        else if ( resourceOwnerReferences == null ) { 
            if (Logger.isDebugEnabled()) 
                Logger.log(CLASS_NAME, "ownerMatches", Logger.LogType.DEBUG, "false because mapping rule specifies owner kind (not wildcard) and resource has no owner refs.");
            return false; 
        }
        else { 
            for (int i=0; i < resourceOwnerReferences.length; i++ ) { 
                if ( resourceOwnerReferences[i].kindEquals(mappingRuleOwnerKind) ) { 
                    if (( mappingRuleOwnerUID == null ) && ( mappingRuleOwnerAPI == null ))  {  
                        if (Logger.isDebugEnabled()) 
                            Logger.log(CLASS_NAME, "ownerMatches", Logger.LogType.DEBUG, "true because resource has owner ref kind that matches mapping rule owner kind and rule has no owner apiVersion or uid.");
                        return true;
                    }
                    else {
                        if (uidMatches(resourceOwnerReferences[i],mappingRuleOwnerUID) && 
                              apiMatches(resourceOwnerReferences[i],mappingRuleOwnerAPI)) {
                            this.compMatchingOwner = resourceOwnerReferences[i];
                            if (Logger.isDebugEnabled()) 
                                Logger.log(CLASS_NAME, "ownerMatches", Logger.LogType.DEBUG, "true because resource has owner ref kind that matches mapping rule owner kind and mapping rule owner apiVersion and/or uid match resource owner apiVersion and/or uid.");
                            return true;
                        } else {
                            if (Logger.isDebugEnabled()) 
                                Logger.log(CLASS_NAME, "ownerMatches", Logger.LogType.DEBUG,"false because resource has owner ref kind that matches mapping rule owner kind and mapping rule apiVersion and/or uid do not match resource owner apiVersion and/or uid."); 
                            return false;
                        }
                    }
                }
            }
            if (Logger.isDebugEnabled()) 
                Logger.log(CLASS_NAME, "ownerMatches", Logger.LogType.DEBUG,"false because mapping rule specifies owner kind (not wildcard) but resource has no matching owner ref kind.");           
            return false; 
        }
    }
private boolean ownerMatches ( String mappingRuleOwnerKind , String mappingRuleOwnerAPI , String mappingRuleOwnerUID , OwnerRef [ ] resourceOwnerReferences ) { if ( Logger . isDebugEnabled ( ) ) Logger . log ( CLASS_NAME , "ownerMatches" , Logger . LogType . DEBUG , "Parameters: " + "\nrule owner kind=" + mappingRuleOwnerKind + "\nrule owner apiVersion=" + mappingRuleOwnerAPI + "\nrule owner uid=" + mappingRuleOwnerUID + "\nresource refs=" + ownerRefsToString ( resourceOwnerReferences ) ) ; if ( mappingRuleOwnerKind == null ) { if ( Logger . isDebugEnabled ( ) ) Logger . log ( CLASS_NAME , "ownerMatches" , Logger . LogType . DEBUG , "true because mapping rule does not specify owner kind." ) ; return true ; } else if ( mappingRuleOwnerKind . equals ( "*" ) ) { if ( Logger . isDebugEnabled ( ) ) Logger . log ( CLASS_NAME , "ownerMatches" , Logger . LogType . DEBUG , "true because mapping rule specifies owner kind wildcard ('*')." ) ; return true ; } else if ( resourceOwnerReferences == null ) { if ( Logger . isDebugEnabled ( ) ) Logger . log ( CLASS_NAME , "ownerMatches" , Logger . LogType . DEBUG , "false because mapping rule specifies owner kind (not wildcard) and resource has no owner refs." ) ; return false ; } else { for ( int i = 0 ; i < resourceOwnerReferences . length ; i ++ ) { if ( resourceOwnerReferences [ i ] . kindEquals ( mappingRuleOwnerKind ) ) { if ( ( mappingRuleOwnerUID == null ) && ( mappingRuleOwnerAPI == null ) ) { if ( Logger . isDebugEnabled ( ) ) Logger . log ( CLASS_NAME , "ownerMatches" , Logger . LogType . DEBUG , "true because resource has owner ref kind that matches mapping rule owner kind and rule has no owner apiVersion or uid." ) ; return true ; } else { if ( uidMatches ( resourceOwnerReferences [ i ] , mappingRuleOwnerUID ) && apiMatches ( resourceOwnerReferences [ i ] , mappingRuleOwnerAPI ) ) { this . compMatchingOwner = resourceOwnerReferences [ i ] ; if ( Logger . isDebugEnabled ( ) ) Logger . log ( CLASS_NAME , "ownerMatches" , Logger . LogType . DEBUG , "true because resource has owner ref kind that matches mapping rule owner kind and mapping rule owner apiVersion and/or uid match resource owner apiVersion and/or uid." ) ; return true ; } else { if ( Logger . isDebugEnabled ( ) ) Logger . log ( CLASS_NAME , "ownerMatches" , Logger . LogType . DEBUG , "false because resource has owner ref kind that matches mapping rule owner kind and mapping rule apiVersion and/or uid do not match resource owner apiVersion and/or uid." ) ; return false ; } } } } if ( Logger . isDebugEnabled ( ) ) Logger . log ( CLASS_NAME , "ownerMatches" , Logger . LogType . DEBUG , "false because mapping rule specifies owner kind (not wildcard) but resource has no matching owner ref kind." ) ; return false ; } }
Check if mapping rule has an owner (kind), make sure it matches an owner kind in
 resource's ownerReferences array.
Check if mapping rule has an owner ( kind ) make sure it matches an owner kind in resource ' s ownerReferences array .
// true if mapping rule does not specify owner kind // true if mapping rule specifies owner kind wildcard ('*') // false if mapping rule specifies owner kind (not wildcard) and resource has no owner refs // true if resource has owner ref kind that matches mapping rule owner kind and rule has no owner apiVersion or uid // true if resource has owner ref kind that matches mapping rule owner kind //   and mapping rule owner apiVersion and/or uid match resource owner apiVersion and/or uid // false if resource has owner ref kind that matches mapping rule owner kind  //   and mapping rule apiVersion and/or uid do not match resource owner apiVersion and/or uid // false if mapping rule specifies owner kind (not wildcard) but resource has no matching owner ref kind