Skip to content

tags.go.tpl file in code-generator doesn't handle some edge cases #1549

@kyriechen96

Description

@kyriechen96

Describe the bug
By using v0.20.1 version of code generator to generate controller, the function of ToACKTags cannot handle edge case of tag that both key and value are nil.

Steps to reproduce
applying yaml file:

apiVersion: memorydb.services.k8s.aws/v1alpha1
kind: ParameterGroup
metadata:
  name: test
spec:
    description: test
    family: memorydb_redis6
    name: test
    parameterNameValues:
          - parameterName: activerehashing
            parameterValue: "no"
    tags:
     - key: "1"
       value: "1"
     - key: 

Expected outcome
Controller works well.

Outcome
Controller stops running after applying a tag with nil key and nil value.

Metadata

Metadata

Assignees

No one assigned

    Labels

    area/runtimeIssues or PRs as related to controller runtime, common reconciliation logic, etckind/bugCategorizes issue or PR as related to a bug.

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions