You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
More info on the use of 'params' in resource_type declaration #273
However, I suspect that these params actually are a lot less arbitrary than the doc suggests. Are the parameters in fact used in the same way as would be the parameters in a get step? If so then I guess it makes sense for our editor to validate them in the same way? (i.e. for resource type like 'registry_image' we know what to expect there and so we can actually validate it.
Anyhow. The docs may not need to actually be modified (consider doing that at your own discretion), but I would like to be sure I am understanding things correctly before adding validation logic to our editor. So I would appreciate at least an answer here.
@kdvolder That's pretty cool that your editor is going that far to validate!
tl;dr - I think if your editor knows about the params that a resource type will accept, then you can look up the rule for the type: field on a resource type and validate the given params against that.
My understanding of params: on a resource type is pretty much what you said. Every resource type has a base type that it's constructed from, and the params: that you pass to the resource_types: config are the ones that get passed to the underlying type when concourse pulls it (concourse will check for versions of the custom resource type the same way it checks for concrete resources, and pull when it needs to construct a resource-related container for the custom resource). In the vast majority of cases, the base type is registry-image or docker-image, and so those params will be handled the same way those resource types normally handle params on a get.
Given how brief the current doc is, I could imagine expanding it a bit to make the connection with the params that get passed to a get. It strikes me as an important insight.
Okay thanks for confirming my guess about the 'params' being handled just like the params on a get step.
if your editor knows about the params that a resource type will accept ...
It does but only for a supported set of 'built-in' resource types. But since registry_image is one of those supported resources, I think it makes sense for our editor to validate the params here.
Activity
kdvolder commentedon Oct 31, 2019
Related issue: spring-projects/spring-tools#382
jamieklassen commentedon Nov 1, 2019
@kdvolder That's pretty cool that your editor is going that far to validate!
tl;dr - I think if your editor knows about the
paramsthat a resource type will accept, then you can look up the rule for thetype:field on a resource type and validate the given params against that.My understanding of
params:on a resource type is pretty much what you said. Every resource type has a base type that it's constructed from, and theparams:that you pass to theresource_types:config are the ones that get passed to the underlying type when concourse pulls it (concourse will check for versions of the custom resource type the same way it checks for concrete resources, and pull when it needs to construct a resource-related container for the custom resource). In the vast majority of cases, the base type isregistry-imageordocker-image, and so those params will be handled the same way those resource types normally handle params on a get.Given how brief the current doc is, I could imagine expanding it a bit to make the connection with the
paramsthat get passed to aget. It strikes me as an important insight.kdvolder commentedon Nov 4, 2019
Okay thanks for confirming my guess about the 'params' being handled just like the params on a get step.
It does but only for a supported set of 'built-in' resource types. But since
registry_imageis one of those supported resources, I think it makes sense for our editor to validate the params here.jamieklassen commentedon Nov 4, 2019
Totally agree, and let's leave this issue open to help fill that gap for future doc readers
Resolve #273
Resolve concourse#273