Skip to content

Restore action jobs override ActionSet environment with workload values #10626

Open

Description

@weicao

Bug

Post-ready restore jobs inherit the target workload container environment after composing DataProtection and ActionSet environment variables. When both layers define the same name, the workload value wins.

This can replace an ActionSet value that intentionally references DataProtection target identity. For example, a RabbitMQ post-ready action declares:

RABBITMQ_NODENAME: rabbit@$(DP_TARGET_POD_NAME).$(K8S_SERVICE_NAME).$(POD_NAMESPACE)

but the generated Job receives the workload value based on $(POD_NAME). Restore action jobs also do not provide DP_TARGET_POD_NAME and DP_TARGET_POD_ROLE, unlike backup jobs.

Expected behavior

Restore Job environment composition has deterministic precedence:

  1. target workload environment
  2. DataProtection common/current-target variables
  3. ActionSet environment
  4. BackupMethod environment
  5. Restore environment

Higher-priority duplicate names should appear at the higher layer's position so Kubernetes can expand references to variables declared earlier. The generated environment should contain unique names, preserve envFrom, and use the current target pod identity rather than the backup source pod identity.

Scope

Keep this behavior local to restore Job construction. Do not change the global environment merge helper used by other controllers.

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions