Skip to content

Commit

Permalink
Fix log message (#1779)
Browse files Browse the repository at this point in the history
* update log message

Signed-off-by: Shuting Zhao <shutting06@gmail.com>

* update printer column - validation failure action

Signed-off-by: Shuting Zhao <shutting06@gmail.com>
  • Loading branch information
realshuting committed Apr 8, 2021
1 parent e2cd04c commit f3ca1d7
Show file tree
Hide file tree
Showing 6 changed files with 7 additions and 7 deletions.
2 changes: 1 addition & 1 deletion charts/kyverno/crds/crds.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -1165,7 +1165,7 @@ spec:
name: Background
type: string
- jsonPath: .spec.validationFailureAction
name: Validation Failure Action
name: Action
type: string
name: v1
schema:
Expand Down
2 changes: 1 addition & 1 deletion definitions/crds/kyverno.io_policies.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ spec:
name: Background
type: string
- jsonPath: .spec.validationFailureAction
name: Validation Failure Action
name: Action
type: string
name: v1
schema:
Expand Down
2 changes: 1 addition & 1 deletion definitions/install.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -1170,7 +1170,7 @@ spec:
name: Background
type: string
- jsonPath: .spec.validationFailureAction
name: Validation Failure Action
name: Action
type: string
name: v1
schema:
Expand Down
2 changes: 1 addition & 1 deletion definitions/install_debug.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -1170,7 +1170,7 @@ spec:
name: Background
type: string
- jsonPath: .spec.validationFailureAction
name: Validation Failure Action
name: Action
type: string
name: v1
schema:
Expand Down
2 changes: 1 addition & 1 deletion pkg/api/kyverno/v1/policy_types.go
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ type PolicyList struct {
// +kubebuilder:object:root=true
// +kubebuilder:subresource:status
// +kubebuilder:printcolumn:name="Background",type="string",JSONPath=".spec.background"
// +kubebuilder:printcolumn:name="Validation Failure Action",type="string",JSONPath=".spec.validationFailureAction"
// +kubebuilder:printcolumn:name="Action",type="string",JSONPath=".spec.validationFailureAction"
// +kubebuilder:resource:shortName=pol
type Policy struct {
metav1.TypeMeta `json:",inline,omitempty" yaml:",inline,omitempty"`
Expand Down
4 changes: 2 additions & 2 deletions pkg/policy/validate.go
Original file line number Diff line number Diff line change
Expand Up @@ -153,10 +153,10 @@ func Validate(policy *kyverno.ClusterPolicy, client *dclient.Client, mock bool,
obj.SetLabels(label)
_, err = client.UpdateResource(obj.GetAPIVersion(), rule.Generation.Kind, rule.Generation.Clone.Namespace, obj, false)
if err != nil {
log.Log.Error(err, "failed to update source name:%v namespace:%v kind:%v", obj.GetName(), obj.GetNamespace(), obj.GetKind())
log.Log.Error(err, "failed to update source", "kind", obj.GetKind(), "name", obj.GetName(), "namespace", obj.GetNamespace())
continue
}
log.Log.V(4).Info("updated source name:%v namespace:%v kind:%v", obj.GetName(), obj.GetNamespace(), obj.GetKind())
log.Log.V(4).Info("updated source", "kind", obj.GetKind(), "name", obj.GetName(), "namespace", obj.GetNamespace())
}
}
}
Expand Down

0 comments on commit f3ca1d7

Please sign in to comment.