Skip to content

Removing policy from the list of enabled policies might cause panic #15572

@lobkovilya

Description

@lobkovilya

Description

Kuma has a list of enabled policies, removing the policy from the list supposed to disable all the API endpoints related to the policy

plugins:
resources:
hostnamegenerators: true
meshexternalservices: true
meshidentities: true
meshmultizoneservices: true
meshservices: true
meshtrusts: true
workloads: true
policies:
meshaccesslogs: true
meshcircuitbreakers: true
meshfaultinjections: true
meshhealthchecks: true
meshhttproutes: true
meshloadbalancingstrategies: true
meshmetrics: true
meshpassthroughs: true
meshproxypatches: true
meshratelimits: true
meshretries: true
meshtcproutes: true
meshtimeouts: true
meshtlses: true
meshtraces: true
meshtrafficpermissions: true

However, it might cause panic, because ordered.Policies list contains hardcoded policy types

allPlugins := core_plugins.Plugins().PolicyPlugins(ordered.Policies)

Attempting to call PolicyPlugins with ordered.Policies is going to result in panic

panic(fmt.Sprintf("Couldn't find plugin %s", policy))

Metadata

Metadata

Assignees

No one assigned

    Labels

    kind/bugA bugtriage/acceptedThe issue was reviewed and is complete enough to start working on it

    Type

    No type

    Projects

    No projects

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions