private AuthConfig parseOpenShiftConfig ( ) { Map kubeConfig = DockerFileUtil . readKubeConfig ( ) ; if ( kubeConfig == null ) { return null ; } String currentContextName = ( String ) kubeConfig . get ( "current-context" ) ; if ( currentContextName == null ) { return null ; } for ( Map contextMap : ( List < Map > ) kubeConfig . get ( "contexts" ) ) { if ( currentContextName . equals ( contextMap . get ( "name" ) ) ) { return parseContext ( kubeConfig , ( Map ) contextMap . get ( "context" ) ) ; } } return null ; }
Parse OpenShift config to get credentials but return null if not found