When create or edit is given --file, most nouns overwrite the name in the file with the name on the command line, without saying so:
node (apps/cinc/cmd/node.go, create and edit)
role (role.go, create and edit)
environment (environment.go, create and edit)
client, user, group, org and keys edit
So cinc role edit web --file db.json, where db.json holds the db role, writes db's run list and attributes over web. The user most likely passed the wrong file, and nothing warns them.
Data bags already refuse this (#264). A --file item id that differs from the positional id is rejected before anything is sent, with an error naming both. The other nouns should do the same: refuse when the file names a different object, and accept a file with no name or the same name.
Update the unit tests and integration cases that currently rely on the override.
When
createoreditis given--file, most nouns overwrite the name in the file with the name on the command line, without saying so:node(apps/cinc/cmd/node.go, create and edit)role(role.go, create and edit)environment(environment.go, create and edit)client,user,group,organdkeyseditSo
cinc role edit web --file db.json, wheredb.jsonholds thedbrole, writes db's run list and attributes overweb. The user most likely passed the wrong file, and nothing warns them.Data bags already refuse this (#264). A
--fileitem id that differs from the positional id is rejected before anything is sent, with an error naming both. The other nouns should do the same: refuse when the file names a different object, and accept a file with no name or the same name.Update the unit tests and integration cases that currently rely on the override.