Skip to content

Commit

Permalink
column misspelling (#1290)
Browse files Browse the repository at this point in the history
* column misspelling

* edit description with tip about conditional adds

* Enhance bug report template
  • Loading branch information
chipzoller committed Nov 23, 2020
1 parent b7b2eca commit 7ee346b
Show file tree
Hide file tree
Showing 3 changed files with 11 additions and 2 deletions.
9 changes: 8 additions & 1 deletion .github/ISSUE_TEMPLATE/bug_report.md
@@ -1,12 +1,18 @@
---
name: Bug report
about: Create a report to help us improve
about: Create a report to help us improve.
title: "[BUG]"
labels: bug
assignees: ''

---

**Software version numbers**
State the version numbers of applications involved in the bug.

* Kubernetes version:
* Kyverno version:

**Describe the bug**
A clear and concise description of what the bug is.

Expand All @@ -22,5 +28,6 @@ A clear and concise description of what you expected to happen.

**Screenshots**
If applicable, add screenshots to help explain your problem.

**Additional context**
Add any other context about the problem here.
2 changes: 1 addition & 1 deletion pkg/api/kyverno/v1/clusterpolicy_types.go
Expand Up @@ -12,7 +12,7 @@ import (
// +kubebuilder:subresource:status
// +kubebuilder:resource:path=clusterpolicies,scope="Cluster",shortName=cpol
// +kubebuilder:printcolumn:name="Background",type="string",JSONPath=".spec.background"
// +kubebuilder:printcolumn:name="Validatoin Failure Action",type="string",JSONPath=".spec.validationFailureAction"
// +kubebuilder:printcolumn:name="Validation Failure Action",type="string",JSONPath=".spec.validationFailureAction"
type ClusterPolicy struct {
metav1.TypeMeta `json:",inline,omitempty" yaml:",inline,omitempty"`
metav1.ObjectMeta `json:"metadata,omitempty" yaml:"metadata,omitempty"`
Expand Down
2 changes: 2 additions & 0 deletions samples/AddDefaultLabels.md
Expand Up @@ -2,6 +2,8 @@

Labels are important pieces of metadata that can be attached to just about anything in Kubernetes. They are often used to tag various resources as being associated in some way. Kubernetes has no ability to assign a series of "default" labels to incoming objects. This sample policy shows you how to assign one or multiple labels by default to any object you wish. Here it shows adding a label called `custom-foo-label` with value `my-bar-default` to resources of type `Pod`, `Service`, and `Namespace` but others can be added or removed as desired.

Alternatively, you may wish to only add the `custom-foo-label` if it is not already present in the creation request. For example, if a user/process submits a request for a new `Namespace` object and the manifest already includes the label `custom-foo-label` with a value of `custom-value`, Kyverno can leave this label untouched which results in the newly-created object having the label `custom-foo-label=custom-value` instead of `my-bar-default`. In order to do this, enclose the label in the sample manifest in `+()` so the key name becomes `+(custom-foo-label)`. This conditional instructs Kyverno to only add the label if absent.

## Policy YAML

[add_default_labels.yaml](more/add_default_labels.yaml)
Expand Down

0 comments on commit 7ee346b

Please sign in to comment.