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
243 changes: 150 additions & 93 deletions go.mod

Large diffs are not rendered by default.

710 changes: 391 additions & 319 deletions go.sum

Large diffs are not rendered by default.

6 changes: 3 additions & 3 deletions pkg/discover/discover.go
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ import (

"github.com/jinzhu/copier"

gyaml "github.com/ghodss/yaml"
"sigs.k8s.io/yaml"

"github.com/openshift-knative/hack/pkg/action"
"github.com/openshift-knative/hack/pkg/konfluxgen"
Expand Down Expand Up @@ -285,7 +285,7 @@ func readYaml(path string, out any) error {
if err != nil {
return fmt.Errorf("failed to read %q: %w", path, err)
}
j, err := gyaml.YAMLToJSON(y)
j, err := yaml.YAMLToJSON(y)
if err != nil {
return fmt.Errorf("failed to convert %q to JSON: %w", path, err)
}
Expand All @@ -305,7 +305,7 @@ func writeYaml(path string, out any) error {
if err != nil {
return err
}
y, err := gyaml.JSONToYAML(j)
y, err := yaml.JSONToYAML(j)
if err != nil {
return err
}
Expand Down
2 changes: 1 addition & 1 deletion pkg/dockerfilegen/generator.go
Original file line number Diff line number Diff line change
Expand Up @@ -26,10 +26,10 @@ import (
"github.com/openshift-knative/hack/pkg/rhel"
"github.com/openshift-knative/hack/pkg/util"
"github.com/pkg/errors"
"golang.org/x/exp/slices"
"golang.org/x/mod/modfile"
"gopkg.in/yaml.v3"
"k8s.io/apimachinery/pkg/util/sets"
"slices"
)

const (
Expand Down
4 changes: 2 additions & 2 deletions pkg/k8sresource/meta.go
Original file line number Diff line number Diff line change
Expand Up @@ -5,8 +5,8 @@ import (
"fmt"
"os"

gyaml "github.com/ghodss/yaml"
metav1 "k8s.io/apimachinery/pkg/apis/meta/v1"
"sigs.k8s.io/yaml"
)

func Metadata(yamlFilePath string) (*metav1.PartialObjectMetadata, error) {
Expand All @@ -24,7 +24,7 @@ func unmarshalYaml[T interface{}](yamlFilePath string, target *T) error {
return fmt.Errorf("failed to read file: %w", err)
}

j, err := gyaml.YAMLToJSON(y)
j, err := yaml.YAMLToJSON(y)
if err != nil {
return fmt.Errorf("failed to convert yaml file to json: %w", err)
}
Expand Down
6 changes: 3 additions & 3 deletions pkg/konfluxgen/konfluxgen.go
Original file line number Diff line number Diff line change
Expand Up @@ -30,9 +30,9 @@ import (
"github.com/openshift-knative/hack/pkg/soversion"
"github.com/openshift-knative/hack/pkg/util"

gyaml "github.com/ghodss/yaml"
cioperatorapi "github.com/openshift/ci-tools/pkg/api"
operatorsv1alpha1 "github.com/operator-framework/api/pkg/operators/v1alpha1"
"sigs.k8s.io/yaml"
)

const (
Expand Down Expand Up @@ -724,7 +724,7 @@ func parseConfig(path string) (*cioperatorapi.ReleaseBuildConfiguration, error)
if err != nil {
return nil, fmt.Errorf("failed to read file %q: %w", path, err)
}
j, err := gyaml.YAMLToJSON(y)
j, err := yaml.YAMLToJSON(y)
if err != nil {
return nil, fmt.Errorf("failed to convert YAML to JSON: %w", err)
}
Expand Down Expand Up @@ -1251,7 +1251,7 @@ func loadClusterServiceVerion(path string) (*operatorsv1alpha1.ClusterServiceVer
if err != nil {
return nil, err
}
j, err := gyaml.YAMLToJSON(y)
j, err := yaml.YAMLToJSON(y)
if err != nil {
return nil, err
}
Expand Down
4 changes: 2 additions & 2 deletions pkg/prowcopy/prowcopy.go
Original file line number Diff line number Diff line change
Expand Up @@ -10,10 +10,10 @@ import (
"path/filepath"
"strings"

gyaml "github.com/ghodss/yaml"
cioperatorapi "github.com/openshift/ci-tools/pkg/api"
"golang.org/x/sync/errgroup"
"k8s.io/utils/pointer"
"sigs.k8s.io/yaml"

"github.com/openshift-knative/hack/pkg/prowgen"
)
Expand Down Expand Up @@ -183,7 +183,7 @@ func getJobConfig(match string, c Config) (*prowgen.ReleaseBuildConfiguration, e
if err != nil {
return nil, err
}
j, err := gyaml.YAMLToJSON(y)
j, err := yaml.YAMLToJSON(y)
if err != nil {
return nil, err
}
Expand Down
7 changes: 3 additions & 4 deletions pkg/prowgen/prowgen.go
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,6 @@ import (
"sigs.k8s.io/yaml"

"github.com/coreos/go-semver/semver"
gyaml "github.com/ghodss/yaml"
"golang.org/x/sync/errgroup"
prowapi "sigs.k8s.io/prow/pkg/apis/prowjobs/v1"
prowconfig "sigs.k8s.io/prow/pkg/config"
Expand Down Expand Up @@ -201,8 +200,8 @@ func LoadConfig(path string) (*Config, error) {
return UnmarshalConfig(y)
}

func UnmarshalConfig(yaml []byte) (*Config, error) {
j, err := gyaml.YAMLToJSON(yaml)
func UnmarshalConfig(rawYaml []byte) (*Config, error) {
j, err := yaml.YAMLToJSON(rawYaml)
if err != nil {
return nil, err
}
Expand Down Expand Up @@ -520,7 +519,7 @@ func GetJobConfig(match string) (*prowconfig.JobConfig, error) {
if err != nil {
return nil, err
}
j, err := gyaml.YAMLToJSON(y)
j, err := yaml.YAMLToJSON(y)
if err != nil {
return nil, err
}
Expand Down
7 changes: 5 additions & 2 deletions pkg/testselect/testselect.go
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
package testselect

import (
"bytes"
"context"
"encoding/json"
"flag"
Expand All @@ -11,7 +12,7 @@ import (
"strings"

"github.com/openshift-knative/hack/pkg/prowgen"
"gopkg.in/yaml.v2"
"gopkg.in/yaml.v3"
"sigs.k8s.io/prow/pkg/clonerefs"
)

Expand Down Expand Up @@ -60,7 +61,9 @@ func Main() {
}

testSuites := new(TestSuites)
if err := yaml.UnmarshalStrict(inTs, testSuites); err != nil {
dec := yaml.NewDecoder(bytes.NewReader(inTs))
dec.KnownFields(true)
if err := dec.Decode(testSuites); err != nil {
log.Fatalln("Unmarshal test suite mappings", err)
}

Expand Down
Loading