public static List < EnvVar > convertToEnvVarList ( Map < String , String > envVars ) { List < EnvVar > envList = new LinkedList <> ( ) ; for ( Map . Entry < String , String > entry : envVars . entrySet ( ) ) { String name = entry . getKey ( ) ; String value = entry . getValue ( ) ; if ( name != null ) { EnvVar env = new EnvVarBuilder ( ) . withName ( name ) . withValue ( value ) . build ( ) ; envList . add ( env ) ; } } return envList ; }
Convert a map of env vars to a list of K8s EnvVar objects .