Skip to content

Commit

Permalink
improve logging on gateway and bump framebuffer versio
Browse files Browse the repository at this point in the history
  • Loading branch information
erulabs committed Sep 28, 2022
1 parent 0dd38cb commit e390b23
Show file tree
Hide file tree
Showing 4 changed files with 5 additions and 5 deletions.
2 changes: 1 addition & 1 deletion VERSION.txt
Original file line number Diff line number Diff line change
@@ -1 +1 @@
0.74.4
0.74.5
2 changes: 1 addition & 1 deletion bin/node.sh
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ if [[ "$1" == "agent" ]]; then
chmod +x /opt/kubesail/kubesail-support.sh
fi
# LATEST_FB_VERSION="$(curl --connect-timeout 10 -L https://raw.githubusercontent.com/kubesail/pibox-framebuffer/main/VERSION.txt)"
LATEST_FB_VERSION="20"
LATEST_FB_VERSION="21"
FB_VERSION="v${LATEST_FB_VERSION}"
FB_PATH=/opt/kubesail/pibox-framebuffer-$FB_VERSION
if [[ -n $LATEST_FB_VERSION && ! -f $FB_PATH && -d /opt/kubesail ]]; then
Expand Down
2 changes: 1 addition & 1 deletion lib/agent/Agent.js
Original file line number Diff line number Diff line change
Expand Up @@ -747,8 +747,8 @@ class KubesailAgent {
}
})
this.gatewaySocket.on('disk-stats', async () => {
logger.debug('Agent received disk-stats request, fetching.')
const res = await this.framebuffer.request('/disk-stats')
logger.debug('Agent received disk-stats request!', { statusCode: res?.statusCode || null })
if (!res || res.statusCode !== 200) {
logger.debug('Invalid response from framebuffer!', { status: res?.statusCode })
await this.kubesailApiRequest('/agent/disk-stats/error', 'POST', {
Expand Down
4 changes: 2 additions & 2 deletions lib/gateway/gatewayServer.js
Original file line number Diff line number Diff line change
Expand Up @@ -105,7 +105,7 @@ module.exports = function () {
server.put('/agent/config-request/:secret', async (req, res) => {
if (req.params.secret !== KUBESAIL_API_SECRET) return res.sendStatus(403)
const { agentKey } = req.body
// Request that the agent send its configuration
logger.info('config-request request:', { agentKey })
await this.messageAgent(agentKey, 'config-request')
return res.sendStatus(200)
})
Expand All @@ -114,7 +114,7 @@ module.exports = function () {
server.put('/agent/disk-stats/:secret', async (req, res) => {
if (req.params.secret !== KUBESAIL_API_SECRET) return res.sendStatus(403)
const { agentKey } = req.body
// Request that the agent send its configuration
logger.info('disk-stats request:', { agentKey })
await this.messageAgent(agentKey, 'disk-stats')
return res.sendStatus(200)
})
Expand Down

0 comments on commit e390b23

Please sign in to comment.