Skip to content

template_resolver fails on empty object-templates-raw fields #201

@bobh66

Description

@bobh66

When running template_resolver on a policy from an existing cluster, it may encounter object_templates_rawset to an empty string. This can happen when a conditional policy template for a cluster results in no policies being created. This is a valid scenario on the cluster but template_resolver has an explicit check in processObjTemplatesRaw() for an empty object-templates-raw string value and returns failure.

This blocks processing of the rest of the policies instead of just ignoring the empty template.

If it's acceptable I can push a PR to have the function return nil on an empty string value for object-templates-raw so that it can continue to process the rest of the policy.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions