Skip to content

[Bug]: Plugin configuration fails due to incorrect lifecycle order (enabled before docker plugin set). #139

Description

@atharvamhaske

🐛 Bug Description

The test setup script configures the Docker plugin after enabling it, which breaks the expected Docker plugin lifecycle.

In scripts/test.sh, the plugin is first enabled with docker plugin enable swarm-external-secrets:temp, and only after that the script tries to update plugin permissions and runtime configuration using docker plugin set. On Docker managed plugins, docker plugin set is intended to be used while the plugin is disabled. Once the plugin is enabled, Docker treats the plugin as active and does not allow configuration changes in the normal flow.

Because this script uses set -e, the first failed docker plugin set command causes the entire script to exit immediately. That means the script fails before the plugin is fully configured for testing, even though the failure is caused by script ordering rather than by Vault connectivity, credentials, or plugin logic.

This makes the script unreliable as a local test/setup helper and can mislead contributors into debugging provider configuration when the real problem is that the plugin was enabled too early.


🔁 Steps to Reproduce

Steps to reproduce the behavior:

  1. Run scripts/test.sh.
  2. Let the script build and create swarm-external-secrets:temp.
  3. Let it reach the line that enables the plugin.
  4. Observe the next docker plugin set ... commands fail because the plugin is already enabled.

✅ Expected Behavior

The script should configure the plugin first, using docker plugin set while the plugin is disabled, and only then enable the plugin once all required settings and permissions have been applied.


❌ Actual Behavior

The script enables the plugin before applying docker plugin set commands. Docker rejects those configuration changes, and because the script runs with set -e, the script exits before test setup completes.


🧪 Reproducibility

  • Always
  • Sometimes
  • Rarely
  • Unable to reproduce

📸 Screenshots / Logs

Image

Relevant script flow in scripts/test.sh:

docker plugin enable swarm-external-secrets:temp

docker plugin set swarm-external-secrets:temp gid=0 uid=0

docker plugin set swarm-external-secrets:temp \
    VAULT_ADDR="https://152.53.244.80:8200" \
    VAULT_AUTH_METHOD="approle" \
    VAULT_ROLE_ID="..." \
    VAULT_SECRET_ID="..." \
    VAULT_MOUNT_PATH="secret" \
    VAULT_ENABLE_ROTATION="true" \
    VAULT_ROTATION_INTERVAL="1m"

Because the plugin is already enabled at this point, docker plugin set fails and the script exits.

Metadata

Metadata

Assignees

Labels

bugSomething isn't working

Type

No type

Projects

Status
In progress

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions