mirror of
https://github.com/kyverno/kyverno.git
synced 2025-03-31 03:45:17 +00:00
- fix variable validation; - update log level
Signed-off-by: Shuting Zhao <shutting06@gmail.com>
This commit is contained in:
parent
91713ee566
commit
4d01f76797
3 changed files with 3 additions and 7 deletions
|
@ -308,7 +308,7 @@ func main() {
|
||||||
case <-registerTicker.C:
|
case <-registerTicker.C:
|
||||||
err = webhookCfg.Register()
|
err = webhookCfg.Register()
|
||||||
if err != nil {
|
if err != nil {
|
||||||
setupLog.Info("Failed to register admission control webhooks")
|
setupLog.V(3).Info("Failed to register admission control webhooks", "reason", err.Error())
|
||||||
} else {
|
} else {
|
||||||
break loop
|
break loop
|
||||||
}
|
}
|
||||||
|
|
|
@ -156,11 +156,7 @@ func substituteVariablesIfAny(log logr.Logger, ctx context.EvalInterface) jsonUt
|
||||||
variable = strings.TrimSpace(variable)
|
variable = strings.TrimSpace(variable)
|
||||||
|
|
||||||
operation, err := ctx.Query("request.operation")
|
operation, err := ctx.Query("request.operation")
|
||||||
if err != nil {
|
if err == nil && operation == "DELETE" {
|
||||||
return nil, fmt.Errorf("failed to check request.operation")
|
|
||||||
}
|
|
||||||
|
|
||||||
if operation == "DELETE" {
|
|
||||||
variable = strings.ReplaceAll(variable, "request.object", "request.oldObject")
|
variable = strings.ReplaceAll(variable, "request.object", "request.oldObject")
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -498,6 +498,6 @@ func (wrc *Register) checkEndpoint() error {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
err = fmt.Errorf("Endpoint not ready")
|
err = fmt.Errorf("Endpoint not ready")
|
||||||
wrc.log.Error(err, "Endpoint not ready", "ns", config.KyvernoNamespace, "name", config.KyvernoServiceName)
|
wrc.log.V(3).Info(err.Error(), "ns", config.KyvernoNamespace, "name", config.KyvernoServiceName)
|
||||||
return err
|
return err
|
||||||
}
|
}
|
||||||
|
|
Loading…
Add table
Reference in a new issue