File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -17,6 +17,7 @@ limitations under the License.
1717package v1beta2
1818
1919import (
20+ "sort"
2021 "time"
2122
2223 "github.com/application-stacks/runtime-component-operator/common"
@@ -1026,6 +1027,16 @@ func (s *RuntimeComponentStatus) SetCondition(c common.StatusCondition) {
10261027 if ! found {
10271028 s .Conditions = append (s .Conditions , * condition )
10281029 }
1030+ // Re-sort conditions to prioritize 'Ready' condition
1031+ sort .Slice (s .Conditions , func (i , j int ) bool {
1032+ if s .Conditions [i ].GetType () == common .StatusConditionTypeReady {
1033+ return true
1034+ }
1035+ if s .Conditions [j ].GetType () == common .StatusConditionTypeReady {
1036+ return false
1037+ }
1038+ return s .Conditions [i ].GetType () < s .Conditions [j ].GetType ()
1039+ })
10291040}
10301041
10311042func convertToCommonStatusConditionType (c StatusConditionType ) common.StatusConditionType {
You can’t perform that action at this time.
0 commit comments