Descriptionstate: Prepare/UpdateUploadedCharm operations
This adds a new field to state.Charm's underlying
document: PendingUpload (false by default) and
two new state methods: PrepareLocalCharmUpload
and UpdateUploadedCharm, which are intended
to be called before and after the upcoming
charm upload support in the API server.
When a charm is uploaded, a unique revision
for it must be reserved in state, before the
actual upload to provider storage happens.
The revision is chosen as max(charmRev, stateRev+1),
where charmRev is the revision in charm URL
given to PrepareLocalCharmUpload() and stateRev
is the highest existing revision of the same
charm in state.
PendingUpload is false by default and can only
be changed by using the Prepare/Update methods.
Its inverse value is exposed through IsUploaded()
method of state.Charm.
PrepareLocalCharmUpload requires a charm URL
with a revision and local schema, and returns
the charm URL that was added to state.
UpdateUploadedCharm takes the same arguments
like AddCharm and returns the same as well.
It takes care of ensuring the given charm
URL refers to a charm in pending state and
updates its other info (meta, config, bundle
URL and SHA256), reseting the pending flag
to false.
https://code.launchpad.net/~dimitern/juju-core/219-state-charm-upload/+merge/198405
(do not edit description out of merge proposal)
Patch Set 1 #
Total comments: 22
Patch Set 2 : state: Prepare/UpdateUploadedCharm operations #Patch Set 3 : state: Prepare/UpdateUploadedCharm operations #
Total comments: 6
Patch Set 4 : state: Prepare/UpdateUploadedCharm operations #
MessagesTotal messages: 6
|