Little late to the party, but I'd like to throw this alternate format out
there for consideration:
ACTION DESCRIPTION
clean-containers Garbage collect non-running containers
clean-images Garbage collect non-running images
guestbook-example Launch the guestbook example in your k8s cluster
microbot Launch microbot containers
pause Cordon the unit, pausing all future workload
scheduling on this unit, and drains active
workloads
resume UnCordon the unit, enabling workload scheduling.
Workloads will automatically balance into the unit
If it's acceptable, we might not need to worry so much about the length of
descriptions. I've attached a small demo so you can resize your terminal
and get a feel for it.
Cheers,
Rye
On Tue, Aug 23, 2016 at 9:19 AM, Charles Butler <
[email protected]> wrote:
> I took this feedback and updated the PR upstream. The new action
> descriptions will go out with the next publication of the charm.
>
> https://github.com/kubernetes/kubernetes/pull/31202
>
> If there are any further feedback items about the action descriptions it
> would be great to capture them on the bug so we can settle on crisp
> messaging to the end user what exactly is happening.
>
> I moved the longer descriptions to the README, so the full text wasn't
> lost and it's very clear to the end user what the actions are doing on
> their behalf.
>
> All the best,
>
> Charles
>
>
> On Tue, Aug 23, 2016 at 7:03 AM Mark Shuttleworth <[email protected]> wrote:
>
>>
>> Working with the Kubernetes charms today (thanks Chuck & friends) I saw
>> this:
>>
>>
>> $ juju list-actions kubernetes
>> ACTION DESCRIPTION
>> clean-containers Garbage collect non-running containers
>> clean-images Garbage collect non-running images
>> guestbook-example Launch the guestbook example in your k8s cluster
>> microbot Launch microbot containers
>> pause Cordon the unit, pausing all future workload
>> scheduling on this unit,
>> and drains active workloads
>> resume UnCordon the unit, enabling workload scheduling. Workloads
>> will automatically balance into the unit
>>
>>
>> The fact that we have a bunch of useful operational actions crowdsources
>> for Kubernetes is brilliant, but the way that list gets wonky towards
>> the end with overrunning text lines is a niggle. Should we just
>> hard-truncate such descriptions in a single line, so reinforce the
>> social contract around keeping those summaries one-line friendly?
>>
>>
>> Mark
>>
>>
>>
>> --
>> Juju mailing list
>> [email protected]
>> Modify settings or unsubscribe at: https://lists.ubuntu.com/
>> mailman/listinfo/juju
>>
> --
> Juju Charmer
> Canonical Group Ltd.
> Ubuntu - Linux for human beings | www.ubuntu.com
> Juju - The fastest way to model your service | www.jujucharms.com
>
> --
> Juju mailing list
> [email protected]
> Modify settings or unsubscribe at: https://lists.ubuntu.com/
> mailman/listinfo/juju
>
>
#!/usr/bin/env python3
import shutil
data = [
('ACTION', 'DESCRIPTION'),
('clean-containers', 'Garbage collect non-running containers'),
('clean-images', 'Garbage collect non-running images'),
('guestbook-example', 'Launch the guestbook example in your k8s cluster'),
('microbot', 'Launch microbot containers'),
('pause', 'Cordon the unit, pausing all future workload scheduling on this unit, and drains active workloads'),
('resume', 'UnCordon the unit, enabling workload scheduling. Workloads will automatically balance into the unit'),
]
actionWidth = max([len(d[0]) for d in data])
cols = shutil.get_terminal_size().columns
tab = 2
descWidth = cols - (tab + actionWidth)
# print('*' * actionWidth + ' ' * tab + '*' * descWidth)
for item in data:
action = item[0].ljust(actionWidth)
desc = item[1]
lines = []
line = ''
remaining = descWidth
for word in desc.split(' '):
if len(word) + 1 < remaining:
line += word + ' '
remaining -= len(word) + 1
else:
lines.append(line + '\n')
line = word + ' '
remaining = descWidth
remaining -= len(word) + 1
lines.append(line)
lines = (' ' * (actionWidth + tab)).join(lines)
print(action + ' ' * tab + lines + '\n')
--
Juju mailing list
[email protected]
Modify settings or unsubscribe at:
https://lists.ubuntu.com/mailman/listinfo/juju