acorn-io / runtime

A simple application deployment framework built on Kubernetes
https://docs.acorn.io/
Apache License 2.0
1.14k stars 101 forks source link

Trying to create a secret with a name that already exists does not error out. #2408

Closed sangee2004 closed 6 months ago

sangee2004 commented 6 months ago

acorn version - v0.10.0-rc2-9-g43dbcbf4+43dbcbf4 Steps to reproduce the problem:

  1. Create a secret say mytest1
  2. Create another secret with same name - mytest1 There is no change made to the existing secret as expected . But this command does not error out stating that secret already exists.
%acorn secret create mytest1 --data test1=value1                 
mytest1
 % acorn secret create mytest1 --data test2=value2
mytest1
 % acorn secret reveal mytest1                    
NAME      TYPE      KEY       VALUE
mytest1   opaque    test1     value1

Expected Behavior: Create secret command should error out in this case stating that secret already exists.

g-linville commented 6 months ago

Merged the fix.

sangee2004 commented 6 months ago

Tested with acorn version -v0.10.0-rc2-20-ge0dc013c+e0dc013c

Creating a secret which already exists results in error as expected.

acorn secret create --data password=hello123updated mytest1 
  ✗  ERROR:  secret mytest1 already exists