Trouble with 1.0.0-rc.2 and plugins/ecr

Hello!

I try to use 1.0.0-rc.2 with k8s. All good, but plugins/ecr is not working.

- name: publish
  image: plugins/ecr
  settings:
    access_key:
      from_secret: aws_access_key_id
    secret_key:
      from_secret: aws_secret_access_key
    region: "<region>"
    registry: "<registry>"
    repo: "<registry>/<repo>"

Secrets are working, I was verify it.

For reproduce try:

 $ docker run --rm -v (pwd):/drone/src -w /drone/src \
    -e PLUGIN_ACCESS_KEY='<******>' \
    -e PLUGIN_SECRET_KEY='<******>' \
    -e PLUGIN_REGION='<region>' \
    -e PLUGIN_REGISTRY='<registry>' \
    -e PLUGIN_REPO='<registry>/<repo>' \
    plugins/ecr

+ /usr/local/bin/dockerd -g /var/lib/docker
time="2018-12-20T13:30:28Z" level=fatal msg="Error authenticating: exit status 1"

I add “–privileged” flag — all worked!
“DRONE_PLUGIN_PRIVILEGED” and “DRONE_ESCALATE” is not working (and do not exists in documentation).

But I can’t set “privileged: true” in drone: “linter: untrusted repositories cannot enable privileged mode”.
And I can’t set “trusted: true”:

 $ drone repo update --trusted=true <repo>
Successfully updated repository <repo>
 $ drone repo info <repo> | grep "Trusted:"
Trusted: false

How to fix this? I don’t want downgrade to 0.8!

I can tell you that this value is working, otherwise the docker plugin would fail. You can see here it is passing with rc.2 Drone CI

Note that plugins/ecr is automatically added to DRONE_PLUGIN_PRIVILEGED so you do not need to set this manually.

plugins/docker is working. plugins/ecr is not. Bug?

Hmm… DRONE_PLUGIN_PRIVILEGED is agent setting, but I don’t have an agent… Sorry, I found this variable in google. :slight_smile:
May be I found something like DRONE_KUBERNETES_PLUGIN_PRIVILEGED?

All drone parameters are defined here:
https://docs.drone.io/reference/

These below plugins are hard-coded to run in privileged mode in the Drone source code. You will see the ecr plugin is included in this list, which means nothing needs to be configured manually.

	comp.PrivilegedFunc = compiler.DindFunc(
		append(
			r.Privileged,
			"plugins/docker",
			"plugins/ecr",
			"plugins/gcr",
			"plugins/heroku",
		),
	)

I understand. But it is not working for me and plugins/docker works perfectly.
Do you know somebody person who use it?

I will try it tomorrow again.

Any solution for this problem??