Flipt CLI: Import issue when --address and --drop is used
I have a Flipt running in a minikube which is accessible through http://localhost:8000 in my computer.
There is no content in Flipt at the beginning
$ flipt export --address http://localhost:8000
version: "1.2"
namespace: default
Then, I created a yaml file to import content there
$ cat init-state.yaml
version: "1.2"
namespace: default
flags:
- key: my-first-flag
name: my-first-flag
type: VARIANT_FLAG_TYPE
enabled: false
I'm able to import this data there
$ flipt import --address http://localhost:8000 init-state.yaml
$ flipt export --address http://localhost:8000
version: "1.2"
namespace: default
flags:
- key: my-first-flag
name: my-first-flag
type: VARIANT_FLAG_TYPE
enabled: false
However, if I try to import that yaml file again, I get an error because of the conflicts. This is normal
$ flipt import --address http://localhost:8000 init-state.yaml
Error: creating flag: rpc error: code = InvalidArgument desc = flag "default/my-first-flag" is not unique
For that reason, I added the --drop flag to the import. But, it seems it is doing nothing
$ flipt import --address http://localhost:8000 --drop init-state.yaml
Error: creating flag: rpc error: code = InvalidArgument desc = flag "default/my-first-flag" is not unique
Could you tell me what I'm doing wrong?
Thanks
Originally posted by @jordi-gou-flyr in https://github.com/flipt-io/flipt/discussions/3221
I would like to take this issue
All yours @devumesh 🙏 We appreciate your contributions!
Thank you @devumesh for your contribution.