Skip to content

Commit

Permalink
Merge pull request #711 from vyzigold/get_telemetry
Browse files Browse the repository at this point in the history
Get telemetry CR before trying to read from it
  • Loading branch information
openshift-merge-bot[bot] authored Mar 15, 2024
2 parents 06580bd + 8c376fe commit 2a8c62a
Showing 1 changed file with 8 additions and 0 deletions.
8 changes: 8 additions & 0 deletions pkg/openstack/telemetry.go
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,9 @@ import (
corev1beta1 "github.com/openstack-k8s-operators/openstack-operator/apis/core/v1beta1"
telemetryv1 "github.com/openstack-k8s-operators/telemetry-operator/api/v1beta1"

k8s_errors "k8s.io/apimachinery/pkg/api/errors"
metav1 "k8s.io/apimachinery/pkg/apis/meta/v1"
"k8s.io/apimachinery/pkg/types"
ctrl "sigs.k8s.io/controller-runtime"
"sigs.k8s.io/controller-runtime/pkg/controller/controllerutil"
)
Expand Down Expand Up @@ -39,6 +41,12 @@ func ReconcileTelemetry(ctx context.Context, instance *corev1beta1.OpenStackCont
return ctrl.Result{}, nil
}

if err := helper.GetClient().Get(ctx, types.NamespacedName{Name: "telemetry", Namespace: instance.Namespace}, telemetry); err != nil {
if !k8s_errors.IsNotFound(err) {
return ctrl.Result{}, err
}
}

// add selector to service overrides
for _, endpointType := range []service.Endpoint{service.EndpointPublic, service.EndpointInternal} {
if instance.Spec.Telemetry.Template.Autoscaling.Aodh.Override.Service == nil {
Expand Down

0 comments on commit 2a8c62a

Please sign in to comment.