Skip to content

Commit

Permalink
Update GO to 1.19 and format code
Browse files Browse the repository at this point in the history
  • Loading branch information
baoy1 committed Oct 11, 2022
1 parent 52971c6 commit 5e8339f
Show file tree
Hide file tree
Showing 9 changed files with 26 additions and 4 deletions.
11 changes: 11 additions & 0 deletions .github/containerscan/allowedlist.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
general:
vulnerabilities:
# list of CVEs that are currently unfixed
- CVE-2022-27664
bestPracticeViolations:
# list of best practies violatied that needs a fix
- CIS-DI-0001
- DKL-DI-0006
- CIS-DI-0005
- CIS-DI-0006

4 changes: 2 additions & 2 deletions .github/workflows/actions.yml
Original file line number Diff line number Diff line change
Expand Up @@ -58,10 +58,10 @@ jobs:
name: Image Scanner
runs-on: ubuntu-latest
steps:
- name: Set up Go 1.18+
- name: Set up Go 1.19+
uses: actions/setup-go@v2
with:
go-version: ^1.18
go-version: ^1.19
id: go
- name: Checkout the code
uses: actions/checkout@v2
Expand Down
2 changes: 1 addition & 1 deletion go.mod
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
module github.com/dell/csm-metrics-powerscale

go 1.18
go 1.19

require (
github.com/dell/goisilon v1.9.0
Expand Down
1 change: 1 addition & 0 deletions internal/k8s/leader_elector.go
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,7 @@ import (
)

// LeaderElectorGetter is an interface for initialize and check elected leader
//
//go:generate mockgen -destination=mocks/leader_elector_getter_mocks.go -package=mocks github.com/dell/csm-metrics-powerscale/internal/k8s LeaderElectorGetter
type LeaderElectorGetter interface {
InitLeaderElection(string, string) error
Expand Down
1 change: 1 addition & 0 deletions internal/k8s/storageclass_finder.go
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,7 @@ import (
)

// StorageClassGetter is an interface for getting a list of storage class information
//
//go:generate mockgen -destination=mocks/storage_class_getter_mocks.go -package=mocks github.com/dell/csm-metrics-powerscale/internal/k8s StorageClassGetter
type StorageClassGetter interface {
GetStorageClasses() (*v1.StorageClassList, error)
Expand Down
1 change: 1 addition & 0 deletions internal/k8s/volume_finder.go
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,7 @@ import (
)

// VolumeGetter is an interface for getting a list of persistent volume information
//
//go:generate mockgen -destination=mocks/volume_getter_mocks.go -package=mocks github.com/dell/csm-metrics-powerscale/internal/k8s VolumeGetter
type VolumeGetter interface {
GetPersistentVolumes() (*corev1.PersistentVolumeList, error)
Expand Down
4 changes: 3 additions & 1 deletion internal/service/metrics.go
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,7 @@ import (
)

// MetricsRecorder supports recording volume and cluster metric
//
//go:generate mockgen -destination=mocks/metrics_mocks.go -package=mocks github.com/dell/csm-metrics-powerscale/internal/service MetricsRecorder,AsyncMetricCreator
type MetricsRecorder interface {
RecordVolumeQuota(ctx context.Context, meta interface{}, metric *VolumeQuotaMetricsRecord) error
Expand All @@ -27,9 +28,10 @@ type MetricsRecorder interface {
RecordClusterPerformanceStatsMetrics(ctx context.Context, metric *ClusterPerformanceStatsMetricsRecord) error
}

// AsyncMetricCreator to create AsyncInt64/AsyncFloat64 InstrumentProvider
//
//go:generate mockgen -destination=mocks/asyncint64mock/instrument_asyncint64_provider_mocks.go -package=asyncint64mock go.opentelemetry.io/otel/metric/instrument/asyncint64 InstrumentProvider
//go:generate mockgen -destination=mocks/asyncfloat64mock/instrument_asyncfloat64_provider_mocks.go -package=asyncfloat64mock go.opentelemetry.io/otel/metric/instrument/asyncfloat64 InstrumentProvider
// AsyncMetricCreator to create AsyncInt64/AsyncFloat64 InstrumentProvider
type AsyncMetricCreator interface {
AsyncInt64() asyncint64.InstrumentProvider
AsyncFloat64() asyncfloat64.InstrumentProvider
Expand Down
5 changes: 5 additions & 0 deletions internal/service/service.go
Original file line number Diff line number Diff line change
Expand Up @@ -33,6 +33,7 @@ const (
)

// Service contains operations that would be used to interact with a PowerScale system
//
//go:generate mockgen -destination=mocks/service_mocks.go -package=mocks github.com/dell/csm-metrics-powerscale/internal/service Service
type Service interface {
ExportQuotaMetrics(context.Context)
Expand All @@ -41,6 +42,7 @@ type Service interface {
}

// PowerScaleClient contains operations for accessing the PowerScale API
//
//go:generate mockgen -destination=mocks/powerscale_client_mocks.go -package=mocks github.com/dell/csm-metrics-powerscale/internal/service PowerScaleClient
type PowerScaleClient interface {
GetFloatStatistics(ctx context.Context, keys []string) (goisilon.FloatStats, error)
Expand All @@ -60,18 +62,21 @@ type PowerScaleService struct {
}

// VolumeFinder is used to find volume information in kubernetes
//
//go:generate mockgen -destination=mocks/volume_finder_mocks.go -package=mocks github.com/dell/csm-metrics-powerscale/internal/service VolumeFinder
type VolumeFinder interface {
GetPersistentVolumes(context.Context) ([]k8s.VolumeInfo, error)
}

// StorageClassFinder is used to find storage classes in kubernetes
//
//go:generate mockgen -destination=mocks/storage_class_finder_mocks.go -package=mocks github.com/dell/csm-metrics-powerscale/internal/service StorageClassFinder
type StorageClassFinder interface {
GetStorageClasses(context.Context) ([]v1.StorageClass, error)
}

// LeaderElector will elect a leader
//
//go:generate mockgen -destination=mocks/leader_elector_mocks.go -package=mocks github.com/dell/csm-metrics-powerscale/internal/service LeaderElector
type LeaderElector interface {
InitLeaderElection(string, string) error
Expand Down
1 change: 1 addition & 0 deletions opentelemetry/exporters/types.go
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@ package otlexporters
import "go.opentelemetry.io/otel/exporters/otlp/otlpmetric/otlpmetricgrpc"

// Otlexporter is an interface for all OpenTelemetry exporters
//
//go:generate mockgen -destination=mocks/otlexporters_mocks.go -package=exportermocks github.com/dell/csm-metrics-powerscale/opentelemetry/exporters Otlexporter
type Otlexporter interface {
InitExporter(...otlpmetricgrpc.Option) error
Expand Down

0 comments on commit 5e8339f

Please sign in to comment.