weaveworks / service

☁️ Images for Weave Cloud (R) (TM) (C) ☁️
https://cloud.weave.works
2 stars 2 forks source link

users/admin: Change k8s platform sorting #2724

Closed ozamosi closed 3 years ago

ozamosi commented 3 years ago

When confronted with a version that was e.g. a git hash, we would remove all the letters, and hope the remaining numbers could be intelligently compared.

This creates a tuple of (extracted version, plaintext version). The first part sorts every release by number (i.e. 1.19 comes between 1.20 and 1.2), and the second part is a tiebreaker - sort "-gke-200" separately from "-gke-400", but as that bit is user-controlled and did break the production sorting, let's just accept that "-gke-2" will count as bigger than "-gke-100", because being too clever is how things become fragile.