Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ import (

"github.com/stretchr/testify/assert"
"go.uber.org/zap"
"gopkg.in/yaml.v2"
"gopkg.in/yaml.v3"
)

func TestRunOnConfigChange(t *testing.T) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ import (

"github.com/pkg/errors"
"github.com/vrischmann/envconfig"
"gopkg.in/yaml.v2"
"gopkg.in/yaml.v3"
corev1 "k8s.io/api/core/v1"
"k8s.io/apimachinery/pkg/api/resource"
)
Expand Down
Original file line number Diff line number Diff line change
@@ -1,9 +1,10 @@
package config

import (
"gopkg.in/yaml.v2"
"os"
"path/filepath"

"gopkg.in/yaml.v3"
)

type Config struct {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ import (
"github.com/kyma-project/serverless/components/buildless-serverless/internal/controller/fsm"
"github.com/kyma-project/serverless/components/buildless-serverless/internal/controller/metrics"
"github.com/pkg/errors"
"gopkg.in/yaml.v2"
"gopkg.in/yaml.v3"
appsv1 "k8s.io/api/apps/v1"
corev1 "k8s.io/api/core/v1"
metav1 "k8s.io/apimachinery/pkg/apis/meta/v1"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ import (
"github.com/kyma-project/serverless/components/buildless-serverless/internal/controller/resources"
"github.com/stretchr/testify/require"
"go.uber.org/zap"
"gopkg.in/yaml.v2"
"gopkg.in/yaml.v3"
appsv1 "k8s.io/api/apps/v1"
corev1 "k8s.io/api/core/v1"
metav1 "k8s.io/apimachinery/pkg/apis/meta/v1"
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
package runtime

import (
"bytes"
"encoding/base64"
"encoding/json"
"fmt"
Expand All @@ -10,7 +11,7 @@
"github.com/kyma-project/serverless/components/buildless-serverless/internal/controller/resources"
"github.com/kyma-project/serverless/components/buildless-serverless/internal/endpoint/types"
"github.com/pkg/errors"
"go.yaml.in/yaml/v2"
"go.yaml.in/yaml/v3"
)

func BuildResources(functionConfig *config.FunctionConfig, f *v1alpha2.Function, appName string) ([]types.FileResponse, error) {
Expand Down Expand Up @@ -106,10 +107,14 @@
return nil, err
}

yamlBytes, err := yaml.Marshal(jsonObj)
yamlBytes := bytes.Buffer{}
e := yaml.NewEncoder(&yamlBytes)
e.SetIndent(2)
e.Encode(jsonObj)

Check failure on line 113 in components/buildless-serverless/internal/endpoint/runtime/resources.go

View workflow job for this annotation

GitHub Actions / buildless-serverless-lint

Error return value of `e.Encode` is not checked (errcheck)
err = e.Encode(jsonObj)
if err != nil {
return nil, err
}

return yamlBytes, nil
return yamlBytes.Bytes(), nil
}
2 changes: 1 addition & 1 deletion components/operator/internal/config/file_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ import (

"github.com/stretchr/testify/assert"
"go.uber.org/zap"
"gopkg.in/yaml.v2"
"gopkg.in/yaml.v3"
)

func TestRunOnConfigChange(t *testing.T) {
Expand Down
3 changes: 2 additions & 1 deletion components/operator/internal/config/log_config.go
Original file line number Diff line number Diff line change
@@ -1,9 +1,10 @@
package config

import (
"gopkg.in/yaml.v2"
"os"
"path/filepath"

"gopkg.in/yaml.v3"
)

type Config struct {
Expand Down
2 changes: 1 addition & 1 deletion components/serverless/internal/config/file_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ import (

"github.com/stretchr/testify/assert"
"go.uber.org/zap"
"gopkg.in/yaml.v2"
"gopkg.in/yaml.v3"
)

func TestRunOnConfigChange(t *testing.T) {
Expand Down
3 changes: 2 additions & 1 deletion components/serverless/internal/config/log.go
Original file line number Diff line number Diff line change
@@ -1,9 +1,10 @@
package config

import (
"gopkg.in/yaml.v2"
"os"
"path/filepath"

"gopkg.in/yaml.v3"
)

type Config struct {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ import (

"github.com/pkg/errors"
"github.com/vrischmann/envconfig"
"gopkg.in/yaml.v2"
"gopkg.in/yaml.v3"
corev1 "k8s.io/api/core/v1"
"k8s.io/apimachinery/pkg/api/resource"
)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ import (

serverlessv1alpha2 "github.com/kyma-project/serverless/components/serverless/pkg/apis/serverless/v1alpha2"
"github.com/pkg/errors"
"gopkg.in/yaml.v2"
"gopkg.in/yaml.v3"
appsv1 "k8s.io/api/apps/v1"
corev1 "k8s.io/api/core/v1"
k8serrors "k8s.io/apimachinery/pkg/api/errors"
Expand Down
2 changes: 1 addition & 1 deletion components/serverless/internal/webhook/webhook_config.go
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ import (

"github.com/kyma-project/serverless/components/serverless/pkg/apis/serverless/v1alpha2"
"github.com/pkg/errors"
"gopkg.in/yaml.v2"
"gopkg.in/yaml.v3"
)

type FunctionResources struct {
Expand Down
7 changes: 3 additions & 4 deletions go.mod
Original file line number Diff line number Diff line change
Expand Up @@ -21,16 +21,16 @@ require (
github.com/onsi/gomega v1.38.3
github.com/pkg/errors v0.9.1
github.com/prometheus/client_golang v1.23.2
github.com/prometheus/client_model v0.6.2
github.com/sirupsen/logrus v1.9.3
github.com/spf13/pflag v1.0.10
github.com/stretchr/testify v1.11.1
github.com/vrischmann/envconfig v1.4.1
go.uber.org/zap v1.27.1
go.yaml.in/yaml/v2 v2.4.3
go.yaml.in/yaml/v3 v3.0.4
golang.org/x/crypto v0.46.0
golang.org/x/sync v0.19.0
golang.org/x/time v0.14.0
gopkg.in/yaml.v2 v2.4.0
gopkg.in/yaml.v3 v3.0.1
helm.sh/helm/v3 v3.18.6
k8s.io/api v0.33.7
Expand Down Expand Up @@ -123,7 +123,6 @@ require (
github.com/peterbourgon/diskv v2.0.1+incompatible // indirect
github.com/pjbgf/sha1cd v0.3.2 // indirect
github.com/pmezard/go-difflib v1.0.1-0.20181226105442-5d4384ee4fb2 // indirect
github.com/prometheus/client_model v0.6.2 // indirect
github.com/prometheus/common v0.66.1 // indirect
github.com/prometheus/procfs v0.16.1 // indirect
github.com/rivo/uniseg v0.2.0 // indirect
Expand All @@ -140,7 +139,7 @@ require (
github.com/xanzy/ssh-agent v0.3.3 // indirect
github.com/xlab/treeprint v1.2.0 // indirect
go.uber.org/multierr v1.11.0 // indirect
go.yaml.in/yaml/v3 v3.0.4 // indirect
go.yaml.in/yaml/v2 v2.4.3 // indirect
golang.org/x/mod v0.30.0 // indirect
golang.org/x/net v0.47.0 // indirect
golang.org/x/oauth2 v0.30.0 // indirect
Expand Down
Loading