Skip to content

Kubectl explain shows html #1148

Open
Open
@kravciak

Description

@kravciak

For example namespaceSelector contains a lot of  , but there are other html tags in our documentation.

~ kubectl explain cap.spec.namespaceSelector

GROUP:      policies.kubewarden.io
KIND:       ClusterAdmissionPolicy
VERSION:    v1

FIELD: namespaceSelector <Object>


DESCRIPTION:
    NamespaceSelector decides whether to run the webhook on an object based
    on whether the namespace for that object matches the selector. If the
    object itself is a namespace, the matching is performed on
    object.metadata.labels. If the object is another cluster scoped resource,
    it never skips the webhook.
    <br/><br/>
    For example, to run the webhook on any objects whose namespace is not
    associated with "runlevel" of "0" or "1";  you will set the selector as
    follows:
    <pre>
    "namespaceSelector": \{<br/>
    &nbsp;&nbsp;"matchExpressions": [<br/>
    &nbsp;&nbsp;&nbsp;&nbsp;\{<br/>
    &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;"key": "runlevel",<br/>
    &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;"operator": "NotIn",<br/>
    &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;"values": [<br/>
    &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;"0",<br/>
    &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;"1"<br/>
    &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;]<br/>
    &nbsp;&nbsp;&nbsp;&nbsp;\}<br/>
    &nbsp;&nbsp;]<br/>
    \}
    </pre>
    If instead you want to only run the webhook on any objects whose
    namespace is associated with the "environment" of "prod" or "staging";
    you will set the selector as follows:
    <pre>
    "namespaceSelector": \{<br/>
    &nbsp;&nbsp;"matchExpressions": [<br/>
    &nbsp;&nbsp;&nbsp;&nbsp;\{<br/>
    &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;"key": "environment",<br/>
    &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;"operator": "In",<br/>
    &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;"values": [<br/>
    &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;"prod",<br/>
    &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;"staging"<br/>
    &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;]<br/>
    &nbsp;&nbsp;&nbsp;&nbsp;\}<br/>
    &nbsp;&nbsp;]<br/>
    \}
    </pre>
    See
    https://kubernetes.io/docs/concepts/overview/working-with-objects/labels
    for more examples of label selectors.
    <br/><br/>
    Default to the empty LabelSelector, which matches everything.
    
FIELDS:
  matchExpressions	<[]Object>
    matchExpressions is a list of label selector requirements. The requirements
    are ANDed.

  matchLabels	<map[string]string>
    matchLabels is a map of {key,value} pairs. A single {key,value} in the
    matchLabels
    map is equivalent to an element of matchExpressions, whose key field is
    "key", the
    operator is "In", and the values array contains only "value". The
    requirements are ANDed.

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    Status

    No status

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions