Skip to content

Request: Support wildcards in --namespace #1141

@tonglil

Description

@tonglil

Would like to re-open #339 to natively support wildcard/globbing namespace.

I would prefer to be able to specify --namespace my.namespace.* natively, rather than first parse with bash and then pass in many --namespace flags.

This is especially needed given the existence of the --combine flag.

My rules are organized like:

policy/
├── data
│   ├── combined
│   └── simple
├── k8s
│   ├── combined
│   │   ├── deployment
│   │   ├── hpa
│   │   └── pod
│   └── simple
│       ├── deployment
│       ├── hpa
│       └── pod
└── terraform
    ├── combined
    └── simple

I would like to be able to execute rules in combined namespaces only with the --combine flag, and the simple namespaces without it, like so:

 # data and terraform namespaces only
conftest test target/ --namespace *.simple
conftest test target/ --namespace *.combined --combine

 # k8s only
conftest test target/ --namespace k8s.simple.*
conftest test target/ --namespace k8s.combined.* --combine

Metadata

Metadata

Assignees

No one assigned

    Labels

    enhancementNew feature or request

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions