Skip to content

Commit

Permalink
feat: set user-agent on kube api-server requests
Browse files Browse the repository at this point in the history
  • Loading branch information
alewitt2 committed Mar 12, 2021
1 parent 7c24057 commit 3802608
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions lib/KubeApiConfig.js
Original file line number Diff line number Diff line change
Expand Up @@ -74,7 +74,10 @@ module.exports = function kubeApiConfig(options = {}) {
}
result.baseUrl = cluster.server;

const userAgentName = process.env.USER_AGENT_NAME || 'razee';
const userAgentVersion = process.env.USER_AGENT_VERSION || '0.0.0-dev';

objectPath.set(result, 'headers.User-Agent', `${userAgentName}/${userAgentVersion}`);
_kubeApiConfig.kubeConfig = result;
return result;
};
Expand Down

0 comments on commit 3802608

Please sign in to comment.