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

deck file render removes tags of config_group scoped plugins #1417

Open
mheap opened this issue Oct 17, 2024 · 0 comments
Open

deck file render removes tags of config_group scoped plugins #1417

mheap opened this issue Oct 17, 2024 · 0 comments

Comments

@mheap
Copy link
Member

mheap commented Oct 17, 2024

Problem Statement:

When using deck file render using file which contains consumer_group scoped plugins which have tags defined, the output no longer has tags for those plugins.

Problem Analysis:

For some reason, the deck file render command does not keep tags on consumer_grpup scoped plugins
kong config db_export produces a declarative config with tags on consumer_group scoped plugins so there does not seem to be a limitation with the declarative config that would prevent the tags to be created

Steps to Reproduce:

Create kong-rendered.json using this command:

deck file render kong-common-consumer-groups.yaml kong-plugin.yaml kong-service.yaml -o kong-rendered.json --format json
# kong-service.yaml
_format_version: "3.0"
services:
- connect_timeout: 60000
  enabled: true
  host: httpbin.org
  name: customerinfo-v3
  path: /anything
  port: 80
  protocol: http
  read_timeout: 60000
  retries: 5
  tags:
  - customerinfo-v3
  - ' manual'
  write_timeout: 60000
# kong-plugin.yaml
_format_version: "3.0"
_transform: true

# global plugins
plugins:
# global, tags remains
- name: request-transformer
  tags:
  - manual
  - global
  - kong-common-plugin-request-transformer
  config:
    add:
      headers:
      - Global:Demo
# per service, tags remain
- name: request-transformer #request-transformer-advanced
  service: customerinfo-v3
  tags:
  - customerinfo-v3
  - manual
  - kong-common-plugin-request-transformer
  config:
    add:
      headers:
      - Service:Demo

# per consumer_group, TAGS LOST in deck render
- name: request-transformer #request-transformer-advanced
  consumer_group: Silver
  #service: customerinfo-v3
  tags:
  - Silver
  - manual
  - kong-common-plugin-request-transformer
  config:
    add:
      headers:
      - CG-Silver:Demo

# per consumer_group, TAGS LOST in deck render
- name: request-transformer #request-transformer-advanced
  consumer_group: Bronze
  tags:
  - Bronze
  - manual
  - kong-common-plugin-request-transformer
  config:
    add:
      headers:
      - CG-Bronze:Demo

# per consumer_group, TAGS LOST in deck render
- name: request-transformer #request-transformer-advanced
  consumer_group: Gold
  tags:
  - Gold
  - manual
  - kong-common-plugin-request-transformer
  config:
    add:
      headers:
      - CG-Gold:Demo
# kong-common-consumer-groups.yaml
_format_version: "3.0"
_transform: true
consumer_groups:
- name: Gold
  tags:
  - ConsumerGroupGold
  - ConsumerGroup
  - Gold
- name: Silver
  tags:
  - ConsumerGroupSilver
  - ConsumerGroup
  - Silver
- name: Bronze
  tags:
  - ConsumerGroupBronze
  - ConsumerGroup
  - Bronze

Check the file to see that the consumer_group scoped plugins do not have the tags as defined in kong-plugin.yaml

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

1 participant