Skip to content

Commit 464202c

Browse files
Merge pull request #609 from openshift-bot/synchronize-upstream
NO-ISSUE: Synchronize From Upstream Repositories
2 parents e7e63bc + 057d3c3 commit 464202c

File tree

63 files changed

+152
-180
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

63 files changed

+152
-180
lines changed

staging/operator-lifecycle-manager/OWNERS

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,7 @@ approvers:
99
- grokspawn
1010
- joelanford
1111
- tmshort
12+
- ncdc
1213
# review == this code is good /lgtm
1314
reviewers:
1415
- kevinrizza
@@ -26,3 +27,4 @@ reviewers:
2627
- dtfranz
2728
- tmshort
2829
- stevekuznetsov
30+
- ncdc

staging/operator-lifecycle-manager/pkg/controller/registry/reconciler/grpc.go

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,7 @@ import (
77
"strings"
88
"time"
99

10+
"github.com/google/go-cmp/cmp"
1011
"github.com/operator-framework/operator-lifecycle-manager/pkg/controller/install"
1112
"github.com/pkg/errors"
1213
"github.com/sirupsen/logrus"
@@ -202,10 +203,14 @@ func (c *GrpcRegistryReconciler) currentPodsWithCorrectImageAndSpec(logger *logr
202203
newPod := source.Pod(serviceAccount)
203204
for _, p := range pods {
204205
images, hash := correctImages(source, p), podHashMatch(p, newPod)
205-
logger.WithFields(logrus.Fields{
206+
logger = logger.WithFields(logrus.Fields{
206207
"current-pod.namespace": p.Namespace, "current-pod.name": p.Name,
207208
"correctImages": images, "correctHash": hash,
208-
}).Info("evaluating current pod")
209+
})
210+
logger.Info("evaluating current pod")
211+
if !hash {
212+
logger.Infof("pod spec diff: %s", cmp.Diff(p.Spec, newPod.Spec))
213+
}
209214
if correctImages(source, p) && podHashMatch(p, newPod) {
210215
found = append(found, p)
211216
}

staging/operator-registry/alpha/action/init.go

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,6 @@ package action
33
import (
44
"fmt"
55
"io"
6-
"io/ioutil"
76

87
"github.com/h2non/filetype"
98

@@ -25,15 +24,15 @@ func (i Init) Run() (*declcfg.Package, error) {
2524
DefaultChannel: i.DefaultChannel,
2625
}
2726
if i.DescriptionReader != nil {
28-
descriptionData, err := ioutil.ReadAll(i.DescriptionReader)
27+
descriptionData, err := io.ReadAll(i.DescriptionReader)
2928
if err != nil {
3029
return nil, fmt.Errorf("read description: %v", err)
3130
}
3231
pkg.Description = string(descriptionData)
3332
}
3433

3534
if i.IconReader != nil {
36-
iconData, err := ioutil.ReadAll(i.IconReader)
35+
iconData, err := io.ReadAll(i.IconReader)
3736
if err != nil {
3837
return nil, fmt.Errorf("read icon: %v", err)
3938
}

staging/operator-registry/alpha/action/migrate.go

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,6 @@ package action
33
import (
44
"context"
55
"fmt"
6-
"io/ioutil"
76
"os"
87

98
"github.com/operator-framework/operator-registry/alpha/declcfg"
@@ -20,7 +19,7 @@ type Migrate struct {
2019
}
2120

2221
func (m Migrate) Run(ctx context.Context) error {
23-
entries, err := ioutil.ReadDir(m.OutputDir)
22+
entries, err := os.ReadDir(m.OutputDir)
2423
if err != nil && !os.IsNotExist(err) {
2524
return err
2625
}

staging/operator-registry/alpha/action/render.go

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@ import (
66
"encoding/json"
77
"errors"
88
"fmt"
9-
"io/ioutil"
9+
"io"
1010
"os"
1111
"path/filepath"
1212
"sort"
@@ -60,7 +60,7 @@ type Render struct {
6060

6161
func nullLogger() *logrus.Entry {
6262
logger := logrus.New()
63-
logger.SetOutput(ioutil.Discard)
63+
logger.SetOutput(io.Discard)
6464
return logrus.NewEntry(logger)
6565
}
6666

@@ -155,7 +155,7 @@ func (r Render) imageToDeclcfg(ctx context.Context, imageRef string) (*declcfg.D
155155
if err != nil {
156156
return nil, err
157157
}
158-
tmpDir, err := ioutil.TempDir("", "render-unpack-")
158+
tmpDir, err := os.MkdirTemp("", "render-unpack-")
159159
if err != nil {
160160
return nil, err
161161
}

staging/operator-registry/cmd/opm/alpha/bundle/unpack.go

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,6 @@ import (
44
"context"
55
"crypto/x509"
66
"fmt"
7-
"io/ioutil"
87
"os"
98
"path/filepath"
109

@@ -99,7 +98,7 @@ func unpackBundle(cmd *cobra.Command, args []string) error {
9998
}
10099
if rootCA != "" {
101100
rootCAs := x509.NewCertPool()
102-
certs, err := ioutil.ReadFile(rootCA)
101+
certs, err := os.ReadFile(rootCA)
103102
if err != nil {
104103
return err
105104
}
@@ -129,7 +128,7 @@ func unpackBundle(cmd *cobra.Command, args []string) error {
129128
return err
130129
}
131130

132-
dir, err := ioutil.TempDir("", "bundle-")
131+
dir, err := os.MkdirTemp("", "bundle-")
133132
if err != nil {
134133
return err
135134
}

staging/operator-registry/cmd/opm/alpha/bundle/validate.go

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,6 @@ package bundle
22

33
import (
44
"fmt"
5-
"io/ioutil"
65
"os"
76
"path/filepath"
87

@@ -80,7 +79,7 @@ func validateFunc(cmd *cobra.Command, _ []string) error {
8079
}
8180
imageValidator := bundle.NewImageValidator(registry, logger, optional)
8281

83-
dir, err := ioutil.TempDir("", "bundle-")
82+
dir, err := os.MkdirTemp("", "bundle-")
8483
logger.Infof("Create a temp directory at %s", dir)
8584
if err != nil {
8685
return err

staging/operator-registry/cmd/opm/alpha/template/basic.go

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,6 @@ package template
22

33
import (
44
"io"
5-
"io/ioutil"
65
"log"
76
"os"
87

@@ -50,7 +49,7 @@ When FILE is '-' or not provided, the template is read from standard input`,
5049
// The bundle loading impl is somewhat verbose, even on the happy path,
5150
// so discard all logrus default logger logs. Any important failures will be
5251
// returned from template.Render and logged as fatal errors.
53-
logrus.SetOutput(ioutil.Discard)
52+
logrus.SetOutput(io.Discard)
5453

5554
reg, err := util.CreateCLIRegistry(cmd)
5655
if err != nil {

staging/operator-registry/cmd/opm/alpha/template/semver.go

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,6 @@ package template
33
import (
44
"fmt"
55
"io"
6-
"io/ioutil"
76
"log"
87
"os"
98

@@ -53,7 +52,7 @@ When FILE is '-' or not provided, the template is read from standard input`,
5352
// The bundle loading impl is somewhat verbose, even on the happy path,
5453
// so discard all logrus default logger logs. Any important failures will be
5554
// returned from template.Render and logged as fatal errors.
56-
logrus.SetOutput(ioutil.Discard)
55+
logrus.SetOutput(io.Discard)
5756

5857
reg, err := util.CreateCLIRegistry(cmd)
5958
if err != nil {

staging/operator-registry/cmd/opm/internal/util/util.go

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@ package util
22

33
import (
44
"errors"
5-
"io/ioutil"
5+
"io"
66
"os"
77

88
"github.com/operator-framework/operator-registry/pkg/image/containerdregistry"
@@ -69,6 +69,6 @@ func CreateCLIRegistry(cmd *cobra.Command) (*containerdregistry.Registry, error)
6969

7070
func nullLogger() *logrus.Entry {
7171
logger := logrus.New()
72-
logger.SetOutput(ioutil.Discard)
72+
logger.SetOutput(io.Discard)
7373
return logrus.NewEntry(logger)
7474
}

0 commit comments

Comments
 (0)