godaddy/kubernetes-client

.getStream() doesn't authenticate with refreshAuth

Open

#373 aberto em 15 de dez. de 2018

Ver no GitHub
 (7 comments) (2 reactions) (0 assignees)JavaScript (206 forks)batch import
help wanted

Métricas do repositório

Stars
 (954 stars)
Métricas de merge de PR
 (Nenhuma PRs mesclada em 30d)

Description

On an AWS EKS cluster calling:

        const stream = client.apis.apps.v1.watch.namespaces('default').deployments.getStream();
        const jsonStream = new JSONStream();
        stream.pipe(jsonStream);
        jsonStream.on('data', object => {
            console.log('Event: ', JSON.stringify(object, null, 2));
        });

Fails to authenticate with:

Event: { "kind": "Status", "apiVersion": "v1", "metadata": {}, "status": "Failure", "message": "deployments.apps is forbidden: User "system:anonymous" cannot watch deployments.apps in the namespace "tilloo"", "reason": "Forbidden", "details": { "group": "apps", "kind": "deployments" }, "code": 403 }

Workaround is to call any other API first. This may be related to: #248

Guia do colaborador