Skip to content

Concourse extension confused by docker-image resource type #196

Closed

Description

@marco-m

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

Activity

  1. kdvolder commented on Feb 4, 2019

    @kdvolder
    Member

    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.

  2. marco-m commented on Feb 4, 2019

    @marco-m
    Author

    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?

  3. kdvolder commented on Feb 4, 2019

    @kdvolder
    Member

    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.

  4. added this to the 4.1.2.RELEASE milestone on Feb 5, 2019
  5. marco-m commented on Feb 5, 2019

    @marco-m
    Author

    Wow thanks @kdvolder I appreciate!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions