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

fix: enable decK's convert subcommand to work with Konnect again #847

Open
wants to merge 1 commit into
base: main
Choose a base branch
from

Conversation

GGabriele
Copy link
Collaborator

After the deprecation of the old deck konnect command and the old Konnect format, the deck convert command with the Konnect format is not useful anymore in its current shape because the old Konnect format is not compatible anymore with the new workflow handled directly with the main deck command.

Despite the new Konnect format is mostly compatible with the 'regular' Kong format, it has a few differences:

  • it needs the _format_version entry set to "3.0"
  • it doesn't support the _workspace entry

This means that doing a deck dump and then a deck sync from one Gateway with workspaces to Konnect may not natively work because of these incompatibilities.

This commit makes sure to support the new Konnect format in the deck convert command. The new convertion does the following:

  • set the _format_version entry to "3.0"
  • handle the removal of the _workspace entry and the addition of the _konnect.runtime_group_name in the following manner:
    1. if present, remove the _workspace entry
    2. if --konnect-runtime-group-name foo flag is used, then set _konnect.runtime_group_name: foo
    3. if no --konnect-runtime-group-name flag is used, then set _konnect.runtime_group_name to the value _workspace was precedently set to
    4. if no _workspace was present and no --konnect-runtime-group-name flag is used, then leave the whole _konnect entry unset

After the deprecation of the old `deck konnect` command and the
old Konnect format, the `deck convert` command with the Konnect
format is not useful anymore in its current shape because the
old Konnect format is not compatible anymore with the new
workflow handled directly with the main `deck` command.

Despite the new Konnect format is mostly compatible with the
'regular' Kong format, it has a few differences:
- it needs the `_format_version` entry set to `"3.0"`
- it doesn't support the `_workspace` entry

This means that doing a `deck dump` and then a `deck sync`
from one Gateway with workspaces to Konnect may not natively work
because of these incompatibilities.

This commit makes sure to support the new Konnect format in
the `deck convert` command. The new convertion does the following:
- set the `_format_version` entry to `"3.0"`
- handle the removal of the `_workspace` entry and the addition of
  the `_konnect.runtime_group_name` in the following manner:
  1. if present, remove the `_workspace` entry
  2. if `--konnect-runtime-group-name foo` flag is used, then set
     `_konnect.runtime_group_name: foo`
  3. if no `--konnect-runtime-group-name` flag is used, then set
     `_konnect.runtime_group_name` to the value `_workspace` was
     precedently set to
  4. if no `_workspace` was present and no
     `--konnect-runtime-group-name` flag is used, then leave
     the whole `_konnect` entry unset
@GGabriele GGabriele requested a review from a team as a code owner February 13, 2023 09:37
@GGabriele GGabriele temporarily deployed to Configure ci February 13, 2023 09:37 — with GitHub Actions Inactive
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

Successfully merging this pull request may close these issues.

None yet

1 participant