On 29 September 2016 at 21:58, Charles Butler <charles.but...@canonical.com>
wrote:

> TL;DR - would it be helpful to just initialize every resource stream, at
> index 0, a zero byte resource?  This aids users who are publishing charms
> with copyrighted bins, or proprietary components. And give an immediately
> publishable resource for streams.
>

I currently rely on resource-get failing if the resource hasn't been
uploaded, so I can catch the error and download via other channels.


> It occurred to me this week while we were revving through the kubernetes
> publication process, that on initial publish its best to have zero byte
> resources at index 0. So its easy to remember - "man which resource was the
> zero byte one?" it just corresponds to 0.
>
> Instead of having users touch, gzip, etc a null resource, would it be
> feasible to make the charm store have this convention by default? Every
> charm that declares a resource, that resource, in turn gets a resource-0
> allocated for zero byte, freeing the publisher of the charm to use the
> provided null resource?  seems like a better UX than asking the user to
> jump through hoops of say:
>
> touch null && gzip null && charm attach mycharm big-resource=null.gz
>
> There's likely a reason we didn't do this by default and I'm interested in
> hearing it. However, I'm more interested in finding out if we can
> streamline resource publication for our vendors and community.
>

I don't understand why you would do this. Having your charm download a
resource, unpack it and check if it is 0 bytes long seems a very long
winded way of doing try: resource_get() except: ...

-- 
Stuart Bishop <stuart.bis...@canonical.com>
-- 
Juju mailing list
Juju@lists.ubuntu.com
Modify settings or unsubscribe at: 
https://lists.ubuntu.com/mailman/listinfo/juju

Reply via email to