From 68ab0cd2b9b5cd57d46b6748f78a8e50b9a19f0a Mon Sep 17 00:00:00 2001 From: "github-actions[bot]" <41898282+github-actions[bot]@users.noreply.github.com> Date: Mon, 23 Dec 2024 07:51:09 -0500 Subject: [PATCH] deps: bump github.com/openshift-kni/eco-goinfra (#344) Co-authored-by: klaskosk <162511147+klaskosk@users.noreply.github.com> --- go.mod | 2 +- go.sum | 4 +- .../eco-goinfra/pkg/console/console.go | 12 +-- .../eco-goinfra/pkg/metallb/addresspool.go | 18 +++-- .../eco-goinfra/pkg/metallb/bfdprofile.go | 16 ++-- .../pkg/metallb/bgpadvertisement.go | 30 +++----- .../eco-goinfra/pkg/metallb/bgppeer.go | 48 ++++-------- .../eco-goinfra/pkg/metallb/frr.go | 12 +-- .../eco-goinfra/pkg/metallb/frrnodestate.go | 6 +- .../pkg/metallb/l2advertisement.go | 34 +++------ .../eco-goinfra/pkg/metallb/metallb.go | 38 ++++------ .../eco-goinfra/pkg/nad/builder.go | 22 ++++-- .../eco-goinfra/pkg/nad/masterplugin.go | 76 +++++++++++++------ .../argocd/argocdoperator/argocd_types.go | 12 +++ .../argocdoperator/zz_generated.deepcopy.go | 9 ++- vendor/modules.txt | 2 +- 16 files changed, 182 insertions(+), 159 deletions(-) diff --git a/go.mod b/go.mod index 42a791ff9..b8d094a65 100644 --- a/go.mod +++ b/go.mod @@ -17,7 +17,7 @@ require ( github.com/nmstate/kubernetes-nmstate/api v0.0.0-20240605150941-df565dd7bf35 github.com/onsi/ginkgo/v2 v2.20.2 github.com/onsi/gomega v1.34.2 - github.com/openshift-kni/eco-goinfra v0.0.0-20241219141530-75a2d0ca0053 // latest + github.com/openshift-kni/eco-goinfra v0.0.0-20241220182656-f51076771e09 // latest github.com/openshift-kni/k8sreporter v1.0.6 github.com/openshift/api v3.9.1-0.20191111211345-a27ff30ebf09+incompatible github.com/openshift/cluster-nfd-operator v0.0.0-20240902145504-f70d1389d329 // release-4.17 diff --git a/go.sum b/go.sum index 22e01aab4..8a96cf171 100644 --- a/go.sum +++ b/go.sum @@ -1257,8 +1257,8 @@ github.com/opencontainers/runtime-spec v1.2.0 h1:z97+pHb3uELt/yiAWD691HNHQIF07bE github.com/opencontainers/runtime-spec v1.2.0/go.mod h1:jwyrGlmzljRJv/Fgzds9SsS/C5hL+LL3ko9hs6T5lQ0= github.com/openshift-kni/cluster-group-upgrades-operator v0.0.0-20240918194836-a0a3f896c283 h1:KGQuA0R53YMHkUVWVK5NcFKixjTXB/vaQswcwt3Pdy0= github.com/openshift-kni/cluster-group-upgrades-operator v0.0.0-20240918194836-a0a3f896c283/go.mod h1:TYB+3zGmMhqOmyZ6FCbtNZSndvRDcfh16U7wgYGpe/8= -github.com/openshift-kni/eco-goinfra v0.0.0-20241219141530-75a2d0ca0053 h1:9kb45V76ONM4ExX9mVMFZw7zMNWq8JQ/rjQrVhU4qgY= -github.com/openshift-kni/eco-goinfra v0.0.0-20241219141530-75a2d0ca0053/go.mod h1:T51OM/Mq7OogaCm7rBxdaaCrK8iXVh4E3FlEv8v90B4= +github.com/openshift-kni/eco-goinfra v0.0.0-20241220182656-f51076771e09 h1:JyZaEMYXAHwtLuSzI7/t/zgSrEy7Kk689x9/uxthx5c= +github.com/openshift-kni/eco-goinfra v0.0.0-20241220182656-f51076771e09/go.mod h1:T51OM/Mq7OogaCm7rBxdaaCrK8iXVh4E3FlEv8v90B4= github.com/openshift-kni/k8sreporter v1.0.6 h1:aaxDzZx3s9bo1I3nopR63RGVZxcJgR94j5X87aDihYo= github.com/openshift-kni/k8sreporter v1.0.6/go.mod h1:tX6LOg0m0oXje7WNLFo8LKHC9Ix8VV0a7vUc6eyeFBQ= github.com/openshift-kni/lifecycle-agent v0.0.0-20241002223755-1e32b456449f h1:2k35EoDXvfOx/pgQKaBp2DkbBvMUBi+LuGATTH0El+U= diff --git a/vendor/github.com/openshift-kni/eco-goinfra/pkg/console/console.go b/vendor/github.com/openshift-kni/eco-goinfra/pkg/console/console.go index f068d542d..00f8d1752 100644 --- a/vendor/github.com/openshift-kni/eco-goinfra/pkg/console/console.go +++ b/vendor/github.com/openshift-kni/eco-goinfra/pkg/console/console.go @@ -29,7 +29,7 @@ type Builder struct { func NewBuilder(apiClient *clients.Settings, name string) *Builder { glog.V(100).Info("Initializing new console %s structure", name) - builder := Builder{ + builder := &Builder{ apiClient: apiClient, Definition: &configv1.Console{ ObjectMeta: metav1.ObjectMeta{ @@ -42,14 +42,16 @@ func NewBuilder(apiClient *clients.Settings, name string) *Builder { glog.V(100).Info("The name of the Console is empty") builder.errorMsg = "console 'name' cannot be empty" + + return builder } - return &builder + return builder } // Pull loads an existing console into the Builder struct. func Pull(apiClient *clients.Settings, name string) (*Builder, error) { - builder := Builder{ + builder := &Builder{ apiClient: apiClient, Definition: &configv1.Console{ ObjectMeta: metav1.ObjectMeta{ @@ -61,7 +63,7 @@ func Pull(apiClient *clients.Settings, name string) (*Builder, error) { if name == "" { glog.V(100).Info("The name of the Console is empty") - builder.errorMsg = "console 'name' cannot be empty" + return builder, fmt.Errorf("console 'name' cannot be empty") } glog.V(100).Infof("Pulling cluster console %s", name) @@ -72,7 +74,7 @@ func Pull(apiClient *clients.Settings, name string) (*Builder, error) { builder.Definition = builder.Object - return &builder, nil + return builder, nil } // Create makes a console in cluster and stores the created object in struct. diff --git a/vendor/github.com/openshift-kni/eco-goinfra/pkg/metallb/addresspool.go b/vendor/github.com/openshift-kni/eco-goinfra/pkg/metallb/addresspool.go index e41e64af1..26b8909a8 100644 --- a/vendor/github.com/openshift-kni/eco-goinfra/pkg/metallb/addresspool.go +++ b/vendor/github.com/openshift-kni/eco-goinfra/pkg/metallb/addresspool.go @@ -40,7 +40,7 @@ func NewIPAddressPoolBuilder( return nil } - builder := IPAddressPoolBuilder{ + builder := &IPAddressPoolBuilder{ apiClient: apiClient.Client, Definition: &mlbtypes.IPAddressPool{ ObjectMeta: metav1.ObjectMeta{ @@ -56,21 +56,27 @@ func NewIPAddressPoolBuilder( glog.V(100).Infof("The name of the IPAddressPool is empty") builder.errorMsg = "IPAddressPool 'name' cannot be empty" + + return builder } if nsname == "" { glog.V(100).Infof("The namespace of the IPAddressPool is empty") builder.errorMsg = "IPAddressPool 'nsname' cannot be empty" + + return builder } if len(addrPool) < 1 { glog.V(100).Infof("The addrPool of the IPAddressPool is empty list") builder.errorMsg = "IPAddressPool 'addrPool' cannot be empty list" + + return builder } - return &builder + return builder } // Get returns IPAddressPool object if found. @@ -133,7 +139,7 @@ func PullAddressPool(apiClient *clients.Settings, name, nsname string) (*IPAddre return nil, err } - builder := IPAddressPoolBuilder{ + builder := &IPAddressPoolBuilder{ apiClient: apiClient.Client, Definition: &mlbtypes.IPAddressPool{ ObjectMeta: metav1.ObjectMeta{ @@ -161,7 +167,7 @@ func PullAddressPool(apiClient *clients.Settings, name, nsname string) (*IPAddre builder.Definition = builder.Object - return &builder, nil + return builder, nil } // Create makes a IPAddressPool in the cluster and stores the created object in struct. @@ -342,13 +348,13 @@ func (builder *IPAddressPoolBuilder) validate() (bool, error) { if builder.Definition == nil { glog.V(100).Infof("The %s is undefined", resourceCRD) - builder.errorMsg = msg.UndefinedCrdObjectErrString(resourceCRD) + return false, fmt.Errorf(msg.UndefinedCrdObjectErrString(resourceCRD)) } if builder.apiClient == nil { glog.V(100).Infof("The %s builder apiclient is nil", resourceCRD) - builder.errorMsg = fmt.Sprintf("%s builder cannot have nil apiClient", resourceCRD) + return false, fmt.Errorf("%s builder cannot have nil apiClient", resourceCRD) } if builder.errorMsg != "" { diff --git a/vendor/github.com/openshift-kni/eco-goinfra/pkg/metallb/bfdprofile.go b/vendor/github.com/openshift-kni/eco-goinfra/pkg/metallb/bfdprofile.go index ff179f67e..0b7ce299c 100644 --- a/vendor/github.com/openshift-kni/eco-goinfra/pkg/metallb/bfdprofile.go +++ b/vendor/github.com/openshift-kni/eco-goinfra/pkg/metallb/bfdprofile.go @@ -39,7 +39,7 @@ func NewBFDBuilder(apiClient *clients.Settings, name, nsname string) *BFDBuilder return nil } - builder := BFDBuilder{ + builder := &BFDBuilder{ apiClient: apiClient.Client, Definition: &mlbtypes.BFDProfile{ ObjectMeta: metav1.ObjectMeta{ @@ -53,15 +53,19 @@ func NewBFDBuilder(apiClient *clients.Settings, name, nsname string) *BFDBuilder glog.V(100).Infof("The name of the BFDProfile is empty") builder.errorMsg = "BFDProfile 'name' cannot be empty" + + return builder } if nsname == "" { glog.V(100).Infof("The namespace of the BFDProfile is empty") builder.errorMsg = "BFDProfile 'nsname' cannot be empty" + + return builder } - return &builder + return builder } // Get returns BFDProfile object if found. @@ -124,7 +128,7 @@ func PullBFDProfile(apiClient *clients.Settings, name, nsname string) (*BFDBuild return nil, err } - builder := BFDBuilder{ + builder := &BFDBuilder{ apiClient: apiClient.Client, Definition: &mlbtypes.BFDProfile{ ObjectMeta: metav1.ObjectMeta{ @@ -152,7 +156,7 @@ func PullBFDProfile(apiClient *clients.Settings, name, nsname string) (*BFDBuild builder.Definition = builder.Object - return &builder, nil + return builder, nil } // Create makes a BFDProfile in the cluster and stores the created object in struct. @@ -392,13 +396,13 @@ func (builder *BFDBuilder) validate() (bool, error) { if builder.Definition == nil { glog.V(100).Infof("The %s is undefined", resourceCRD) - builder.errorMsg = msg.UndefinedCrdObjectErrString(resourceCRD) + return false, fmt.Errorf(msg.UndefinedCrdObjectErrString(resourceCRD)) } if builder.apiClient == nil { glog.V(100).Infof("The %s builder apiclient is nil", resourceCRD) - builder.errorMsg = fmt.Sprintf("%s builder cannot have nil apiClient", resourceCRD) + return false, fmt.Errorf("%s builder cannot have nil apiClient", resourceCRD) } if builder.errorMsg != "" { diff --git a/vendor/github.com/openshift-kni/eco-goinfra/pkg/metallb/bgpadvertisement.go b/vendor/github.com/openshift-kni/eco-goinfra/pkg/metallb/bgpadvertisement.go index 92e72b92d..cf004d463 100644 --- a/vendor/github.com/openshift-kni/eco-goinfra/pkg/metallb/bgpadvertisement.go +++ b/vendor/github.com/openshift-kni/eco-goinfra/pkg/metallb/bgpadvertisement.go @@ -39,7 +39,7 @@ func NewBGPAdvertisementBuilder(apiClient *clients.Settings, name, nsname string return nil } - builder := BGPAdvertisementBuilder{ + builder := &BGPAdvertisementBuilder{ apiClient: apiClient.Client, Definition: &mlbtypes.BGPAdvertisement{ ObjectMeta: metav1.ObjectMeta{ @@ -53,15 +53,19 @@ func NewBGPAdvertisementBuilder(apiClient *clients.Settings, name, nsname string glog.V(100).Infof("The name of the BGPAdvertisement is empty") builder.errorMsg = "BGPAdvertisement 'name' cannot be empty" + + return builder } if nsname == "" { glog.V(100).Infof("The namespace of the BGPAdvertisement is empty") builder.errorMsg = "BGPAdvertisement 'nsname' cannot be empty" + + return builder } - return &builder + return builder } // Exists checks whether the given BGPAdvertisement exists. @@ -123,7 +127,7 @@ func PullBGPAdvertisement(apiClient *clients.Settings, name, nsname string) (*BG return nil, err } - builder := BGPAdvertisementBuilder{ + builder := &BGPAdvertisementBuilder{ apiClient: apiClient.Client, Definition: &mlbtypes.BGPAdvertisement{ ObjectMeta: metav1.ObjectMeta{ @@ -151,7 +155,7 @@ func PullBGPAdvertisement(apiClient *clients.Settings, name, nsname string) (*BG builder.Definition = builder.Object - return &builder, nil + return builder, nil } // Create makes a BGPAdvertisement in the cluster and stores the created object in struct. @@ -267,9 +271,7 @@ func (builder *BGPAdvertisementBuilder) WithAggregationLength4(aggregationLength if aggregationLength < 0 || aggregationLength > 32 { builder.errorMsg = fmt.Sprintf("AggregationLength %d is invalid, the value shoud be in range 0...32", aggregationLength) - } - if builder.errorMsg != "" { return builder } @@ -292,9 +294,7 @@ func (builder *BGPAdvertisementBuilder) WithAggregationLength6(aggregationLength fmt.Printf("%d", aggregationLength) builder.errorMsg = fmt.Sprintf("AggregationLength %d is invalid, the value shoud be in range 0...128", aggregationLength) - } - if builder.errorMsg != "" { return builder } @@ -330,9 +330,7 @@ func (builder *BGPAdvertisementBuilder) WithCommunities(communities []string) *B if len(communities) < 1 { builder.errorMsg = "error: community setting is empty list, the list should contain at least one element" - } - if builder.errorMsg != "" { return builder } @@ -353,9 +351,7 @@ func (builder *BGPAdvertisementBuilder) WithIPAddressPools(ipAddressPools []stri if len(ipAddressPools) < 1 { builder.errorMsg = "error: IPAddressPools setting is empty list, the list should contain at least one element" - } - if builder.errorMsg != "" { return builder } @@ -377,9 +373,7 @@ func (builder *BGPAdvertisementBuilder) WithIPAddressPoolsSelectors( if len(poolSelector) < 1 { builder.errorMsg = "error: IPAddressPoolSelectors setting is empty list, the list should contain at least one element" - } - if builder.errorMsg != "" { return builder } @@ -401,9 +395,7 @@ func (builder *BGPAdvertisementBuilder) WithNodeSelector( if len(nodeSelectors) < 1 { builder.errorMsg = "error: nodeSelectors setting is empty list, the list should contain at least one element" - } - if builder.errorMsg != "" { return builder } @@ -424,9 +416,7 @@ func (builder *BGPAdvertisementBuilder) WithPeers(peers []string) *BGPAdvertisem if len(peers) < 1 { builder.errorMsg = "error: peers setting is empty list, the list should contain at least one element" - } - if builder.errorMsg != "" { return builder } @@ -482,13 +472,13 @@ func (builder *BGPAdvertisementBuilder) validate() (bool, error) { if builder.Definition == nil { glog.V(100).Infof("The %s is undefined", resourceCRD) - builder.errorMsg = msg.UndefinedCrdObjectErrString(resourceCRD) + return false, fmt.Errorf(msg.UndefinedCrdObjectErrString(resourceCRD)) } if builder.apiClient == nil { glog.V(100).Infof("The %s builder apiclient is nil", resourceCRD) - builder.errorMsg = fmt.Sprintf("%s builder cannot have nil apiClient", resourceCRD) + return false, fmt.Errorf("%s builder cannot have nil apiClient", resourceCRD) } if builder.errorMsg != "" { diff --git a/vendor/github.com/openshift-kni/eco-goinfra/pkg/metallb/bgppeer.go b/vendor/github.com/openshift-kni/eco-goinfra/pkg/metallb/bgppeer.go index e221ae298..1115af198 100644 --- a/vendor/github.com/openshift-kni/eco-goinfra/pkg/metallb/bgppeer.go +++ b/vendor/github.com/openshift-kni/eco-goinfra/pkg/metallb/bgppeer.go @@ -43,7 +43,7 @@ func NewBPGPeerBuilder( return nil } - builder := BGPPeerBuilder{ + builder := &BGPPeerBuilder{ apiClient: apiClient.Client, Definition: &mlbtypesv1beta2.BGPPeer{ ObjectMeta: metav1.ObjectMeta{ @@ -61,21 +61,27 @@ func NewBPGPeerBuilder( glog.V(100).Infof("The name of the BGPPeer is empty") builder.errorMsg = "BGPPeer 'name' cannot be empty" + + return builder } if nsname == "" { glog.V(100).Infof("The namespace of the BGPPeer is empty") builder.errorMsg = "BGPPeer 'nsname' cannot be empty" + + return builder } if net.ParseIP(peerIP) == nil { glog.V(100).Infof("The peerIP of the BGPPeer contains invalid ip address %s", peerIP) builder.errorMsg = "BGPPeer 'peerIP' of the BGPPeer contains invalid ip address" + + return builder } - return &builder + return builder } // Get returns BGPPeer object if found. @@ -137,7 +143,7 @@ func PullBGPPeer(apiClient *clients.Settings, name, nsname string) (*BGPPeerBuil return nil, err } - builder := BGPPeerBuilder{ + builder := &BGPPeerBuilder{ apiClient: apiClient.Client, Definition: &mlbtypesv1beta2.BGPPeer{ ObjectMeta: metav1.ObjectMeta{ @@ -150,13 +156,13 @@ func PullBGPPeer(apiClient *clients.Settings, name, nsname string) (*BGPPeerBuil if name == "" { glog.V(100).Infof("The name of the bgppeer is empty") - builder.errorMsg = "bgppeer 'name' cannot be empty" + return nil, fmt.Errorf("bgppeer 'name' cannot be empty") } if nsname == "" { glog.V(100).Infof("The namespace of the bgppeer is empty") - builder.errorMsg = "bgppeer 'namespace' cannot be empty" + return nil, fmt.Errorf("bgppeer 'namespace' cannot be empty") } if !builder.Exists() { @@ -165,7 +171,7 @@ func PullBGPPeer(apiClient *clients.Settings, name, nsname string) (*BGPPeerBuil builder.Definition = builder.Object - return &builder, nil + return builder, nil } // Create makes a BGPPeer in the cluster and stores the created object in struct. @@ -182,16 +188,8 @@ func (builder *BGPPeerBuilder) Create() (*BGPPeerBuilder, error) { if !builder.Exists() { err = builder.apiClient.Create(context.TODO(), builder.Definition) - if err != nil { - glog.V(100).Infof("Failed to create BGPPeer") - - return nil, err - } - - builder.Object = builder.Definition - - if err != nil { - return nil, err + if err == nil { + builder.Object = builder.Definition } } @@ -276,9 +274,7 @@ func (builder *BGPPeerBuilder) WithDynamicASN(dynamicASN mlbtypesv1beta2.Dynamic glog.V(100).Infof("The dynamicASN of the BGPPeer is incorrect") builder.errorMsg = "bgpPeer 'dynamicASN' must be either internal or external" - } - if builder.errorMsg != "" { return builder } @@ -303,9 +299,7 @@ func (builder *BGPPeerBuilder) WithRouterID(routerID string) *BGPPeerBuilder { "routerID should be present in ip address format", routerID) builder.errorMsg = fmt.Sprintf("the routerID of the BGPPeer contains invalid ip address %s", routerID) - } - if builder.errorMsg != "" { return builder } @@ -328,9 +322,7 @@ func (builder *BGPPeerBuilder) WithBFDProfile(bfdProfile string) *BGPPeerBuilder glog.V(100).Infof("The bfdProfile of the BGPPeer can not be empty string") builder.errorMsg = "The bfdProfile is empty string" - } - if builder.errorMsg != "" { return builder } @@ -354,9 +346,7 @@ func (builder *BGPPeerBuilder) WithSRCAddress(srcAddress string) *BGPPeerBuilder "srcAddress should be present in ip address format", srcAddress) builder.errorMsg = fmt.Sprintf("the srcAddress of the BGPPeer contains invalid ip address %s", srcAddress) - } - if builder.errorMsg != "" { return builder } @@ -426,9 +416,7 @@ func (builder *BGPPeerBuilder) WithConnectTime(connectTime metav1.Duration) *BGP glog.V(100).Infof("A valid connect time is between 1-65535") builder.errorMsg = "bgppeer 'connectTime' value is not valid" - } - if builder.errorMsg != "" { return builder } @@ -451,9 +439,7 @@ func (builder *BGPPeerBuilder) WithNodeSelector(nodeSelector map[string]string) glog.V(100).Infof("Can not redefine BGPPeer with empty nodeSelector map") builder.errorMsg = "BGPPeer 'nodeSelector' cannot be empty map" - } - if builder.errorMsg != "" { return builder } @@ -478,9 +464,7 @@ func (builder *BGPPeerBuilder) WithPassword(password string) *BGPPeerBuilder { glog.V(100).Infof("Can not redefine BGPPeer with empty password") builder.errorMsg = "password can not be empty string" - } - if builder.errorMsg != "" { return builder } @@ -550,13 +534,13 @@ func (builder *BGPPeerBuilder) validate() (bool, error) { if builder.Definition == nil { glog.V(100).Infof("The %s is undefined", resourceCRD) - builder.errorMsg = msg.UndefinedCrdObjectErrString(resourceCRD) + return false, fmt.Errorf(msg.UndefinedCrdObjectErrString(resourceCRD)) } if builder.apiClient == nil { glog.V(100).Infof("The %s builder apiclient is nil", resourceCRD) - builder.errorMsg = fmt.Sprintf("%s builder cannot have nil apiClient", resourceCRD) + return false, fmt.Errorf("%s builder cannot have nil apiClient", resourceCRD) } if builder.errorMsg != "" { diff --git a/vendor/github.com/openshift-kni/eco-goinfra/pkg/metallb/frr.go b/vendor/github.com/openshift-kni/eco-goinfra/pkg/metallb/frr.go index 46774e1ed..0a76c0d2a 100644 --- a/vendor/github.com/openshift-kni/eco-goinfra/pkg/metallb/frr.go +++ b/vendor/github.com/openshift-kni/eco-goinfra/pkg/metallb/frr.go @@ -46,7 +46,7 @@ func NewFrrConfigurationBuilder( return nil } - builder := FrrConfigurationBuilder{ + builder := &FrrConfigurationBuilder{ apiClient: apiClient, Definition: &frrtypes.FRRConfiguration{ ObjectMeta: metav1.ObjectMeta{ @@ -61,7 +61,7 @@ func NewFrrConfigurationBuilder( builder.errorMsg = "frrConfiguration 'name' cannot be empty" - return &builder + return builder } if nsname == "" { @@ -69,10 +69,10 @@ func NewFrrConfigurationBuilder( builder.errorMsg = "frrConfiguration 'nsname' cannot be empty" - return &builder + return builder } - return &builder + return builder } // Create makes a FrrConfiguration in the cluster and stores the created object in struct. @@ -224,10 +224,6 @@ func (builder *FrrConfigurationBuilder) WithToReceiveModeAll(routerIndex, neighb return builder } - if builder.errorMsg != "" { - return builder - } - // Update the ToReceive mode to AllowAll for the specified neighbor builder.Definition.Spec.BGP.Routers[routerIndex].Neighbors[neighborIndex].ToReceive.Allowed.Mode = frrtypes.AllowAll diff --git a/vendor/github.com/openshift-kni/eco-goinfra/pkg/metallb/frrnodestate.go b/vendor/github.com/openshift-kni/eco-goinfra/pkg/metallb/frrnodestate.go index 15d14355d..21ec06959 100644 --- a/vendor/github.com/openshift-kni/eco-goinfra/pkg/metallb/frrnodestate.go +++ b/vendor/github.com/openshift-kni/eco-goinfra/pkg/metallb/frrnodestate.go @@ -38,7 +38,7 @@ func PullFrrNodeState(apiClient *clients.Settings, name string) (*FrrNodeStateBu return nil, err } - frrStateBuilder := FrrNodeStateBuilder{ + frrStateBuilder := &FrrNodeStateBuilder{ apiClient: apiClient.Client, Definition: &frrtypes.FRRNodeState{ ObjectMeta: metav1.ObjectMeta{ @@ -59,7 +59,7 @@ func PullFrrNodeState(apiClient *clients.Settings, name string) (*FrrNodeStateBu frrStateBuilder.Definition = frrStateBuilder.Object - return &frrStateBuilder, nil + return frrStateBuilder, nil } // Exists checks whether the given FRRNodeState exists. @@ -112,7 +112,7 @@ func (builder *FrrNodeStateBuilder) validate() (bool, error) { if builder.apiClient == nil { glog.V(100).Infof("The %s builder apiclient is nil", resourceCRD) - builder.errorMsg = fmt.Sprintf("%s builder cannot have nil apiClient", resourceCRD) + return false, fmt.Errorf("%s builder cannot have nil apiClient", resourceCRD) } if builder.errorMsg != "" { diff --git a/vendor/github.com/openshift-kni/eco-goinfra/pkg/metallb/l2advertisement.go b/vendor/github.com/openshift-kni/eco-goinfra/pkg/metallb/l2advertisement.go index a3c4d71a9..b362c74ff 100644 --- a/vendor/github.com/openshift-kni/eco-goinfra/pkg/metallb/l2advertisement.go +++ b/vendor/github.com/openshift-kni/eco-goinfra/pkg/metallb/l2advertisement.go @@ -45,7 +45,7 @@ func NewL2AdvertisementBuilder(apiClient *clients.Settings, name, nsname string) return nil } - builder := L2AdvertisementBuilder{ + builder := &L2AdvertisementBuilder{ apiClient: apiClient.Client, Definition: &mlbtypes.L2Advertisement{ ObjectMeta: metaV1.ObjectMeta{ @@ -59,15 +59,19 @@ func NewL2AdvertisementBuilder(apiClient *clients.Settings, name, nsname string) glog.V(100).Infof("The name of the L2Advertisement is empty") builder.errorMsg = "L2Advertisement 'name' cannot be empty" + + return builder } if nsname == "" { glog.V(100).Infof("The namespace of the L2Advertisement is empty") builder.errorMsg = "L2Advertisement 'nsname' cannot be empty" + + return builder } - return &builder + return builder } // PullL2Advertisement pulls existing L2Advertisement from cluster. @@ -87,7 +91,7 @@ func PullL2Advertisement(apiClient *clients.Settings, name, nsname string) (*L2A return nil, err } - builder := L2AdvertisementBuilder{ + builder := &L2AdvertisementBuilder{ apiClient: apiClient.Client, Definition: &mlbtypes.L2Advertisement{ ObjectMeta: metaV1.ObjectMeta{ @@ -115,7 +119,7 @@ func PullL2Advertisement(apiClient *clients.Settings, name, nsname string) (*L2A builder.Definition = builder.Object - return &builder, nil + return builder, nil } // Exists checks whether the given L2Advertisement exists. @@ -174,16 +178,8 @@ func (builder *L2AdvertisementBuilder) Create() (*L2AdvertisementBuilder, error) if !builder.Exists() { err = builder.apiClient.Create(context.TODO(), builder.Definition) - if err != nil { - glog.V(100).Infof("Failed to create L2Advertisement") - - return nil, err - } - - builder.Object = builder.Definition - - if err != nil { - return nil, err + if err == nil { + builder.Object = builder.Definition } } @@ -276,9 +272,7 @@ func (builder *L2AdvertisementBuilder) WithNodeSelector(nodeSelectors []metaV1.L if len(nodeSelectors) < 1 { builder.errorMsg = "error: nodeSelectors setting is empty list, the list should contain at least one element" - } - if builder.errorMsg != "" { return builder } @@ -299,9 +293,7 @@ func (builder *L2AdvertisementBuilder) WithIPAddressPools(ipAddressPools []strin if len(ipAddressPools) < 1 { builder.errorMsg = "error: IPAddressPools setting is empty list, the list should contain at least one element" - } - if builder.errorMsg != "" { return builder } @@ -324,9 +316,7 @@ func (builder *L2AdvertisementBuilder) WithIPAddressPoolsSelectors( if len(poolSelector) < 1 { builder.errorMsg = "error: IPAddressPoolSelectors setting is empty list, " + "the list should contain at least one element" - } - if builder.errorMsg != "" { return builder } @@ -382,13 +372,13 @@ func (builder *L2AdvertisementBuilder) validate() (bool, error) { if builder.Definition == nil { glog.V(100).Infof("The %s is undefined", resourceCRD) - builder.errorMsg = msg.UndefinedCrdObjectErrString(resourceCRD) + return false, fmt.Errorf(msg.UndefinedCrdObjectErrString(resourceCRD)) } if builder.apiClient == nil { glog.V(100).Infof("The %s builder apiclient is nil", resourceCRD) - builder.errorMsg = fmt.Sprintf("%s builder cannot have nil apiClient", resourceCRD) + return false, fmt.Errorf("%s builder cannot have nil apiClient", resourceCRD) } if builder.errorMsg != "" { diff --git a/vendor/github.com/openshift-kni/eco-goinfra/pkg/metallb/metallb.go b/vendor/github.com/openshift-kni/eco-goinfra/pkg/metallb/metallb.go index 057e57ded..90bf8013e 100644 --- a/vendor/github.com/openshift-kni/eco-goinfra/pkg/metallb/metallb.go +++ b/vendor/github.com/openshift-kni/eco-goinfra/pkg/metallb/metallb.go @@ -40,7 +40,7 @@ func NewBuilder(apiClient *clients.Settings, name, nsname string, nodeSelector m return nil } - builder := Builder{ + builder := &Builder{ apiClient: apiClient.Client, Definition: &mlbtypes.MetalLB{ ObjectMeta: metav1.ObjectMeta{ @@ -57,21 +57,27 @@ func NewBuilder(apiClient *clients.Settings, name, nsname string, nodeSelector m glog.V(100).Infof("The name of the metallb is empty") builder.errorMsg = "metallb 'name' cannot be empty" + + return builder } if nsname == "" { glog.V(100).Infof("The namespace of the metallb is empty") builder.errorMsg = "metallb 'nsname' cannot be empty" + + return builder } if len(nodeSelector) < 1 { glog.V(100).Infof("The SpeakerNodeSelector of the metallb is empty") builder.errorMsg = "metallb 'nodeSelector' cannot be empty" + + return builder } - return &builder + return builder } // Pull retrieves an existing metallb.io object from the cluster. @@ -92,7 +98,7 @@ func Pull(apiClient *clients.Settings, name, nsname string) (*Builder, error) { return nil, err } - builder := Builder{ + builder := &Builder{ apiClient: apiClient.Client, Definition: &mlbtypes.MetalLB{ ObjectMeta: metav1.ObjectMeta{ @@ -120,7 +126,7 @@ func Pull(apiClient *clients.Settings, name, nsname string) (*Builder, error) { builder.Definition = builder.Object - return &builder, nil + return builder, nil } // Exists checks whether the given MetalLb exists. @@ -182,16 +188,8 @@ func (builder *Builder) Create() (*Builder, error) { if !builder.Exists() { err = builder.apiClient.Create(context.TODO(), builder.Definition) - if err != nil { - glog.V(100).Infof("Failed to create MetalLb") - - return nil, err - } - - builder.Object = builder.Definition - - if err != nil { - return nil, err + if err == nil { + builder.Object = builder.Definition } } @@ -242,10 +240,6 @@ func (builder *Builder) Update(force bool) (*Builder, error) { builder.Definition.Name, builder.Definition.Namespace, ) - if builder.errorMsg != "" { - return nil, fmt.Errorf(builder.errorMsg) - } - builder.Definition.ResourceVersion = builder.Object.ResourceVersion builder.Definition.ObjectMeta.ResourceVersion = builder.Object.ObjectMeta.ResourceVersion @@ -283,9 +277,7 @@ func (builder *Builder) RemoveLabel(key string) *Builder { if key == "" { glog.V(100).Infof("Failed to remove empty label's key from metalLbIo %s", builder.Definition.Name) builder.errorMsg = "error to remove empty key from metalLbIo" - } - if builder.errorMsg != "" { return builder } @@ -306,9 +298,7 @@ func (builder *Builder) WithSpeakerNodeSelector(label map[string]string) *Builde if len(label) < 1 { builder.errorMsg = "can not accept empty label and redefine metallb NodeSelector" - } - if builder.errorMsg != "" { return builder } @@ -394,13 +384,13 @@ func (builder *Builder) validate() (bool, error) { if builder.Definition == nil { glog.V(100).Infof("The %s is undefined", resourceCRD) - builder.errorMsg = msg.UndefinedCrdObjectErrString(resourceCRD) + return false, fmt.Errorf(msg.UndefinedCrdObjectErrString(resourceCRD)) } if builder.apiClient == nil { glog.V(100).Infof("The %s builder apiclient is nil", resourceCRD) - builder.errorMsg = fmt.Sprintf("%s builder cannot have nil apiClient", resourceCRD) + return false, fmt.Errorf("%s builder cannot have nil apiClient", resourceCRD) } if builder.errorMsg != "" { diff --git a/vendor/github.com/openshift-kni/eco-goinfra/pkg/nad/builder.go b/vendor/github.com/openshift-kni/eco-goinfra/pkg/nad/builder.go index 454cf180a..af93bfc77 100644 --- a/vendor/github.com/openshift-kni/eco-goinfra/pkg/nad/builder.go +++ b/vendor/github.com/openshift-kni/eco-goinfra/pkg/nad/builder.go @@ -50,7 +50,7 @@ func NewBuilder(apiClient *clients.Settings, name, nsname string) *Builder { return nil } - builder := Builder{ + builder := &Builder{ apiClient: apiClient, Definition: &nadV1.NetworkAttachmentDefinition{ ObjectMeta: metav1.ObjectMeta{ @@ -64,15 +64,19 @@ func NewBuilder(apiClient *clients.Settings, name, nsname string) *Builder { glog.V(100).Infof("The name of the NetworkAttachmentDefinition is empty") builder.errorMsg = "NAD name is empty" + + return builder } if builder.Definition.Namespace == "" { glog.V(100).Infof("The namespace of the NetworkAttachmentDefinition is empty") builder.errorMsg = "NAD namespace is empty" + + return builder } - return &builder + return builder } // Pull pulls existing networkattachmentdefinition from cluster. @@ -93,7 +97,7 @@ func Pull(apiClient *clients.Settings, name, nsname string) (*Builder, error) { return nil, fmt.Errorf("failed to add nad v1 scheme to client schemes") } - builder := Builder{ + builder := &Builder{ apiClient: apiClient, Definition: &nadV1.NetworkAttachmentDefinition{ ObjectMeta: metav1.ObjectMeta{ @@ -121,7 +125,7 @@ func Pull(apiClient *clients.Settings, name, nsname string) (*Builder, error) { builder.Definition = builder.Object - return &builder, nil + return builder, nil } // Get returns CatalogSource object if found. @@ -324,12 +328,16 @@ func (builder *Builder) WithMasterPlugin(masterPlugin *MasterPlugin) *Builder { if builder.Definition.Spec != emptyNadConfig { builder.errorMsg = "error to redefine predefine NAD" + + return builder } masterPluginSting, err := json.Marshal(masterPlugin) if err != nil { builder.errorMsg = err.Error() + + return builder } builder.Definition.Spec.Config = string(masterPluginSting) @@ -355,6 +363,8 @@ func (builder *Builder) WithPlugins(name string, plugins *[]Plugin) *Builder { if err != nil { builder.errorMsg = err.Error() + + return builder } builder.Definition.Spec.Config = string(pluginsConfigString) @@ -383,13 +393,13 @@ func (builder *Builder) validate() (bool, error) { if builder.Definition == nil { glog.V(100).Infof("The %s is undefined", resourceCRD) - builder.errorMsg = msg.UndefinedCrdObjectErrString(resourceCRD) + return false, fmt.Errorf(msg.UndefinedCrdObjectErrString(resourceCRD)) } if builder.apiClient == nil { glog.V(100).Infof("The %s builder apiclient is nil", resourceCRD) - builder.errorMsg = fmt.Sprintf("%s builder cannot have nil apiClient", resourceCRD) + return false, fmt.Errorf("%s builder cannot have nil apiClient", resourceCRD) } if builder.errorMsg != "" { diff --git a/vendor/github.com/openshift-kni/eco-goinfra/pkg/nad/masterplugin.go b/vendor/github.com/openshift-kni/eco-goinfra/pkg/nad/masterplugin.go index 6379caa44..7bf0bae74 100644 --- a/vendor/github.com/openshift-kni/eco-goinfra/pkg/nad/masterplugin.go +++ b/vendor/github.com/openshift-kni/eco-goinfra/pkg/nad/masterplugin.go @@ -25,7 +25,7 @@ func NewMasterMacVlanPlugin(name string) *MasterMacVlanPlugin { glog.V(100).Infof( "Initializing new MasterVlanPlugin structure with the following param: %s", name) - builder := MasterMacVlanPlugin{ + builder := &MasterMacVlanPlugin{ masterPlugin: &MasterPlugin{ CniVersion: "0.3.1", Name: name, @@ -37,9 +37,11 @@ func NewMasterMacVlanPlugin(name string) *MasterMacVlanPlugin { glog.V(100).Infof("error MasterMacVlanPlugin can not be empty") builder.errorMsg = "MasterMacVlanPlugin name is empty" + + return builder } - return &builder + return builder } // WithMode defines macvlan type to MasterMacVlanPlugin. Default is bridge. @@ -55,6 +57,8 @@ func (plugin *MasterMacVlanPlugin) WithMode(mode string) *MasterMacVlanPlugin { if plugin.masterPlugin == nil { glog.V(100).Infof(msg.UndefinedCrdObjectErrString("MasterMacVlanPlugin")) plugin.errorMsg = msg.UndefinedCrdObjectErrString("MasterMacVlanPlugin") + + return plugin } plugin.masterPlugin.Mode = mode @@ -75,6 +79,8 @@ func (plugin *MasterMacVlanPlugin) WithMasterInterface(master string) *MasterMac glog.V(100).Infof("error to add master interface, the name of interface can not be empty") plugin.errorMsg = "invalid master parameter" + + return plugin } plugin.masterPlugin.Master = master @@ -95,6 +101,8 @@ func (plugin *MasterMacVlanPlugin) WithIPAM(ipam *IPAM) *MasterMacVlanPlugin { glog.V(100).Infof("error to add empty ipam to MasterMacVlanPlugin") plugin.errorMsg = invalidIpamParameterMsg + + return plugin } plugin.masterPlugin.Ipam = ipam @@ -136,7 +144,7 @@ func NewMasterBridgePlugin(name, bridgeName string) *MasterBridgePlugin { glog.V(100).Infof( "Initializing new MasterBridgePlugin structure %s, with bridge %s", name, bridgeName) - builder := MasterBridgePlugin{ + builder := &MasterBridgePlugin{ masterPlugin: &MasterPlugin{ CniVersion: "0.3.1", Name: name, @@ -149,9 +157,11 @@ func NewMasterBridgePlugin(name, bridgeName string) *MasterBridgePlugin { glog.V(100).Infof("error MasterBridgePlugin can not be empty") builder.errorMsg = "MasterBridgePlugin name is empty" + + return builder } - return &builder + return builder } // GetMasterPluginConfig returns master plugin if error does not occur. @@ -170,12 +180,16 @@ func (plugin *MasterBridgePlugin) WithIPAM(ipam *IPAM) *MasterBridgePlugin { if plugin.masterPlugin == nil { glog.V(100).Infof(msg.UndefinedCrdObjectErrString("MasterBridgePlugin")) plugin.errorMsg = msg.UndefinedCrdObjectErrString("MasterBridgePlugin") + + return plugin } if ipam == nil { glog.V(100).Infof("error adding empty ipam to MasterBridgePlugin") plugin.errorMsg = invalidIpamParameterMsg + + return plugin } plugin.masterPlugin.Ipam = ipam @@ -194,7 +208,7 @@ func NewMasterVlanPlugin(name string, vlanID uint16) *MasterVlanPlugin { glog.V(100).Infof( "Initializing new MasterVlanPlugin structure %s, with vlanId %s", name, vlanID) - builder := MasterVlanPlugin{ + builder := &MasterVlanPlugin{ masterPlugin: &MasterPlugin{ CniVersion: "0.3.1", Name: name, @@ -207,15 +221,19 @@ func NewMasterVlanPlugin(name string, vlanID uint16) *MasterVlanPlugin { glog.V(100).Infof("error vlan id can not be greater than 4094") builder.errorMsg = "MasterVlanPlugin vlanID is greater than 4094" + + return builder } if builder.masterPlugin.Name == "" { glog.V(100).Infof("error MasterVlanPlugin name can not be empty") builder.errorMsg = "MasterVlanPlugin name is empty" + + return builder } - return &builder + return builder } // WithIPAM defines IPAM configuration to MasterVlanPlugin. Default is empty. @@ -225,15 +243,15 @@ func (plugin *MasterVlanPlugin) WithIPAM(ipam *IPAM) *MasterVlanPlugin { if plugin.masterPlugin == nil { glog.V(100).Infof(msg.UndefinedCrdObjectErrString("MasterVlanPlugin")) plugin.errorMsg = msg.UndefinedCrdObjectErrString("MasterVlanPlugin") + + return plugin } if ipam == nil { glog.V(100).Infof("error adding empty ipam to MasterVlanPlugin") plugin.errorMsg = invalidIpamParameterMsg - } - if plugin.errorMsg != "" { return plugin } @@ -249,15 +267,15 @@ func (plugin *MasterVlanPlugin) WithMasterInterface(masterInterfaceName string) if plugin.masterPlugin == nil { glog.V(100).Infof(msg.UndefinedCrdObjectErrString("MasterVlanPlugin")) plugin.errorMsg = msg.UndefinedCrdObjectErrString("MasterVlanPlugin") + + return plugin } if masterInterfaceName == "" { glog.V(100).Infof("error to add masterInterfaceName interface, the name of interface can not be empty") plugin.errorMsg = "invalid masterInterfaceName parameter" - } - if plugin.errorMsg != "" { return plugin } @@ -271,9 +289,7 @@ func (plugin *MasterVlanPlugin) WithLinkInContainer() *MasterVlanPlugin { if plugin.masterPlugin == nil { glog.V(100).Infof(msg.UndefinedCrdObjectErrString("MasterVlanPlugin")) plugin.errorMsg = msg.UndefinedCrdObjectErrString("MasterVlanPlugin") - } - if plugin.errorMsg != "" { return plugin } @@ -302,7 +318,7 @@ func NewMasterIPVlanPlugin(name string) *MasterIPVlanPlugin { glog.V(100).Infof( "Initializing new MasterIPVlanPlugin structure %s", name) - builder := MasterIPVlanPlugin{ + builder := &MasterIPVlanPlugin{ masterPlugin: &MasterPlugin{ CniVersion: "0.3.1", Name: name, @@ -314,9 +330,11 @@ func NewMasterIPVlanPlugin(name string) *MasterIPVlanPlugin { glog.V(100).Infof("error MasterIPVlanPlugin can not be empty") builder.errorMsg = "MasterIPVlanPlugin name is empty" + + return builder } - return &builder + return builder } // WithIPAM defines IPAM configuration to MasterIPVlanPlugin. Default is empty. @@ -326,15 +344,15 @@ func (plugin *MasterIPVlanPlugin) WithIPAM(ipam *IPAM) *MasterIPVlanPlugin { if plugin.masterPlugin == nil { glog.V(100).Infof(msg.UndefinedCrdObjectErrString("MasterIPVlanPlugin")) plugin.errorMsg = msg.UndefinedCrdObjectErrString("MasterIPVlanPlugin") + + return plugin } if ipam == nil { glog.V(100).Infof("error adding empty ipam to MasterIPVlanPlugin") plugin.errorMsg = invalidIpamParameterMsg - } - if plugin.errorMsg != "" { return plugin } @@ -350,15 +368,15 @@ func (plugin *MasterIPVlanPlugin) WithMasterInterface(masterInterfaceName string if plugin.masterPlugin == nil { glog.V(100).Infof(msg.UndefinedCrdObjectErrString("MasterIPVlanPlugin")) plugin.errorMsg = msg.UndefinedCrdObjectErrString("MasterIPVlanPlugin") + + return plugin } if masterInterfaceName == "" { glog.V(100).Infof("error to add master interface, the name of interface can not be empty") plugin.errorMsg = "invalid masterInterfaceName parameter" - } - if plugin.errorMsg != "" { return plugin } @@ -374,9 +392,7 @@ func (plugin *MasterIPVlanPlugin) WithLinkInContainer() *MasterIPVlanPlugin { if plugin.masterPlugin == nil { glog.V(100).Infof(msg.UndefinedCrdObjectErrString("MasterIPVlanPlugin")) plugin.errorMsg = msg.UndefinedCrdObjectErrString("MasterIPVlanPlugin") - } - if plugin.errorMsg != "" { return plugin } @@ -410,7 +426,7 @@ func NewMasterBondPlugin(name, mode string) *MasterBondPlugin { "balance-xor": true, } - builder := MasterBondPlugin{ + builder := &MasterBondPlugin{ masterPlugin: &MasterPlugin{ CniVersion: "0.3.1", Name: name, @@ -424,15 +440,19 @@ func NewMasterBondPlugin(name, mode string) *MasterBondPlugin { glog.V(100).Infof("error: invalid mode type %s used for MasterBondPlugin bond interface", mode) builder.errorMsg = "Bond mode type is not valid" + + return builder } if builder.masterPlugin.Name == "" { glog.V(100).Infof("error NewMasterBondPlugin name can not be empty") builder.errorMsg = "NewMasterBondPlugin name is empty" + + return builder } - return &builder + return builder } // WithLinksInContainer defines linksInContainer configuration to MasterBondPlugin. @@ -451,6 +471,8 @@ func (plugin *MasterBondPlugin) WithFailOverMac(failOverMac int) *MasterBondPlug glog.V(100).Infof("error adding incorrect value %d for FailOverMac in MasterBondPlugin", failOverMac) plugin.errorMsg = "error adding incorrect FailOverMac to MasterBondPlugin" + + return plugin } plugin.masterPlugin.FailOverMac = failOverMac @@ -466,6 +488,8 @@ func (plugin *MasterBondPlugin) WithMiimon(miimon int) *MasterBondPlugin { glog.V(100).Infof("error adding incorrect miimon value %d to MasterBondPlugin", miimon) plugin.errorMsg = "error adding incorrect miimon value to MasterBondPlugin" + + return plugin } plugin.masterPlugin.Miimon = fmt.Sprintf("%d", miimon) @@ -481,6 +505,8 @@ func (plugin *MasterBondPlugin) WithLinks(links []Link) *MasterBondPlugin { glog.V(100).Infof("links value %v cannot be nil or empty in MasterBondPlugin", links) plugin.errorMsg = "error adding empty links to MasterBondPlugin" + + return plugin } plugin.masterPlugin.Links = links @@ -496,6 +522,8 @@ func (plugin *MasterBondPlugin) WithCapabilities(capabilities *Capability) *Mast glog.V(100).Infof("error adding nil value %d capabilities to MasterBondPlugin", capabilities) plugin.errorMsg = "error adding empty capabilities to MasterBondPlugin" + + return plugin } plugin.masterPlugin.Capabilities = capabilities @@ -511,6 +539,8 @@ func (plugin *MasterBondPlugin) WithIPAM(ipam *IPAM) *MasterBondPlugin { glog.V(100).Infof("error adding ipam value %d to MasterBondPlugin", ipam) plugin.errorMsg = "error adding empty ipam to MasterBondPlugin" + + return plugin } plugin.masterPlugin.Ipam = ipam @@ -526,6 +556,8 @@ func (plugin *MasterBondPlugin) WithVLANInContainer(vlan uint16) *MasterBondPlug glog.V(100).Infof("error adding incorrect vlan id %d to MasterBondPlugin", vlan) plugin.errorMsg = "error adding incorrect vlan to MasterBondPlugin" + + return plugin } plugin.masterPlugin.VlanID = vlan diff --git a/vendor/github.com/openshift-kni/eco-goinfra/pkg/schemes/argocd/argocdoperator/argocd_types.go b/vendor/github.com/openshift-kni/eco-goinfra/pkg/schemes/argocd/argocdoperator/argocd_types.go index 43fc179a8..b888ce649 100644 --- a/vendor/github.com/openshift-kni/eco-goinfra/pkg/schemes/argocd/argocdoperator/argocd_types.go +++ b/vendor/github.com/openshift-kni/eco-goinfra/pkg/schemes/argocd/argocdoperator/argocd_types.go @@ -940,6 +940,15 @@ type ArgoCDSpec struct { AggregatedClusterRoles bool `json:"aggregatedClusterRoles,omitempty"` } +const ( + ArgoCDConditionType = "Reconciled" +) + +const ( + ArgoCDConditionReasonSuccess = "Success" + ArgoCDConditionReasonErrorOccurred = "ErrorOccurred" +) + // ArgoCDStatus defines the observed state of ArgoCD // +k8s:openapi-gen=true type ArgoCDStatus struct { @@ -1023,6 +1032,9 @@ type ArgoCDStatus struct { // Host is the hostname of the Ingress. Host string `json:"host,omitempty"` + + // Conditions is an array of the ArgoCD's status conditions + Conditions []metav1.Condition `json:"conditions,omitempty"` } // Banner defines an additional banner message to be displayed in Argo CD UI diff --git a/vendor/github.com/openshift-kni/eco-goinfra/pkg/schemes/argocd/argocdoperator/zz_generated.deepcopy.go b/vendor/github.com/openshift-kni/eco-goinfra/pkg/schemes/argocd/argocdoperator/zz_generated.deepcopy.go index 5fe68f860..61d472998 100644 --- a/vendor/github.com/openshift-kni/eco-goinfra/pkg/schemes/argocd/argocdoperator/zz_generated.deepcopy.go +++ b/vendor/github.com/openshift-kni/eco-goinfra/pkg/schemes/argocd/argocdoperator/zz_generated.deepcopy.go @@ -35,7 +35,7 @@ func (in *ArgoCD) DeepCopyInto(out *ArgoCD) { out.TypeMeta = in.TypeMeta in.ObjectMeta.DeepCopyInto(&out.ObjectMeta) in.Spec.DeepCopyInto(&out.Spec) - out.Status = in.Status + in.Status.DeepCopyInto(&out.Status) } // DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new ArgoCD. @@ -1026,6 +1026,13 @@ func (in *ArgoCDSpec) DeepCopy() *ArgoCDSpec { // DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. func (in *ArgoCDStatus) DeepCopyInto(out *ArgoCDStatus) { *out = *in + if in.Conditions != nil { + in, out := &in.Conditions, &out.Conditions + *out = make([]metav1.Condition, len(*in)) + for i := range *in { + (*in)[i].DeepCopyInto(&(*out)[i]) + } + } } // DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new ArgoCDStatus. diff --git a/vendor/modules.txt b/vendor/modules.txt index 618fe16b1..7071d3379 100644 --- a/vendor/modules.txt +++ b/vendor/modules.txt @@ -564,7 +564,7 @@ github.com/opencontainers/runtime-spec/specs-go ## explicit; go 1.22.0 github.com/openshift-kni/cluster-group-upgrades-operator/pkg/api/clustergroupupgrades github.com/openshift-kni/cluster-group-upgrades-operator/pkg/api/clustergroupupgrades/v1alpha1 -# github.com/openshift-kni/eco-goinfra v0.0.0-20241219141530-75a2d0ca0053 +# github.com/openshift-kni/eco-goinfra v0.0.0-20241220182656-f51076771e09 ## explicit; go 1.23 github.com/openshift-kni/eco-goinfra/pkg/apiservers github.com/openshift-kni/eco-goinfra/pkg/argocd