Skip to content

Commit

Permalink
Rename SetStatusConditions to GetStatusConditions
Browse files Browse the repository at this point in the history
as discussed in #673 (comment)
  • Loading branch information
eromanova authored and Kshatrix committed Nov 26, 2024
1 parent 71c9ae1 commit e38f582
Show file tree
Hide file tree
Showing 3 changed files with 4 additions and 4 deletions.
2 changes: 1 addition & 1 deletion internal/controller/multiclusterservice_controller.go
Original file line number Diff line number Diff line change
Expand Up @@ -239,7 +239,7 @@ func updateServicesStatus(ctx context.Context, c client.Client, profileRef clien
idx = len(servicesStatus) - 1
}

conditions, err := sveltos.SetStatusConditions(&summary)
conditions, err := sveltos.GetStatusConditions(&summary)
if err != nil {
return nil, err
}
Expand Down
4 changes: 2 additions & 2 deletions internal/sveltos/status.go
Original file line number Diff line number Diff line change
Expand Up @@ -25,8 +25,8 @@ import (
hmc "github.com/Mirantis/hmc/api/v1alpha1"
)

// SetStatusConditions creates & sets a list of conditions from provided ClusterSummary and returns it.
func SetStatusConditions(summary *sveltosv1beta1.ClusterSummary) ([]metav1.Condition, error) {
// GetStatusConditions returns a list of conditions from provided ClusterSummary.
func GetStatusConditions(summary *sveltosv1beta1.ClusterSummary) ([]metav1.Condition, error) {
if summary == nil {
return nil, errors.New("error getting status from ClusterSummary: nil summary provided")
}
Expand Down
2 changes: 1 addition & 1 deletion internal/sveltos/status_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -134,7 +134,7 @@ func TestSetStatusConditions(t *testing.T) {
},
} {
t.Run(tc.name, func(t *testing.T) {
conditions, err := SetStatusConditions(&tc.summary)
conditions, err := GetStatusConditions(&tc.summary)
require.NoError(t, err)
assert.Len(t, conditions, 1)
assert.Equal(t, tc.expectCondition.Type, conditions[0].Type)
Expand Down

0 comments on commit e38f582

Please sign in to comment.