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

Concourse extension confused by docker-image resource type #196

Closed
marco-m opened this issue Feb 4, 2019 · 4 comments
Closed

Concourse extension confused by docker-image resource type #196

marco-m opened this issue Feb 4, 2019 · 4 comments
Milestone

Comments

@marco-m
Copy link

marco-m commented Feb 4, 2019

Hello,

consider a pipeline beginning with:

resource_types:

- name: docker-image
  privileged: true
  type: docker-image
  source:
    repository: concourse/docker-image-resource

This seems bizarre at first, on the other hand the repetition of docker-image in the name: and type: is needed, since docker-image is a special one.

The stanza above uses the built-in docker-image to download this new docker-image and use it during the pipeline. Confusing at first but it works :-)

The extension is confused and reports an non existing error:

duplicate

@kdvolder
Copy link
Member

kdvolder commented Feb 4, 2019

The error is not really because the name and type are the same (this odd also, but I don't think we actually check for this). The reason it gives the error is because the name in name: docker-image is already defined as a resource type.

I can probably add some sort of a check to special case built-in resource types like docker-image and allow them to be redefined. Is there a good reason why you want to do something like this? It seems a bit odd and circular to me. Why couldn't you just call it my-docker-image or custom-docker-image or something like that? Wouldn't that actually be cleaner than overwriting an existing resource type?

Anyhoo, I can probably make this error 'go away'. I'd just like to understand a bit better first... to make sure it is really a good idea to forego the check.

@marco-m
Copy link
Author

marco-m commented Feb 4, 2019

Thanks for the quick answer!
The use case is the same than overwriting another built-in resource like s3 or git: use in the pipeline the new version, obtained from the docker registry, and not the built-in. The reason to do so can be:

  • use a new feature of the resource
  • a bugfix
  • testing a specific version, maybe a fork, of the resource itself

Does it make sense?

@kdvolder
Copy link
Member

kdvolder commented Feb 4, 2019

Does it make sense?

Yes... and no. I guess if I was going to use an alternate implementation, of a builltin resource type, I'd probably just give it a different name. Anyhoo, I guess that's just me. Seems like, though this probably not common, we should probably assume people may do this kind of redefinition, and it shouldn't be flagged as a error by the editor.

@marco-m
Copy link
Author

marco-m commented Feb 5, 2019

Wow thanks @kdvolder I appreciate!

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

4 participants