Skip to content

Commit a4a306a

Browse files
Jonathan S. Katzjkatz
authored andcommitted
Move YAML parser to kubernetes-sig/yaml
1 parent 9195b97 commit a4a306a

File tree

5 files changed

+10
-23
lines changed

5 files changed

+10
-23
lines changed

Gopkg.lock

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

Gopkg.toml

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -47,10 +47,6 @@ required = [
4747
branch = "master"
4848
name = "golang.org/x/crypto"
4949

50-
[[constraint]]
51-
name = "gopkg.in/yaml.v2"
52-
version = "2.2.8"
53-
5450
[[constraint]]
5551
name = "k8s.io/api"
5652
version = "0.17.4"

apiserver/loadservice/loadconfig.go

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,8 +18,9 @@ limitations under the License.
1818
import (
1919
"bytes"
2020
"errors"
21+
2122
log "github.com/sirupsen/logrus"
22-
"gopkg.in/yaml.v2"
23+
"sigs.k8s.io/yaml"
2324
)
2425

2526
type LoadConfig struct {

config/pgoconfig.go

Lines changed: 3 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -26,11 +26,13 @@ import (
2626

2727
crv1 "github.com/crunchydata/postgres-operator/apis/crunchydata.com/v1"
2828
"github.com/crunchydata/postgres-operator/kubeapi"
29+
2930
log "github.com/sirupsen/logrus"
30-
"gopkg.in/yaml.v2"
3131
v1 "k8s.io/api/core/v1"
32+
"k8s.io/apimachinery/pkg/api/resource"
3233
"k8s.io/apimachinery/pkg/util/validation"
3334
"k8s.io/client-go/kubernetes"
35+
"sigs.k8s.io/yaml"
3436
)
3537

3638
const CustomConfigMapName = "pgo-config"
@@ -393,20 +395,6 @@ func (c *PgoConfig) Validate() error {
393395
return err
394396
}
395397

396-
func (c *PgoConfig) GetConf() *PgoConfig {
397-
398-
yamlFile, err := ioutil.ReadFile(CONFIG_PATH)
399-
if err != nil {
400-
log.Printf("yamlFile.Get err #%v ", err)
401-
}
402-
err = yaml.Unmarshal(yamlFile, c)
403-
if err != nil {
404-
log.Fatalf("Unmarshal: %v", err)
405-
}
406-
407-
return c
408-
}
409-
410398
// GetPodAntiAffinitySpec accepts possible user-defined values for what the
411399
// pod anti-affinity spec should be, which include rules for:
412400
// - PostgreSQL instances

pgo/cmd/config.go

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -18,11 +18,13 @@ package cmd
1818
import (
1919
"encoding/json"
2020
"fmt"
21+
"os"
22+
2123
msgs "github.com/crunchydata/postgres-operator/apiservermsgs"
2224
"github.com/crunchydata/postgres-operator/pgo/api"
25+
2326
log "github.com/sirupsen/logrus"
24-
"gopkg.in/yaml.v2"
25-
"os"
27+
"sigs.k8s.io/yaml"
2628
)
2729

2830
func showConfig(args []string, ns string) {

0 commit comments

Comments
 (0)