Skip to content

Commit

Permalink
fix(promo): notice changes to Argo CD source updates (#2157)
Browse files Browse the repository at this point in the history
Signed-off-by: Hidde Beydals <hidde@hhh.computer>
  • Loading branch information
hiddeco authored Jun 14, 2024
1 parent cf3603f commit 6f3a220
Show file tree
Hide file tree
Showing 4 changed files with 860 additions and 393 deletions.
30 changes: 30 additions & 0 deletions internal/controller/argocd/api/v1alpha1/application_types.go
Original file line number Diff line number Diff line change
@@ -1,6 +1,8 @@
package v1alpha1

import (
"reflect"

metav1 "k8s.io/apimachinery/pkg/apis/meta/v1"
)

Expand Down Expand Up @@ -29,8 +31,34 @@ type ApplicationSource struct {
Chart string `json:"chart,omitempty"`
}

// Equals compares two instances of ApplicationSource and returns true if
// they are equal.
func (source *ApplicationSource) Equals(other *ApplicationSource) bool {
if source == nil && other == nil {
return true
}
if source == nil || other == nil {
return false
}
return reflect.DeepEqual(source.DeepCopy(), other.DeepCopy())
}

type ApplicationSources []ApplicationSource

// Equals compares two instances of ApplicationSources and returns true if
// they are equal.
func (s ApplicationSources) Equals(other ApplicationSources) bool {
if len(s) != len(other) {
return false
}
for i := range s {
if !s[i].Equals(&other[i]) {
return false
}
}
return true
}

type RefreshType string

const (
Expand Down Expand Up @@ -148,4 +176,6 @@ type OperationState struct {

type SyncOperationResult struct {
Revision string `json:"revision,omitempty"`
Source ApplicationSource `json:"source,omitempty"`
Sources ApplicationSources `json:"sources,omitempty"`
}

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Loading

0 comments on commit 6f3a220

Please sign in to comment.