Hi,
Plugin arguments sourced from secrets aren’t working for me in a plugin. The plugin source itself is available here: https://gitlab.com/bnmcg/drone-helm-push/-/blob/master/main.go
My pipeline:
kind: pipeline
type: kubernetes
name: myproject
steps:
- name: publish-image
image: plugins/docker
settings:
registry: docker.myorg.com
repo: docker.myorg.com/myorg/myproject
username:
from_secret: DOCKER_USERNAME
password:
from_secret: DOCKER_PASSWORD
auto_tag: true
when:
event:
- tag
- name: publish-chart
image: bnmcg/drone-helm-push:2.2.2
settings:
chart_path: helm/myproject
repository_username:
from_secret: DOCKER_USERNAME
repository_password:
from_secret: DOCKER_PASSWORD
repository_uri: https://charts.myorg.com
# when:
# event:
# - promote
# target:
# - chart
- name: deploy
image: docker.myorg.com/bnmcg/drone-helm
settings:
chart: myorg/myproject
skip_tls_verify: true
release: myproject
namespace: myorg
helm_repos: myorg=https://charts.myorg.com
client_only: true
values: image.tag=${DRONE_TAG##v}
values_files: helm/values.production.yaml
environment:
API_SERVER:
from_secret: API_SERVER
KUBERNETES_TOKEN:
from_secret: KUBERNETES_TOKEN
when:
event:
- promote
target:
- production
the chart_path
and repository_uri
parameters are correctly injected as PLUGIN_REPOSITORY_URI
and PLUGIN_CHART_PATH. However,
repository_usernameand
repository_password` don’t appear as environment variables.
If I set the value of repository_username
and repository_password
to strings, instead of sourcing from from_secret: ...
, then the variables are injected into the environment correctly.
I’m using Drone 1.6.5 and the Kubernetes runner.
Drone repo info:
Owner: myorg
Repo: myproject
Config: .drone.yml
Visibility: private
Private: true
Trusted: false
Protected: false
Remote: https://gitlab.com/myorg/myproject.git
Drone build info:
Number: 37
Status: failure
Event: push
Commit: 2320dc0bbed51b975ec2807c88a776620bb5c504
Branch: master
Ref: refs/heads/master
Author: bnmcg
Message: Print arguments
Drone secret info tells me “json: cannot unmarshal array into Go value of type drone.Secret”. The secrets in question are sourced from DRONE_RUNNER_ENV
. They do work correctly in other plugins (eg: the Docker plugin).