Skip to content

Commit

Permalink
fix for package annotations in sync command
Browse files Browse the repository at this point in the history
  • Loading branch information
Himavanth committed Jun 12, 2020
1 parent a6ce900 commit e8a90bf
Show file tree
Hide file tree
Showing 2 changed files with 18 additions and 14 deletions.
20 changes: 6 additions & 14 deletions src/runtime-helpers.js
Original file line number Diff line number Diff line change
Expand Up @@ -998,20 +998,12 @@ async function getProjectEntities (project, isProjectHash, ow) {
async function addManagedProjectAnnotations (entities, manifestPath, projectName, projectHash) {
// add whisk managed annotations
for (const pkg of entities.pkgAndDeps) {
const options = {}
options['name'] = pkg.name
options['package'] = {
annotations: [
{
key: 'whisk-managed',
value: {
file: manifestPath,
projectDeps: [],
projectHash: projectHash,
projectName: projectName
}
}
]
pkg.annotations = pkg.annotations || {}
pkg.annotations['whisk-managed'] = {
file: manifestPath,
projectDeps: [],
projectHash: projectHash,
projectName: projectName
}
}
for (const action of entities.actions) {
Expand Down
12 changes: 12 additions & 0 deletions test/commands/runtime/deploy/sync.test.js
Original file line number Diff line number Diff line change
Expand Up @@ -352,6 +352,18 @@ describe('instance methods', () => {
return command.run()
.then(() => {
expect(cmd).toHaveBeenCalled()
expect(cmd).toHaveBeenCalledWith(
expect.objectContaining({
annotations: expect.objectContaining({
'whisk-managed': {
file: '/deploy/deployment_actionMissingInputs.yaml',
projectDeps: [],
projectHash: 'xyz',
projectName: 'proj'
}
})
})
)
expect(stdout.output).toMatch('')
})
})
Expand Down

0 comments on commit e8a90bf

Please sign in to comment.