Skip to content

Commit

Permalink
Changes required after dependencies update in Dockerfile & other files
Browse files Browse the repository at this point in the history
Signed-off-by: Malay Kumar Parida <[email protected]>
  • Loading branch information
malayparida2000 committed Jul 3, 2024
1 parent a39fa3f commit 8d07442
Show file tree
Hide file tree
Showing 14 changed files with 25 additions and 24 deletions.
2 changes: 1 addition & 1 deletion Dockerfile
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
# Build stage 1

FROM golang:1.21 as builder
FROM docker.io/library/golang:1.22 as builder

WORKDIR /workspace

Expand Down
16 changes: 8 additions & 8 deletions controllers/storagecluster/exporter.go
Original file line number Diff line number Diff line change
Expand Up @@ -201,10 +201,10 @@ func getMetricsExporterServiceMonitor(instance *ocsv1.StorageCluster) *monitorin
serverName := fmt.Sprintf("ocs-metrics-exporter.%s.svc", instance.GetNamespace())

// To add storagecluster CR name to the metrics as label: managedBy
relabelConfigs := []*monitoringv1.RelabelConfig{
relabelConfigs := []monitoringv1.RelabelConfig{
{
TargetLabel: "managedBy",
Replacement: instance.Name,
Replacement: ptr.To(instance.Name),
},
}

Expand Down Expand Up @@ -237,8 +237,8 @@ func getMetricsExporterServiceMonitor(instance *ocsv1.StorageCluster) *monitorin
Scheme: "https",
TLSConfig: &monitoringv1.TLSConfig{
SafeTLSConfig: monitoringv1.SafeTLSConfig{
InsecureSkipVerify: false,
ServerName: serverName,
InsecureSkipVerify: ptr.To(false),
ServerName: ptr.To(serverName),
},
CAFile: "/etc/prometheus/configmaps/serving-certs-ca-bundle/service-ca.crt",
},
Expand All @@ -252,8 +252,8 @@ func getMetricsExporterServiceMonitor(instance *ocsv1.StorageCluster) *monitorin
Scheme: "https",
TLSConfig: &monitoringv1.TLSConfig{
SafeTLSConfig: monitoringv1.SafeTLSConfig{
InsecureSkipVerify: false,
ServerName: serverName,
InsecureSkipVerify: ptr.To(false),
ServerName: ptr.To(serverName),
},
CAFile: "/etc/prometheus/configmaps/serving-certs-ca-bundle/service-ca.crt",
},
Expand All @@ -267,8 +267,8 @@ func getMetricsExporterServiceMonitor(instance *ocsv1.StorageCluster) *monitorin
Scheme: "https",
TLSConfig: &monitoringv1.TLSConfig{
SafeTLSConfig: monitoringv1.SafeTLSConfig{
InsecureSkipVerify: false,
ServerName: serverName,
InsecureSkipVerify: ptr.To(false),
ServerName: ptr.To(serverName),
},
CAFile: "/etc/prometheus/configmaps/serving-certs-ca-bundle/service-ca.crt",
},
Expand Down
2 changes: 1 addition & 1 deletion controllers/storagecluster/storagecluster_controller.go
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ import (

"github.com/go-logr/logr"
"github.com/google/go-cmp/cmp"
volumesnapshotv1 "github.com/kubernetes-csi/external-snapshotter/client/v7/apis/volumesnapshot/v1"
volumesnapshotv1 "github.com/kubernetes-csi/external-snapshotter/client/v8/apis/volumesnapshot/v1"
nbv1 "github.com/noobaa/noobaa-operator/v5/pkg/apis/noobaa/v1alpha1"
routev1 "github.com/openshift/api/route/v1"
templatev1 "github.com/openshift/api/template/v1"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ import (
ocsversion "github.com/red-hat-storage/ocs-operator/v4/version"

"github.com/blang/semver/v4"
snapapi "github.com/kubernetes-csi/external-snapshotter/client/v7/apis/volumesnapshot/v1"
snapapi "github.com/kubernetes-csi/external-snapshotter/client/v8/apis/volumesnapshot/v1"
nbv1 "github.com/noobaa/noobaa-operator/v5/pkg/apis/noobaa/v1alpha1"
configv1 "github.com/openshift/api/config/v1"
quotav1 "github.com/openshift/api/quota/v1"
Expand Down
2 changes: 1 addition & 1 deletion controllers/storagecluster/uninstall_reconciler_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ import (
"fmt"
"testing"

snapapi "github.com/kubernetes-csi/external-snapshotter/client/v7/apis/volumesnapshot/v1"
snapapi "github.com/kubernetes-csi/external-snapshotter/client/v8/apis/volumesnapshot/v1"
nbv1 "github.com/noobaa/noobaa-operator/v5/pkg/apis/noobaa/v1alpha1"
v1 "github.com/openshift/api/config/v1"
ocsv1 "github.com/red-hat-storage/ocs-operator/api/v4/v1"
Expand Down
2 changes: 1 addition & 1 deletion controllers/storagecluster/volumesnapshotterclasses.go
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ import (
"k8s.io/klog/v2"
"sigs.k8s.io/controller-runtime/pkg/reconcile"

snapapi "github.com/kubernetes-csi/external-snapshotter/client/v7/apis/volumesnapshot/v1"
snapapi "github.com/kubernetes-csi/external-snapshotter/client/v8/apis/volumesnapshot/v1"
ocsv1 "github.com/red-hat-storage/ocs-operator/api/v4/v1"
metav1 "k8s.io/apimachinery/pkg/apis/meta/v1"
)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ import (
"context"
"testing"

snapapi "github.com/kubernetes-csi/external-snapshotter/client/v7/apis/volumesnapshot/v1"
snapapi "github.com/kubernetes-csi/external-snapshotter/client/v8/apis/volumesnapshot/v1"
metav1 "k8s.io/apimachinery/pkg/apis/meta/v1"

"github.com/stretchr/testify/assert"
Expand Down
2 changes: 1 addition & 1 deletion controllers/storagerequest/storagerequest_controller.go
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ import (
"strings"

"github.com/go-logr/logr"
snapapi "github.com/kubernetes-csi/external-snapshotter/client/v7/apis/volumesnapshot/v1"
snapapi "github.com/kubernetes-csi/external-snapshotter/client/v8/apis/volumesnapshot/v1"
v1 "github.com/red-hat-storage/ocs-operator/api/v4/v1"
"github.com/red-hat-storage/ocs-operator/api/v4/v1alpha1"
controllers "github.com/red-hat-storage/ocs-operator/v4/controllers/storageconsumer"
Expand Down
2 changes: 1 addition & 1 deletion main.go
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ import (
"runtime"

nadscheme "github.com/k8snetworkplumbingwg/network-attachment-definition-client/pkg/client/clientset/versioned/scheme"
snapapi "github.com/kubernetes-csi/external-snapshotter/client/v7/apis/volumesnapshot/v1"
snapapi "github.com/kubernetes-csi/external-snapshotter/client/v8/apis/volumesnapshot/v1"
nbapis "github.com/noobaa/noobaa-operator/v5/pkg/apis"
openshiftConfigv1 "github.com/openshift/api/config/v1"
quotav1 "github.com/openshift/api/quota/v1"
Expand Down
2 changes: 1 addition & 1 deletion metrics/Dockerfile
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
# Build stage 1

FROM golang:1.21 as builder
FROM docker.io/library/golang:1.22 as builder

WORKDIR /workspace

Expand Down
2 changes: 1 addition & 1 deletion metrics/internal/cache/cache_suite_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ package cache
import (
"testing"

. "github.com/onsi/ginkgo"
. "github.com/onsi/ginkgo/v2"
. "github.com/onsi/gomega"
)

Expand Down
2 changes: 1 addition & 1 deletion metrics/internal/cache/pv_test.go
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
package cache

import (
. "github.com/onsi/ginkgo"
. "github.com/onsi/ginkgo/v2"
. "github.com/onsi/gomega"
"github.com/red-hat-storage/ocs-operator/metrics/v4/internal/options"
corev1 "k8s.io/api/core/v1"
Expand Down
2 changes: 1 addition & 1 deletion metrics/internal/cache/rbd_mirror_test.go
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
package cache

import (
. "github.com/onsi/ginkgo"
. "github.com/onsi/ginkgo/v2"
. "github.com/onsi/gomega"
"github.com/red-hat-storage/ocs-operator/metrics/v4/internal/options"
cephv1 "github.com/rook/rook/pkg/apis/ceph.rook.io/v1"
Expand Down
9 changes: 5 additions & 4 deletions templates/k8smetricsservicemonitor.go
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@ package templates
import (
promv1 "github.com/prometheus-operator/prometheus-operator/pkg/apis/monitoring/v1"
metav1 "k8s.io/apimachinery/pkg/apis/meta/v1"
"k8s.io/utils/ptr"
)

var params = map[string][]string{
Expand Down Expand Up @@ -32,17 +33,17 @@ var K8sMetricsServiceMonitorSpecTemplate = promv1.ServiceMonitorSpec{
ScrapeTimeout: "1m",
Interval: "2m",
HonorLabels: true,
MetricRelabelConfigs: []*promv1.RelabelConfig{
MetricRelabelConfigs: []promv1.RelabelConfig{
{
Action: "labeldrop",
Regex: "prometheus_replica",
},
},
RelabelConfigs: []*promv1.RelabelConfig{
RelabelConfigs: []promv1.RelabelConfig{
{
Action: "replace",
Regex: "prometheus-k8s-.*",
Replacement: "",
Replacement: ptr.To(""),
SourceLabels: []promv1.LabelName{
"pod",
},
Expand All @@ -51,7 +52,7 @@ var K8sMetricsServiceMonitorSpecTemplate = promv1.ServiceMonitorSpec{
},
TLSConfig: &promv1.TLSConfig{
SafeTLSConfig: promv1.SafeTLSConfig{
InsecureSkipVerify: true,
InsecureSkipVerify: ptr.To(true),
},
},
Params: params,
Expand Down

0 comments on commit 8d07442

Please sign in to comment.