Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Use golang 1.19 #1021

Merged
merged 1 commit into from Sep 1, 2022
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
6 changes: 3 additions & 3 deletions .github/workflows/continuous-integration.yaml
Expand Up @@ -14,7 +14,7 @@ jobs:
- name: Set up Go
uses: actions/setup-go@v3
with:
go-version: 1.18
go-version: 1.19

- name: Check out code into the Go module directory
uses: actions/checkout@v3
Expand All @@ -35,15 +35,15 @@ jobs:
- name: Set up Go
uses: actions/setup-go@v3
with:
go-version: 1.18
go-version: 1.19
- name: Check out code into the Go module directory
uses: actions/checkout@v3

- name: Lint
uses: golangci/golangci-lint-action@v3
with:
args: -v
version: v1.45
version: v1.48

security:
name: Security
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/e2e.yaml
Expand Up @@ -24,7 +24,7 @@ jobs:
- name: Set up Go
uses: actions/setup-go@v3
with:
go-version: 1.18
go-version: 1.19

- name: Check out code into the Go module directory
uses: actions/checkout@v3
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/release.yaml
Expand Up @@ -10,7 +10,7 @@ jobs:
- name: Set up Go
uses: actions/setup-go@v3
with:
go-version: 1.18
go-version: 1.19

- uses: actions/checkout@v3

Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/scorecard.yaml
Expand Up @@ -21,7 +21,7 @@ jobs:
- name: Set up Go
uses: actions/setup-go@v3
with:
go-version: 1.18
go-version: 1.19

- name: Check out code into the Go module directory
uses: actions/checkout@v3
Expand Down
2 changes: 1 addition & 1 deletion Dockerfile
@@ -1,5 +1,5 @@
# Build the manager binary
FROM golang:1.18 as builder
FROM golang:1.19 as builder

WORKDIR /workspace
# Copy the Go Modules manifests
Expand Down
2 changes: 1 addition & 1 deletion cmd/otel-allocator/Dockerfile
@@ -1,5 +1,5 @@
# Build the target allocator binary
FROM golang:1.18 as builder
FROM golang:1.19 as builder

WORKDIR /app

Expand Down
4 changes: 2 additions & 2 deletions cmd/otel-allocator/config/config.go
Expand Up @@ -5,7 +5,7 @@ import (
"flag"
"fmt"
"io/fs"
"io/ioutil"
"os"
"path/filepath"
"time"

Expand Down Expand Up @@ -59,7 +59,7 @@ func Load(file string) (Config, error) {

func unmarshal(cfg *Config, configFile string) error {

yamlFile, err := ioutil.ReadFile(configFile)
yamlFile, err := os.ReadFile(configFile)
if err != nil {
return err
}
Expand Down
2 changes: 1 addition & 1 deletion cmd/otel-allocator/go.mod
@@ -1,6 +1,6 @@
module github.com/open-telemetry/opentelemetry-operator/cmd/otel-allocator

go 1.18
go 1.19

require (
github.com/fsnotify/fsnotify v1.5.1
Expand Down
2 changes: 1 addition & 1 deletion go.mod
@@ -1,6 +1,6 @@
module github.com/open-telemetry/opentelemetry-operator

go 1.18
go 1.19

retract v1.51.0

Expand Down
6 changes: 3 additions & 3 deletions pkg/collector/adapters/config_validate.go
Expand Up @@ -18,9 +18,9 @@ import (
"github.com/go-logr/logr"
)

//Following Otel Doc: Configuring a receiver does not enable it. The receivers are enabled via pipelines within the service section.
//GetEnabledReceivers returns all enabled receivers as a true flag set. If it can't find any receiver, it will return a nil interface.
func GetEnabledReceivers(logger logr.Logger, config map[interface{}]interface{}) map[interface{}]bool {
// Following Otel Doc: Configuring a receiver does not enable it. The receivers are enabled via pipelines within the service section.
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

lint was complaining that there was no space

// GetEnabledReceivers returns all enabled receivers as a true flag set. If it can't find any receiver, it will return a nil interface.
func GetEnabledReceivers(_ logr.Logger, config map[interface{}]interface{}) map[interface{}]bool {
cfgReceivers, ok := config["receivers"]
if !ok {
return nil
Expand Down
4 changes: 2 additions & 2 deletions pkg/collector/reconcile/horizontalpodautoscaler_test.go
Expand Up @@ -17,7 +17,7 @@ package reconcile
import (
"context"
"fmt"
"io/ioutil"
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

io/ioutil is deprecated

"os"
"testing"

"github.com/stretchr/testify/assert"
Expand Down Expand Up @@ -102,7 +102,7 @@ func TestExpectedHPA(t *testing.T) {
}

func paramsWithHPA(autoscalingVersion autodetect.AutoscalingVersion) Params {
configYAML, err := ioutil.ReadFile("../testdata/test.yaml")
configYAML, err := os.ReadFile("../testdata/test.yaml")
if err != nil {
fmt.Printf("Error getting yaml file: %v", err)
}
Expand Down
7 changes: 3 additions & 4 deletions pkg/collector/reconcile/suite_test.go
Expand Up @@ -18,7 +18,6 @@ import (
"context"
"crypto/tls"
"fmt"
"io/ioutil"
"net"
"os"
"path/filepath"
Expand Down Expand Up @@ -164,7 +163,7 @@ func TestMain(m *testing.M) {

func params() Params {
replicas := int32(2)
configYAML, err := ioutil.ReadFile("../testdata/test.yaml")
configYAML, err := os.ReadFile("../testdata/test.yaml")
if err != nil {
fmt.Printf("Error getting yaml file: %v", err)
}
Expand Down Expand Up @@ -208,9 +207,9 @@ func newParams(taContainerImage string, file string) (Params, error) {
var err error

if file == "" {
configYAML, err = ioutil.ReadFile("../testdata/test.yaml")
configYAML, err = os.ReadFile("../testdata/test.yaml")
} else {
configYAML, err = ioutil.ReadFile(file)
configYAML, err = os.ReadFile(file)
}
if err != nil {
return Params{}, fmt.Errorf("Error getting yaml file: %w", err)
Expand Down
2 changes: 1 addition & 1 deletion pkg/collector/upgrade/noop.go
Expand Up @@ -20,7 +20,7 @@ import (
"github.com/open-telemetry/opentelemetry-operator/apis/v1alpha1"
)

//nolint unused
// nolint unused
func noop(cl client.Client, otelcol *v1alpha1.OpenTelemetryCollector) (*v1alpha1.OpenTelemetryCollector, error) {
return otelcol, nil
}
2 changes: 1 addition & 1 deletion pkg/targetallocator/serviceaccount.go
Expand Up @@ -31,7 +31,7 @@ func ServiceAccountName(instance v1alpha1.OpenTelemetryCollector) string {
return instance.Spec.TargetAllocator.ServiceAccount
}

//ServiceAccount returns the service account for the given instance.
// ServiceAccount returns the service account for the given instance.
func ServiceAccount(otelcol v1alpha1.OpenTelemetryCollector) corev1.ServiceAccount {
labels := Labels(otelcol)
labels["app.kubernetes.io/name"] = naming.TargetAllocatorServiceAccount(otelcol)
Expand Down