Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Error: tags specified in the state file and via --select-tags flag are different. when using more than one config file #561

Closed
michaelhsk opened this issue Jan 12, 2022 · 2 comments
Assignees

Comments

@michaelhsk
Copy link

michaelhsk commented Jan 12, 2022

Kong Version 2.7
Deck Version 1.10.0

When using deck sync with --select-tag with multiple yaml files containing select_tags (always the samte tag "deck-managed" used in command) i get the error

Error: tags specified in the state file and via --select-tags flag are different.
decK expects tags to be specified in either via flag or via state file.
In case both are specified, they must match

If i use the command only with one of the files everything works fine.

With deck 1.8.2 no problems with the same config/commands.

f.g.
config for file1.yaml - file10.yaml contains tag deck-managed

...
_info:
  select_tags:
  - deck-managed
...

command:
deck sync --select-tag deck-managed -s /config
OR
deck sync --select-tag deck-managed -s /config/file1.yaml -s /config/file2.yaml

produces the error

if i remove parameter from command
"deck sync -s /config"
-> everything works as expected

same if i use only 1 file with parameter
deck sync --select-tag deck-managed -s /config/file1.yaml
deck sync --select-tag deck-managed -s /config/file2.yaml
...

or if i use parameter in command line and remove
following lines from yaml files
_info:
select_tags:

  • deck-managed
    ...

no error.

Maybe that this bug come in with this change in v.1.9.0 ?:
1beef01 fix(sync) apply --select-tag to new entities

@GGabriele
Copy link
Collaborator

As stated in the docs, you don't need to use --select-tag with sync when the tag information is already in the state files, as sync will already use that/those.

Also, always from the docs:

It is strongly advised that you do not supply select-tags to sync and diff commands via flags. This is because the tag information should be part of the declarative configuration file itself in order to provide a practical declarative file. The tagging information and entity definitions should be present in one place, else an error in supplying the wrong tag via the CLI can break the configuration.

That said, deck shouldn't error out like it's doing in this spot.

@GGabriele
Copy link
Collaborator

Fixed via #571

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants