juju / charmstore-client

Client for charmstore.
Other
9 stars 22 forks source link

proof errors during`charm publish` should fail: stating that the charm fails 'proof' #76

Open lazypower opened 8 years ago

lazypower commented 8 years ago

I've pushed and published to my namespace prior. Example being:

cs:~lazypower/trusty/kubernetes-1

The push/publish cycle worked well until i pushed and omitted the series information in the push path, as illustrated below:

$ charm push . cs:~lazypower/kubernetes
url: cs:~lazypower/kubernetes-2
channel: unpublished
$ charm publish cs:~lazypower/kubernetes-2
ERROR cannot publish charm or bundle: cannot publish charm or bundle: cannot update base entity for "cs:~lazypower/kubernetes-2": Field name duplication not allowed with modifiers

Looking further into the problem, the error message was helpful but it wasn't apparent what I should do.

The metadata had quite a few duplicated fields as byproduct of the build process, and needed to be de-duped which can be seen in: https://github.com/juju/charm-tools/issues/186

After correcting the metadata, and re-issuing charm push I was able to publish with a well-formed charm. Which is verified by cs:~lazypower/kubernetes-3

If we are proofing during charm push we should additionally add duplication scanning on the metadata keys to our own charm proof in the charm-tools module.

bac commented 8 years ago

Whatever the root cause of this problem turns out to be, the error message provided should be more explanatory from a user-perspective.