def getenv(envarray, key, keyname="name", valname="value"):
    """get a value from a k8s "env" object (array of {"name":x,"value":y}); return None if not found"""
    for e in envarray:
        if e[keyname] == key:
            return e[valname]
    return None