godaddy/kubernetes-client

.getStream() doesn't authenticate with refreshAuth

開放

#373 建立於 2018年12月15日

 (7 則留言) (2 個反應) (0 位負責人)JavaScript (206 個分叉)batch import
help wanted

倉庫指標

星標
 (954 顆星)
PR 合併指標
 (30 天內沒有已合併 PR)

描述

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

貢獻者指南