Skip to content
This repository has been archived by the owner on Mar 4, 2024. It is now read-only.

Commit

Permalink
EVEREST-734: do not fail on vmagent not present (#402)
Browse files Browse the repository at this point in the history
  • Loading branch information
Michal Kralik authored Jan 23, 2024
1 parent 4f979e9 commit a63eea5
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions pkg/kubernetes/monitoring_config.go
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,7 @@ import (
"errors"

everestv1alpha1 "github.com/percona/everest-operator/api/v1alpha1"
"k8s.io/apimachinery/pkg/api/meta"
metav1 "k8s.io/apimachinery/pkg/apis/meta/v1"
"k8s.io/apimachinery/pkg/apis/meta/v1/unstructured"
)
Expand Down Expand Up @@ -87,6 +88,9 @@ func (k *Kubernetes) IsMonitoringConfigUsed(ctx context.Context, monitoringConfi
func (k *Kubernetes) isMonitoringConfigUsedByVMAgent(ctx context.Context, name string) (bool, error) {
vmAgents, err := k.ListVMAgents()
if err != nil {
if errors.Is(err, &meta.NoKindMatchError{}) {
return false, nil
}
return false, errors.Join(err, errors.New("could not list VM agents in Kubernetes"))
}
secretNames := make([]string, 0, len(vmAgents.Items))
Expand Down

0 comments on commit a63eea5

Please sign in to comment.