Commit Graph

22 Commits

Author SHA1 Message Date
ricolin ef63e2e1bb Allow directly output cluster config
Allow cluster config directly return configs instead of writing file.
This is useful when using magnum client utils from non-commandline
interfaces.

Change-Id: Ie6717e1f2d673fe3e92c58a926a82f255a6d20ca
2023-08-09 18:28:09 +08:00
Travis Holton de11f40d0c Update client.authentication.k8s.io api version for kubeconfig
The v1alpha1 version is removed in kubernetes 1.24. v1beta1 was added in
Kubernetes 1.11 and should be supported through existing versions.

Change-Id: I446b8c1c9b46fb8d70317f271a6a650d2a1bbefa
2023-02-16 06:29:39 +00:00
Bharat Kunwar 1c1cfd7109 Rename variables to address pep8 error
Without rename, we see this:
    E741 ambiguous variable name 'l'

Change-Id: Ic1d357db594dd6f8f8db162033b6cf408e84453c
Story: 2007515
Task: 39775
2020-05-14 11:34:38 +00:00
Feilong Wang df0249024e Support updating cluster health status
Cluster health_status_reason is also a dict like the template labels,
so we need to handle this in the same way.

Change-Id: I0841ef30f568640839746f2223ba0fb621e2005c
Task: 39081
Story: 2007242
2020-04-19 21:28:22 +00:00
Jake Yip 3f7b994acd python3 fixes
Update uses of b64encode() as describe in OpenStack docs [1].

Also add tests.

[1]: https://wiki.openstack.org/wiki/Python3#Serialization:_base64.2C_JSON.2C_etc.

Change-Id: I5aa6ba509979e0532d2837153aa5363d1e13631e
2019-03-01 13:17:10 +11:00
Zuul 37e602d160 Merge "Keystone auth support" 2019-02-28 16:19:54 +00:00
Feilong Wang 81b84804cc Keystone auth support
Add Keystone auth support for generated kubeconfig

Task: 28296
Story: 1755770

Change-Id: I743fe75f39477ba336636607fd9bc2e542342ca0
2019-02-26 15:47:20 +13:00
Erik Olof Gunnar Andersson b4120a1352 Use oslo_serialization instead of the json module directly
* Always use oslo jsonutils.
* Consistently import jsonutils as-is.
* Use dump_as_bytes instead of dumps.
https://wiki.openstack.org/wiki/Python3#Serialization:_base64.2C_JSON.2C_etc.

Change-Id: Ifb6c673da24276b0528e5975f63ac326d558936d
2019-01-21 16:32:15 -08:00
Ricardo Rocha 48b85899a0 [k8s] Add embed certs to config
Add embed certs to kubernetes config file to cluster config

Add option --output-certs to cluster config enabling the output of the
certificates files (ca, key, cert). This is for compatibility with tools
that require the certificates in separate files.

Change-Id: I595d243bc9f30d813af06aad46a9037afe383ab5
Story: 1774643
Task: 21668
2018-08-08 21:17:35 -07:00
M V P Nitesh c165071ff8 Now cluster-template-update works for "labels"
Now we are handling the label values converting them as a dictionary.
But as magnum-api only accepts the input as string. We are converting
the dictionary into string and passing to magnum-api. It is parsing
the string to dictionary and storing the label value a dictionary.

Change-Id: I2cec19e24c6dd32e209ca65a26a2f1999d8289e0
Depends-on: I4d64da78dc4ed4d5599533b54861b65bce609c28
Closes-Bug: #1659189
2018-02-20 14:12:53 +00:00
Spyros Trigazis 2d5efb2e4d Make cluster-config rbac compatible for kubebernetes
The user admin needs to have system:master in the organization
and needs to be named admin.

Closes-Bug: #1689849
Change-Id: If43c3d0a0d83c42ff1fceffe4bcc333b31dbdaab
2018-02-09 09:15:38 +00:00
Spyros Trigazis 5f3b69b15c OSC: Add cluster config command
Move certificate generation and config  generation
in magnum utils so that all clusters_shell, bays_shell
and OSC can use.

