Ejemplo n.º 1
0
 def Compare(self, current_master_version, current_cluster_version):
     """Compares the cluster and master versions and returns an enum."""
     if current_master_version == current_cluster_version:
         return self.UP_TO_DATE
     master_version = SemVer(current_master_version)
     cluster_version = SemVer(current_cluster_version)
     major, minor, _ = master_version.Distance(cluster_version)
     if major != 0 or minor > 2:
         return self.UNSUPPORTED
     elif minor > 1:
         return self.SUPPORT_ENDING
     else:
         return self.UPGRADE_AVAILABLE
Ejemplo n.º 2
0
 def Compare(self, current_master_version, current_cluster_version):
   """Compares the cluster and master versions and returns an enum."""
   # TODO(b/36051978):update the if condition when we roll the master version
   if current_master_version == current_cluster_version:
     return self.UP_TO_DATE
   master_version = SemVer(current_master_version)
   cluster_version = SemVer(current_cluster_version)
   major, minor, _ = master_version.Distance(cluster_version)
   if major != 0 or minor > 2:
     return self.UNSUPPORTED
   elif minor > 1:
     return self.SUPPORT_ENDING
   else:
     return self.UPGRADE_AVAILABLE