Browse Source

OSC: Add --master-flavor to coe cluster create

Add a master-flavor override parameter on osc cluster create to override
the value present on the cluster template.

Partial-Bug: #1699247
Depends-On: Id1d973167b381538121583a0a9691304b39e98de
Change-Id: I7ef1c2d7c19be96089fbe0f0847294073ccab04e
tags/2.8.0
Ricardo Rocha 1 year ago
parent
commit
c035f9299f

+ 9
- 1
magnumclient/osc/v1/clusters.py View File

@@ -42,7 +42,8 @@ CLUSTER_ATTRIBUTES = [
42 42
     'discovery_url',
43 43
     'master_count',
44 44
     'container_version',
45
-    'name'
45
+    'name',
46
+    'master_flavor_id',
46 47
 ]
47 48
 
48 49
 
@@ -101,6 +102,12 @@ class CreateCluster(command.Command):
101 102
                             metavar='<timeout>',
102 103
                             help=('The timeout for cluster creation time. The '
103 104
                                   'default is 60 minutes.'))
105
+        parser.add_argument(
106
+            '--master-flavor',
107
+            dest='master_flavor',
108
+            metavar='<master-flavor>',
109
+            help=_('The nova flavor name or UUID to use when launching the '
110
+                   'master node of the Cluster.'))
104 111
 
105 112
         return parser
106 113
 
@@ -117,6 +124,7 @@ class CreateCluster(command.Command):
117 124
             'master_count': parsed_args.master_count,
118 125
             'name': parsed_args.name,
119 126
             'node_count': parsed_args.node_count,
127
+            'master_flavor_id': parsed_args.master_flavor,
120 128
         }
121 129
 
122 130
         if parsed_args.labels is not None:

+ 2
- 1
magnumclient/tests/osc/unit/v1/fakes.py View File

@@ -200,7 +200,8 @@ class FakeCluster(object):
200 200
             'discovery_url': 'https://fake.cluster',
201 201
             'master_count': 1,
202 202
             'container_version': None,
203
-            'name': 'fake-cluster'
203
+            'name': 'fake-cluster',
204
+            'master_flavor_id': None,
204 205
         }
205 206
 
206 207
         # Overwrite default attributes.

+ 2
- 1
magnumclient/tests/osc/unit/v1/test_clusters.py View File

@@ -47,7 +47,8 @@ class TestClusterCreate(TestCluster):
47 47
             'keypair': None,
48 48
             'master_count': 1,
49 49
             'name': 'fake-cluster-1',
50
-            'node_count': 1
50
+            'node_count': 1,
51
+            'master_flavor_id': None,
51 52
         }
52 53
 
53 54
         self.clusters_mock.create = mock.Mock()

Loading…
Cancel
Save