mirror of
https://github.com/cloudnative-pg/plugin-barman-cloud.git
synced 2026-01-12 05:33:11 +01:00
fix: inject the sidecar only during Pod/Job creation
Closes #377 Signed-off-by: Marco Nenciarini <marco.nenciarini@enterprisedb.com>
This commit is contained in:
parent
8fcd748c3b
commit
baa88b630e
@ -95,6 +95,15 @@ func (impl LifecycleImplementation) LifecycleHook(
|
|||||||
return nil, nil
|
return nil, nil
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// Only allow modifications during EVALUATE or CREATE operations.
|
||||||
|
// For PATCH, UPDATE, or other operations, skip processing as the operator will handle changes during EVALUATE.
|
||||||
|
if *operation != lifecycle.OperatorOperationType_TYPE_EVALUATE &&
|
||||||
|
*operation != lifecycle.OperatorOperationType_TYPE_CREATE {
|
||||||
|
contextLogger.Trace("Skipping lifecycle hook: operation is not EVALUATE or CREATE",
|
||||||
|
"operation", operation.String())
|
||||||
|
return nil, nil
|
||||||
|
}
|
||||||
|
|
||||||
switch kind {
|
switch kind {
|
||||||
case "Pod":
|
case "Pod":
|
||||||
contextLogger.Info("Reconciling pod")
|
contextLogger.Info("Reconciling pod")
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user