Commit ea198dd
authored
Convert outstanding commands to cobra (#2384)
* magnum-auto-healer: Stop registering klog options
Per [1], this is no longer desirable. We are already registering the
minimal options that the KEP suggests so we can simply stop registering
the others.
[1] https://github.com/kubernetes/enhancements/tree/master/keps/sig-instrumentation/2845-deprecate-klog-specific-flags-in-k8s-components
Signed-off-by: Stephen Finucane <[email protected]>
* client-keystone-auth: Stop registering klog options
As with magnum-auto-healer, we don't need/want to do this anymore.
Don't.
Signed-off-by: Stephen Finucane <[email protected]>
* cinder-csi-plugin: Use binary name in help page
Signed-off-by: Stephen Finucane <[email protected]>
* client-keystone-auth: Migrate to cobra
This one is relatively trivial since the 'Run' function in
'k8s.io/component-base/cli' does most of the heavy lifting for us now,
including registering logging arguments.
Signed-off-by: Stephen Finucane <[email protected]>
* k8s-keystone-auth: Migrate to cobra
This one is slightly trickier due to how we're doing configuration but
there's still nothing crazy confusing here.
Signed-off-by: Stephen Finucane <[email protected]>
* occm: Remove unnecessary flag handling code
k8s.io/cloud-provider switched to cobra some time back [1] and cobra
uses 'pflag' rather than 'flag' under the hood. As such, there's no
reason to keep the handling code for 'flag' options around. Remove it.
[1] https://github.com/kubernetes/cloud-provider/blob/v0.28.0/app/controllermanager.go#L87-L124
Signed-off-by: Stephen Finucane <[email protected]>
* occm: Register additional options correctly
The 'NewCloudControllerManagerCommand' function, which generates the cobra
Command that forms the basis of a cloud provider binary, accepts an
'additionalFlags' argument that allows us to (surprise) pass in
additional provider-specific arguments. We were not making use of this,
which means our options were not showing in the usage string shown on
e.g. '--help'. Correct this on our end, while we wait for the fix in
k8s.io/cloud-provider [1] to close the loop fully.
In additional, move our 'InitLogs' call higher up the function to before
our first logging call so that everything is initialised correctly.
[1] kubernetes/kubernetes#120522
Signed-off-by: Stephen Finucane <[email protected]>
* magnum-auto-healer: Remove use of 'init' methods
Instead, register the health checks and cloud provider plugins on
controller start up. This avoids side-effects from merely importing the
modules - which are polluting the output of '--help' - and is generally
"less weird".
To do this, we must make the registration methods part of the public API
and remove the 'pkg/autohealing/cloudprovider/register' package in
favour of a public registration method in the
'pkg/autohealing/cloudprovider/openstack' package.
Signed-off-by: Stephen Finucane <[email protected]>
---------
Signed-off-by: Stephen Finucane <[email protected]>1 parent d28a24b commit ea198dd
File tree
11 files changed
+138
-196
lines changed- cmd
- cinder-csi-plugin
- client-keystone-auth
- k8s-keystone-auth
- openstack-cloud-controller-manager
- pkg/autohealing
- cloudprovider
- openstack
- register
- cmd
- controller
- healthcheck
11 files changed
+138
-196
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
42 | 42 | | |
43 | 43 | | |
44 | 44 | | |
45 | | - | |
| 45 | + | |
46 | 46 | | |
47 | 47 | | |
48 | 48 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
17 | 17 | | |
18 | 18 | | |
19 | 19 | | |
20 | | - | |
21 | 20 | | |
22 | 21 | | |
23 | 22 | | |
24 | 23 | | |
25 | 24 | | |
26 | 25 | | |
27 | 26 | | |
28 | | - | |
29 | | - | |
| 27 | + | |
| 28 | + | |
30 | 29 | | |
31 | 30 | | |
32 | 31 | | |
33 | 32 | | |
34 | 33 | | |
35 | | - | |
36 | | - | |
37 | 34 | | |
38 | 35 | | |
39 | 36 | | |
| |||
137 | 134 | | |
138 | 135 | | |
139 | 136 | | |
| 137 | + | |
| 138 | + | |
| 139 | + | |
| 140 | + | |
| 141 | + | |
| 142 | + | |
| 143 | + | |
| 144 | + | |
| 145 | + | |
| 146 | + | |
| 147 | + | |
| 148 | + | |
| 149 | + | |
| 150 | + | |
| 151 | + | |
| 152 | + | |
140 | 153 | | |
141 | | - | |
142 | | - | |
143 | | - | |
144 | | - | |
145 | | - | |
146 | | - | |
147 | | - | |
148 | | - | |
149 | | - | |
150 | | - | |
151 | | - | |
152 | | - | |
153 | | - | |
154 | | - | |
155 | | - | |
156 | | - | |
157 | | - | |
158 | | - | |
159 | | - | |
160 | | - | |
161 | | - | |
162 | | - | |
163 | | - | |
164 | | - | |
165 | | - | |
166 | | - | |
167 | | - | |
168 | | - | |
169 | | - | |
170 | | - | |
171 | | - | |
172 | | - | |
173 | | - | |
174 | | - | |
175 | | - | |
176 | | - | |
177 | | - | |
178 | | - | |
179 | | - | |
| 154 | + | |
| 155 | + | |
| 156 | + | |
| 157 | + | |
| 158 | + | |
| 159 | + | |
| 160 | + | |
180 | 161 | | |
181 | 162 | | |
182 | | - | |
183 | | - | |
| 163 | + | |
| 164 | + | |
| 165 | + | |
| 166 | + | |
| 167 | + | |
| 168 | + | |
| 169 | + | |
| 170 | + | |
| 171 | + | |
| 172 | + | |
| 173 | + | |
| 174 | + | |
| 175 | + | |
| 176 | + | |
| 177 | + | |
184 | 178 | | |
| 179 | + | |
185 | 180 | | |
186 | 181 | | |
187 | 182 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
15 | 15 | | |
16 | 16 | | |
17 | 17 | | |
18 | | - | |
19 | 18 | | |
20 | 19 | | |
| 20 | + | |
21 | 21 | | |
| 22 | + | |
22 | 23 | | |
23 | 24 | | |
24 | 25 | | |
25 | 26 | | |
26 | | - | |
27 | | - | |
28 | 27 | | |
29 | 28 | | |
| 29 | + | |
| 30 | + | |
30 | 31 | | |
31 | | - | |
32 | | - | |
| 32 | + | |
| 33 | + | |
| 34 | + | |
| 35 | + | |
| 36 | + | |
| 37 | + | |
| 38 | + | |
| 39 | + | |
| 40 | + | |
| 41 | + | |
| 42 | + | |
| 43 | + | |
| 44 | + | |
| 45 | + | |
| 46 | + | |
| 47 | + | |
| 48 | + | |
| 49 | + | |
| 50 | + | |
33 | 51 | | |
34 | | - | |
35 | 52 | | |
36 | 53 | | |
37 | | - | |
38 | | - | |
39 | | - | |
40 | | - | |
41 | 54 | | |
42 | 55 | | |
43 | | - | |
44 | | - | |
45 | | - | |
46 | | - | |
47 | | - | |
48 | | - | |
49 | | - | |
50 | | - | |
51 | | - | |
52 | | - | |
53 | | - | |
| 56 | + | |
| 57 | + | |
54 | 58 | | |
55 | | - | |
56 | | - | |
57 | | - | |
58 | | - | |
59 | | - | |
60 | | - | |
61 | 59 | | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
20 | 20 | | |
21 | 21 | | |
22 | 22 | | |
23 | | - | |
24 | 23 | | |
25 | 24 | | |
26 | 25 | | |
27 | | - | |
28 | 26 | | |
29 | 27 | | |
30 | 28 | | |
| |||
43 | 41 | | |
44 | 42 | | |
45 | 43 | | |
| 44 | + | |
| 45 | + | |
| 46 | + | |
46 | 47 | | |
47 | 48 | | |
48 | 49 | | |
49 | 50 | | |
50 | 51 | | |
51 | 52 | | |
52 | | - | |
53 | | - | |
54 | | - | |
| 53 | + | |
55 | 54 | | |
56 | | - | |
57 | | - | |
58 | | - | |
59 | | - | |
60 | | - | |
61 | | - | |
62 | | - | |
63 | | - | |
64 | | - | |
65 | | - | |
| 55 | + | |
66 | 56 | | |
67 | 57 | | |
68 | 58 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
25 | 25 | | |
26 | 26 | | |
27 | 27 | | |
| 28 | + | |
28 | 29 | | |
29 | 30 | | |
30 | 31 | | |
| |||
43 | 44 | | |
44 | 45 | | |
45 | 46 | | |
| 47 | + | |
46 | 48 | | |
47 | 49 | | |
| 50 | + | |
48 | 51 | | |
49 | 52 | | |
50 | 53 | | |
| |||
671 | 674 | | |
672 | 675 | | |
673 | 676 | | |
| 677 | + | |
| 678 | + | |
| 679 | + | |
| 680 | + | |
| 681 | + | |
| 682 | + | |
| 683 | + | |
| 684 | + | |
| 685 | + | |
| 686 | + | |
| 687 | + | |
| 688 | + | |
| 689 | + | |
| 690 | + | |
| 691 | + | |
| 692 | + | |
| 693 | + | |
| 694 | + | |
| 695 | + | |
| 696 | + | |
| 697 | + | |
| 698 | + | |
| 699 | + | |
| 700 | + | |
| 701 | + | |
| 702 | + | |
| 703 | + | |
| 704 | + | |
| 705 | + | |
| 706 | + | |
| 707 | + | |
| 708 | + | |
| 709 | + | |
| 710 | + | |
| 711 | + | |
| 712 | + | |
| 713 | + | |
| 714 | + | |
| 715 | + | |
| 716 | + | |
| 717 | + | |
| 718 | + | |
| 719 | + | |
| 720 | + | |
| 721 | + | |
| 722 | + | |
| 723 | + | |
| 724 | + | |
| 725 | + | |
| 726 | + | |
| 727 | + | |
| 728 | + | |
0 commit comments