* Remove / from context name (see #1705480)
* Use absolute paths for the certificates in kubeconfig
  It's the same principle like #1614682

Change-Id: I5b8bb11b199b7646a984c7171f3853d3e73923ec
Implements: blueprint openstackclient-support
Related-Bug: #1705480
Related-Bug: #1614682
2017-07-26 19:05:51 +00:00
yatin eab1ba38ae Append value using comma if key exists in label
Magnum allows "labels" to be Dict of string, but currently
magnumclient creates a list of values if same key is specified
more than once when creating a baymodel.
Now if two labels of same key are passed to baymodel-create
the first value is joined with second using comma.

Change-Id: Idcee5c27e29b8d6889fd2c9fa839202ffb8a2f4e
Closes-Bug: #1521461
2016-08-23 13:03:40 +05:30
wangqun bbdc05d227 Add mesos_slave_executor_environment_variables validate in CLI
mesos_slave_executor_environment_variables is a file path to deliver
the data for mesos executor environment variables, and validate the
file if existing or matching the json form.

Change-Id: Iaeb912184f8789321526887d25e281b5181089ef
Partially-Implements:blueprint mesos-slave-flags
2016-05-20 08:33:42 +00:00
wangqun 406528ec21 Fix the bug when some value in labels has comma, it will fail.
Now using 'comma' split the labels list result in the fail when some
value in labels list has comma, for example, mesos_slave_isolation=
docker/runtime,filesystem/linux

The patch fix the bug that some value in labels list has comma will
fail.

Change-Id: I1553b512e4e2efa7677efadf44e959f1601d39ad
Closes-Bug: #1578498
2016-05-06 19:14:59 +00:00
wangqun 71967890b6 Fix the container-list with --limit 'a negative number'
When running the command "magnum container-list --limit -1 --bay
swarmbay" with "--limit -1" , it can get the containers successfully.

Change-Id: I359a9b90bd80cfeb97db2ada8fb1ada0f5eb127e
Closes-Bug: #1562790
2016-03-31 06:19:20 +00:00
phelanm 905e6ee481 Allow semicolons in list of labels
* can use commas or semicolons in label list
* add two tests, all semicolons and mixed
  semicolons and commas

Closes-bug: #1497042
Change-Id: I6c243b09343b92fc54a991facf874d1e5f0f1f51
2016-03-23 18:59:31 +00:00
houming-wang 0c547422bb Remove references to _i18n and apiclient.exceptions
Since oslo-incubator is no longer maintained[1] after
90ae25e38915cc502d9e9c52d59e8fb668a72ae1. We should cleanup
the deprecated code.

This patch do the following cleanup actions:
1. Use magnumclient.i18n instead of
magnumclient.openstack.common._i18n.
2. Use magnumclient.exceptions instead of the deprecated
magnumclient.openstack.common.apiclient.exceptions[2].

[1] http://lists.openstack.org/pipermail/openstack-dev/2015-November/
    079343.html
[2] https://github.com/openstack/python-magnumclient/blob/master/
    magnumclient/openstack/common/apiclient/exceptions.py#L25

Change-Id: I6fae1f84d211d661bb363e43167cdf8b6b06fd4d
Partial-Bug: #1529316
2015-12-26 00:07:11 -05:00
OTSUKA, Yuanying 8480e0b0f1 Split v1 shell sub-command into specific files
v1 shell has many sub command. It is difficult to add more test
and functions. Actually we have forgotten to add some tests for
these sub-commands.
This patch splits these.

Change-Id: I6b80b621311442df987e6ff031e8c77cf4bb7095
Closes-Bug: #1515109
2015-11-19 09:47:17 +09:00
Daneyon Hansen ce8924bb43 Adds Labels Support
Adds labels attribute and associated tools/tests to the magnum
client.

Implements: blueprint extend-client-network-attributes

Change-Id: Ie8465275646b82aa9bd7a9de756c519bdd6ec0e2
2015-09-16 19:58:54 +00:00
Hongbin Lu 77084e6b84 Add support for updating a bay
Users can use these commands to add/remove/update bay attribute(s):
magnum bay-update <bay_id> replace <path=value>
magnum bay-update <bay_id> add <path=value>
magnum bay-update <bay_id> remove <path=value>

For example, this command updates the node_count attribute of a bay:
magnum bay-update 0aab40ba-3f48-4e6e-88a6-247be18b9711 replace node_count=1

Change-Id: If003beaca8e7e8bbdff2cf24d2810b0db9efdf41
Implements: blueprint update-node-count
2015-02-17 03:18:01 +00:00
Motohiro OTSUKA cc031af4ca Add client resources and managers
Add initial managers for client resources, which are
- BayManager
- PodManager
- ServiceManager
- ContainerManager

Change-Id: Ib314225fa237f44b56cf81e2a8df6e15f8592e5b
2014-11-26 09:52:30 +09:00