Skip to content

Commit

Permalink
fix: Make name in NamedDeployApplicationResult omitempty (#375)
Browse files Browse the repository at this point in the history
* fix: Make name in NamedDeployApplicationResult omitempty

* fix: IsConditionChanged will ignore lastTransitionTime to make it more usable
  • Loading branch information
danielfbm authored Feb 8, 2023
1 parent e6abf1c commit 301c38c
Show file tree
Hide file tree
Showing 3 changed files with 4 additions and 4 deletions.
2 changes: 1 addition & 1 deletion apis/applications/v1alpha1/deploy_application_status.go
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ type NamedDeployApplicationResults []NamedDeployApplicationResult
// useful for store deployment data in a list
type NamedDeployApplicationResult struct {
// Name for the specific deployment application result
Name string `json:"name"`
Name string `json:"name,omitempty"`

// DeployApplicationResults result of the deployment
DeployApplicationResults `json:",inline"`
Expand Down
4 changes: 2 additions & 2 deletions apis/meta/v1alpha1/condition.go
Original file line number Diff line number Diff line change
Expand Up @@ -92,8 +92,8 @@ func IsConditionChanged(current, old apis.ConditionAccessor, conditionType apis.
return false
}
return (currentCondition.Status != oldCondition.Status) ||
!currentCondition.LastTransitionTime.Inner.Equal(&oldCondition.LastTransitionTime.Inner) ||
currentCondition.Reason != oldCondition.Reason
currentCondition.Reason != oldCondition.Reason ||
currentCondition.Message != oldCondition.Message
}

// GetCondition will return the first condition pointer filter by type in conditions
Expand Down
2 changes: 1 addition & 1 deletion apis/meta/v1alpha1/condition_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -164,7 +164,7 @@ func TestIsConditionChanged(t *testing.T) {
apis.Condition{Type: SomeCondition, Status: corev1.ConditionUnknown, LastTransitionTime: apis.VolatileTime{Inner: oneSecondAgo}},
}}},
conditionType: SomeCondition,
expected: true,
expected: false,
},
"Condition status is the same, last transition same, reason changed": {
current: &StatusTest{duckv1.Status{Conditions: duckv1.Conditions{
Expand Down

0 comments on commit 301c38c

Please sign in to comment.