Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Receiving "error in the configuration: both spec and arguments provided: configuration error" #41

Open
joe-elliott opened this issue Apr 26, 2023 · 4 comments

Comments

@joe-elliott
Copy link

joe-elliott commented Apr 26, 2023

So this seems to be related to this change:

#40

Our configuration looks like:

- image: plugins/manifest
  name: manifest-tempo
  settings:
    password:
      from_secret: docker_password
    spec: .drone/docker-manifest.tmpl
    target: tempo
    username:
      from_secret: docker_username

and our template looks like:


image: grafana/{{config.target}}
tags:
  - latest
  - {{build.tags}}
manifests:
  - image: grafana/{{config.target}}:{{build.tags}}-amd64
    platform:
      architecture: amd64
      os: linux
  - image: grafana/{{config.target}}:{{build.tags}}-arm64
    platform:
      architecture: arm64
      os: linux

in particular this condition is causing our issue:

} else if len(args.Platforms) != 0 || args.Target != "" || args.Template != "" {

is it intentional that we can't provide a target and a template? note that we use the target in our template. is there a better way to do that?

@donny-dont
Copy link
Contributor

Hey @joe-elliott so in the 1.4.0 version of this plugin there were two paths. The spec path and the from-args path. If you had a spec path then it would ignore any settings values that from-args would use. For this newer implementation I made it an error when that happened because it isn't clear to the plugin which path it should be taking.

I also stopped the configuration values from being added because a username and password is being provided in it so by having it go into a template file there's potential for those secrets leaking.

Are you using the template multiple times in a pipeline? If not just replace {{config.target}} with tempo. If so we should iterate on a solution for your project.

@joe-elliott
Copy link
Author

Yeah, we are using it 3 times:

https://github.com/grafana/tempo/blob/main/.drone/drone.yml#L137-L163

Is there a way to pass in arbitrary key value pairs and build the template off of that? Something like:

- image: plugins/manifest
  name: manifest-tempo
  settings:
    spec: .drone/docker-manifest.tmpl
    templateVals:
      target: tempo

@donny-dont
Copy link
Contributor

Not currently but that's something we can do. @joe-elliott could you pin the manifest plugin at 1.4.0 till this is resolved?

@joe-elliott
Copy link
Author

Not currently but that's something we can do. @joe-elliott could you pin the manifest plugin at 1.4.0 till this is resolved?

Can do. Thanks for the quick response @donny-dont

ikaruswill added a commit to ikaruswill/docker-alpine-rsync-ssh that referenced this issue Jun 16, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants