Browse Source

Add orig and seed env versions to astute.yaml

Change-Id: Ic5eb4b4308feba55cbb97ebc63c1a41b4ed14de8
Pavel Chechetin 2 years ago
parent
commit
595146163e
2 changed files with 12 additions and 0 deletions
  1. 7
    0
      cluster_upgrade/extension.py
  2. 5
    0
      cluster_upgrade/tests/test_extension.py

+ 7
- 0
cluster_upgrade/extension.py View File

@@ -17,6 +17,7 @@
17 17
 import os
18 18
 
19 19
 from nailgun import extensions
20
+from nailgun.objects import Cluster
20 21
 
21 22
 from cluster_upgrade import handlers
22 23
 
@@ -27,10 +28,16 @@ class UpgradePipeline(extensions.BasePipeline):
27 28
         from cluster_upgrade.objects.relations import UpgradeRelationObject
28 29
 
29 30
         relation = UpgradeRelationObject.get_cluster_relation(cluster.id)
31
+
32
+        orig_env = Cluster.get_by_uid(relation.orig_cluster_id)
33
+        seed_env = Cluster.get_by_uid(relation.seed_cluster_id)
34
+
30 35
         cluster_data['upgrade'] = {
31 36
             'relation_info': {
32 37
                 'orig_cluster_id': relation.orig_cluster_id,
33 38
                 'seed_cluster_id': relation.seed_cluster_id,
39
+                'orig_cluster_version': orig_env.release.environment_version,
40
+                'seed_cluster_version': seed_env.release.environment_version
34 41
             }
35 42
         }
36 43
 

+ 5
- 0
cluster_upgrade/tests/test_extension.py View File

@@ -53,10 +53,15 @@ class TestPipeline(base.BaseCloneClusterTest):
53 53
             self.dst_cluster_db, []
54 54
         )
55 55
 
56
+        orig_release = self.src_cluster_db.release
57
+        seed_release = self.dst_cluster_db.release
58
+
56 59
         expected = {
57 60
             'relation_info': {
58 61
                 'orig_cluster_id': self.src_cluster_db.id,
59 62
                 'seed_cluster_id': self.dst_cluster_db.id,
63
+                'orig_cluster_version': orig_release.environment_version,
64
+                'seed_cluster_version': seed_release.environment_version,
60 65
             }
61 66
         }
62 67
 

Loading…
Cancel
Save