mirror of
https://github.com/balena-os/balena-supervisor.git
synced 2025-02-01 08:47:56 +00:00
Auto-merge for PR #637 via VersionBot
Remove trailing slashes from working directories of services
This commit is contained in:
commit
4e5f8cabb8
@ -4,6 +4,10 @@ All notable changes to this project will be documented in this file
|
||||
automatically by Versionist. DO NOT EDIT THIS FILE MANUALLY!
|
||||
This project adheres to [Semantic Versioning](http://semver.org/).
|
||||
|
||||
## v7.5.1 - 2018-04-29
|
||||
|
||||
* Remove trailing slashes from working directories of services #637 [Cameron Diver]
|
||||
|
||||
## v7.5.0 - 2018-04-27
|
||||
|
||||
* Add tests for validation code #636 [Cameron Diver]
|
||||
|
@ -1,7 +1,7 @@
|
||||
{
|
||||
"name": "resin-supervisor",
|
||||
"description": "This is resin.io's Supervisor, a program that runs on IoT devices and has the task of running user Apps (which are Docker containers), and updating them as Resin's API informs it to.",
|
||||
"version": "7.5.0",
|
||||
"version": "7.5.1",
|
||||
"license": "Apache-2.0",
|
||||
"repository": {
|
||||
"type": "git",
|
||||
|
@ -62,7 +62,7 @@ getUser = (service, imageInfo) ->
|
||||
return service.user ? imageInfo?.Config?.User ? ''
|
||||
|
||||
getWorkingDir = (service, imageInfo) ->
|
||||
return service.workingDir ? imageInfo?.Config?.WorkingDir ? ''
|
||||
return (service.workingDir ? imageInfo?.Config?.WorkingDir ? '').replace(/(^.+)\/$/, '$1')
|
||||
|
||||
buildHealthcheckTest = (test) ->
|
||||
if _.isString(test)
|
||||
|
@ -147,3 +147,17 @@ describe 'compose/service.cofee', ->
|
||||
expect(makeComposeServiceWithLimit('64gb').memLimit).to.equal(68719476736)
|
||||
expect(makeComposeServiceWithLimit('64Gb').memLimit).to.equal(68719476736)
|
||||
|
||||
describe 'getWorkingDir', ->
|
||||
makeComposeServiceWithWorkdir = (workdir) ->
|
||||
new Service(
|
||||
appId: 123456,
|
||||
serviceId: 123456,
|
||||
serviceName: 'foobar'
|
||||
workingDir: workdir
|
||||
)
|
||||
|
||||
it 'should remove a trailing slash', ->
|
||||
expect(makeComposeServiceWithWorkdir('/usr/src/app/').workingDir).to.equal('/usr/src/app')
|
||||
expect(makeComposeServiceWithWorkdir('/').workingDir).to.equal('/')
|
||||
expect(makeComposeServiceWithWorkdir('/usr/src/app').workingDir).to.equal('/usr/src/app')
|
||||
expect(makeComposeServiceWithWorkdir('').workingDir).to.equal('')
|
||||
|
Loading…
x
Reference in New Issue
Block a user