flipt icon indicating copy to clipboard operation
flipt copied to clipboard

Flipt CLI: Import issue when --address and --drop is used

Open GeorgeMac opened this issue 1 year ago • 2 comments

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

GeorgeMac avatar Jun 26 '24 16:06 GeorgeMac

I would like to take this issue

devumesh avatar Oct 01 '24 10:10 devumesh

All yours @devumesh 🙏 We appreciate your contributions!

GeorgeMac avatar Oct 01 '24 12:10 GeorgeMac

Thank you @devumesh for your contribution.

erka avatar Oct 27 '24 08:10 erka