Skip to content
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.

Commit a696a50

Browse files
authoredFeb 22, 2021
Merge branch 'master' into patch-1
2 parents df69242 + 7c76adf commit a696a50

File tree

12 files changed

+422
-45
lines changed

12 files changed

+422
-45
lines changed
 

‎README.md

+12-3
Original file line numberDiff line numberDiff line change
@@ -23,8 +23,9 @@ And libraries:
2323
* `pkg/lib` - providing external interfaces for interacting with this project as an api that defines a set of standards for operator bundles and indexes.
2424
* `pkg/containertools` - providing an interface to interact with and shell out to common container tooling binaries (if installed on the environment)
2525

26-
# Manifest format
26+
**NOTE:** The purpose of `opm` tool is to help who needs to manage index catalogues for OLM instances. However, if you are looking for a tool to help you to integrate your operator project with OLM then you should use [Operator-SDK](https://github.com/operator-framework/operator-sdk).
2727

28+
# Manifest format
2829

2930
We refer to a directory of files with one ClusterServiceVersion as a "bundle". A bundle typically includes a ClusterServiceVersion and the CRDs that define the owned APIs of the CSV in its manifest directory, though additional objects may be included. It also includes an annotations file in its metadata folder which defines some higher level aggregate data that helps to describe the format and package information about how the bundle should be added into an index of bundles.
3031

@@ -46,7 +47,7 @@ When loading manifests into the database, the following invariants are validated
4647

4748
Bundle directories are identified solely by the fact that they contain a ClusterServiceVersion, which provides an amount of freedom for layout of manifests.
4849

49-
Check out the [operator bundle design](docs/design/operator-bundle.md) for more detail on the bundle format.
50+
Check out the [operator bundle design](docs/design/operator-bundle.md) for more detail on the bundle format.
5051

5152
# Bundle images
5253

@@ -65,6 +66,8 @@ podman push quay.io/my-container-registry-namespace/my-manifest-bundle:latest
6566

6667
Of course, this build step can be done with any other OCI spec container tools like `docker`, `buildah`, `libpod`, etc.
6768

69+
Note that you do not need to create your bundle manually. [Operator-SDK](https://github.com/operator-framework/operator-sdk) provide features and helpers to build, to update, to validate and to test bundles for projects which follows the SDK layout or not. For more information check its documentations over [Integration with OLM](https://sdk.operatorframework.io/docs/olm-integration)
70+
6871
# Building an index of Operators using `opm`
6972

7073
Now that you have published the container image containing your manifests, how do you actually make that bundle available to other users' Kubernetes clusters so that the Operator Lifecycle Manager can install the operator? This is where the meat of the `operator-registry` project comes in. OLM has the concept of [CatalogSources](https://operator-framework.github.io/olm-book/docs/glossary.html#catalogsources) which define a reference to what packages are available to install onto a cluster. To make your bundle available, you can add the bundle to a container image which the CatalogSource points to. This image contains a database of pointers to bundle images that OLM can pull and extract the manifests from in order to install an operator. So, to make your operator available to OLM, you can generate an index image via opm with your bundle reference included:
@@ -146,7 +149,13 @@ spec:
146149

147150
# Using the catalog locally
148151

149-
[grpcurl](https://github.com/fullstorydev/grpcurl) is a useful tool for interacting with the example catalog server.
152+
After starting a catalog locally:
153+
154+
```sh
155+
$ docker run --rm -p 50051:50051 <index image>
156+
```
157+
158+
[grpcurl](https://github.com/fullstorydev/grpcurl) is a useful tool for interacting with the api:
150159

151160
```sh
152161
$ grpcurl -plaintext localhost:50051 list api.Registry

‎cmd/opm/alpha/bundle/cmd.go

+2
Original file line numberDiff line numberDiff line change
@@ -15,5 +15,7 @@ func NewCmd() *cobra.Command {
1515
runCmd.AddCommand(newBundleBuildCmd())
1616
runCmd.AddCommand(newBundleValidateCmd())
1717
runCmd.AddCommand(extractCmd)
18+
runCmd.AddCommand(newBundleUnpackCmd())
19+
1820
return runCmd
1921
}

‎cmd/opm/alpha/bundle/unpack.go

+161
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,161 @@
1+
package bundle
2+
3+
import (
4+
"context"
5+
"crypto/x509"
6+
"fmt"
7+
"io/ioutil"
8+
"os"
9+
"path/filepath"
10+
11+
dircopy "github.com/otiai10/copy"
12+
"github.com/sirupsen/logrus"
13+
"github.com/spf13/cobra"
14+
15+
"github.com/operator-framework/operator-registry/pkg/image"
16+
"github.com/operator-framework/operator-registry/pkg/image/containerdregistry"
17+
"github.com/operator-framework/operator-registry/pkg/lib/bundle"
18+
)
19+
20+
func newBundleUnpackCmd() *cobra.Command {
21+
unpack := &cobra.Command{
22+
Use: "unpack BUNDLE_NAME[:TAG|@DIGEST]",
23+
Short: "Unpacks the content of an operator bundle",
24+
Long: "Unpacks the content of an operator bundle into a directory",
25+
Args: func(cmd *cobra.Command, args []string) error {
26+
return cobra.ExactArgs(1)(cmd, args)
27+
},
28+
RunE: unpackBundle,
29+
}
30+
unpack.Flags().BoolP("debug", "d", false, "enable debug log output")
31+
unpack.Flags().BoolP("skip-tls", "s", false, "disable TLS verification")
32+
unpack.Flags().BoolP("skip-validation", "v", false, "disable bundle validation")
33+
unpack.Flags().StringP("root-ca", "c", "", "file path of a root CA to use when communicating with image registries")
34+
unpack.Flags().StringP("out", "o", "./", "directory in which to unpack operator bundle content")
35+
36+
return unpack
37+
}
38+
39+
func unpackBundle(cmd *cobra.Command, args []string) error {
40+
debug, err := cmd.Flags().GetBool("debug")
41+
if err != nil {
42+
return err
43+
}
44+
45+
logger := logrus.WithField("cmd", "unpack")
46+
if debug {
47+
logger.Logger.SetLevel(logrus.DebugLevel)
48+
}
49+
50+
var out string
51+
out, err = cmd.Flags().GetString("out")
52+
if err != nil {
53+
return err
54+
}
55+
56+
if info, err := os.Stat(out); err != nil {
57+
if os.IsNotExist(err) {
58+
err = os.MkdirAll(out, 0755)
59+
}
60+
if err != nil {
61+
return err
62+
}
63+
} else {
64+
if info == nil {
65+
return fmt.Errorf("failed to get output directory info")
66+
}
67+
if !info.IsDir() {
68+
return fmt.Errorf("out %s is not a directory", out)
69+
}
70+
}
71+
72+
var (
73+
registryOpts []containerdregistry.RegistryOption
74+
skipTLS bool
75+
)
76+
skipTLS, err = cmd.Flags().GetBool("skip-tls")
77+
if err != nil {
78+
return err
79+
}
80+
registryOpts = append(registryOpts, containerdregistry.SkipTLS(skipTLS))
81+
82+
var skipValidation bool
83+
skipValidation, err = cmd.Flags().GetBool("skip-validation")
84+
if err != nil {
85+
return err
86+
}
87+
88+
var rootCA string
89+
rootCA, err = cmd.Flags().GetString("root-ca")
90+
if err != nil {
91+
return err
92+
}
93+
if rootCA != "" {
94+
rootCAs := x509.NewCertPool()
95+
certs, err := ioutil.ReadFile(rootCA)
96+
if err != nil {
97+
return err
98+
}
99+
100+
if !rootCAs.AppendCertsFromPEM(certs) {
101+
return fmt.Errorf("failed to fetch root CA from %s", rootCA)
102+
}
103+
104+
registryOpts = append(registryOpts, containerdregistry.WithRootCAs(rootCAs))
105+
}
106+
107+
registry, err := containerdregistry.NewRegistry(registryOpts...)
108+
if err != nil {
109+
return err
110+
}
111+
defer func() {
112+
if err := registry.Destroy(); err != nil {
113+
logger.Error(err)
114+
}
115+
}()
116+
117+
var (
118+
ref = image.SimpleReference(args[0])
119+
ctx = context.Background()
120+
)
121+
if err := registry.Pull(ctx, ref); err != nil {
122+
return err
123+
}
124+
125+
dir, err := ioutil.TempDir("", "bundle-")
126+
if err != nil {
127+
return err
128+
}
129+
130+
defer func() {
131+
err := os.RemoveAll(dir)
132+
if err != nil {
133+
logger.Error(err.Error())
134+
}
135+
}()
136+
if err := registry.Unpack(ctx, ref, dir); err != nil {
137+
return err
138+
}
139+
140+
if err := registry.Destroy(); err != nil {
141+
return err
142+
}
143+
144+
if skipValidation {
145+
logger.Info("skipping bundle validation")
146+
} else {
147+
validator := bundle.NewImageValidator(registry, logger)
148+
if err := validator.ValidateBundleFormat(dir); err != nil {
149+
return fmt.Errorf("bundle format validation failed: %s", err)
150+
}
151+
if err := validator.ValidateBundleContent(filepath.Join(dir, bundle.ManifestsDir)); err != nil {
152+
return fmt.Errorf("bundle content validation failed: %s", err)
153+
}
154+
}
155+
156+
if err := dircopy.Copy(dir, out); err != nil {
157+
return fmt.Errorf("failed to copy unpacked content to output directory: %s", err)
158+
}
159+
160+
return nil
161+
}

‎cmd/opm/main.go

+3-28
Original file line numberDiff line numberDiff line change
@@ -3,40 +3,15 @@ package main
33
import (
44
"os"
55

6-
"github.com/sirupsen/logrus"
7-
"github.com/spf13/cobra"
86
utilerrors "k8s.io/apimachinery/pkg/util/errors"
97

10-
"github.com/operator-framework/operator-registry/cmd/opm/alpha"
11-
"github.com/operator-framework/operator-registry/cmd/opm/index"
12-
"github.com/operator-framework/operator-registry/cmd/opm/registry"
13-
"github.com/operator-framework/operator-registry/cmd/opm/version"
8+
"github.com/operator-framework/operator-registry/cmd/opm/root"
149
registrylib "github.com/operator-framework/operator-registry/pkg/registry"
1510
)
1611

1712
func main() {
18-
rootCmd := &cobra.Command{
19-
Use: "opm",
20-
Short: "operator package manager",
21-
Long: "CLI to interact with operator-registry and build indexes of operator content",
22-
PreRunE: func(cmd *cobra.Command, args []string) error {
23-
if debug, _ := cmd.Flags().GetBool("debug"); debug {
24-
logrus.SetLevel(logrus.DebugLevel)
25-
}
26-
return nil
27-
},
28-
}
29-
30-
rootCmd.AddCommand(registry.NewOpmRegistryCmd(), alpha.NewCmd())
31-
index.AddCommand(rootCmd)
32-
version.AddCommand(rootCmd)
33-
34-
rootCmd.Flags().Bool("debug", false, "enable debug logging")
35-
if err := rootCmd.Flags().MarkHidden("debug"); err != nil {
36-
logrus.Panic(err.Error())
37-
}
38-
39-
if err := rootCmd.Execute(); err != nil {
13+
cmd := root.NewCmd()
14+
if err := cmd.Execute(); err != nil {
4015
agg, ok := err.(utilerrors.Aggregate)
4116
if !ok {
4217
os.Exit(1)

‎cmd/opm/root/cmd.go

+36
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,36 @@
1+
package root
2+
3+
import (
4+
"github.com/sirupsen/logrus"
5+
"github.com/spf13/cobra"
6+
7+
"github.com/operator-framework/operator-registry/cmd/opm/alpha"
8+
"github.com/operator-framework/operator-registry/cmd/opm/index"
9+
"github.com/operator-framework/operator-registry/cmd/opm/registry"
10+
"github.com/operator-framework/operator-registry/cmd/opm/version"
11+
)
12+
13+
func NewCmd() *cobra.Command {
14+
cmd := &cobra.Command{
15+
Use: "opm",
16+
Short: "operator package manager",
17+
Long: "CLI to interact with operator-registry and build indexes of operator content",
18+
PreRunE: func(cmd *cobra.Command, args []string) error {
19+
if debug, _ := cmd.Flags().GetBool("debug"); debug {
20+
logrus.SetLevel(logrus.DebugLevel)
21+
}
22+
return nil
23+
},
24+
}
25+
26+
cmd.AddCommand(registry.NewOpmRegistryCmd(), alpha.NewCmd())
27+
index.AddCommand(cmd)
28+
version.AddCommand(cmd)
29+
30+
cmd.Flags().Bool("debug", false, "enable debug logging")
31+
if err := cmd.Flags().MarkHidden("debug"); err != nil {
32+
logrus.Panic(err.Error())
33+
}
34+
35+
return cmd
36+
}

‎go.mod

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
module github.com/operator-framework/operator-registry
22

3-
go 1.13
3+
go 1.15
44

55
require (
66
github.com/Microsoft/hcsshim v0.8.9 // indirect

‎pkg/image/containerdregistry/registry.go

+3-3
Original file line numberDiff line numberDiff line change
@@ -42,7 +42,7 @@ func (r *Registry) Pull(ctx context.Context, ref image.Reference) error {
4242
if err != nil {
4343
return fmt.Errorf("error resolving name %s: %v", name, err)
4444
}
45-
r.log.Infof("resolved name: %s", name)
45+
r.log.Debugf("resolved name: %s", name)
4646

4747
fetcher, err := r.resolver.Fetcher(ctx, name)
4848
if err != nil {
@@ -82,7 +82,7 @@ func (r *Registry) Unpack(ctx context.Context, ref image.Reference, dir string)
8282
}
8383

8484
for _, layer := range manifest.Layers {
85-
r.log.Infof("unpacking layer: %v", layer)
85+
r.log.Debugf("unpacking layer: %v", layer)
8686
if err := r.unpackLayer(ctx, layer, dir); err != nil {
8787
return err
8888
}
@@ -153,7 +153,7 @@ func (r *Registry) getImage(ctx context.Context, manifest ocispec.Manifest) (*oc
153153

154154
func (r *Registry) fetch(ctx context.Context, fetcher remotes.Fetcher, root ocispec.Descriptor) error {
155155
visitor := images.HandlerFunc(func(ctx context.Context, desc ocispec.Descriptor) ([]ocispec.Descriptor, error) {
156-
r.log.WithField("digest", desc.Digest).Info("fetched")
156+
r.log.WithField("digest", desc.Digest).Debug("fetched")
157157
r.log.Debug(desc)
158158
return nil, nil
159159
})

‎pkg/lib/bundle/validate.go

+3-3
Original file line numberDiff line numberDiff line change
@@ -146,17 +146,17 @@ func (i imageValidator) ValidateBundleFormat(directory string) error {
146146
if !annotationsFound {
147147
validationErrors = append(validationErrors, fmt.Errorf("Could not find annotations file"))
148148
} else {
149-
i.logger.Info("Found annotations file")
149+
i.logger.Debug("Found annotations file")
150150
errs := validateAnnotations(mediaType, fileAnnotations)
151151
if errs != nil {
152152
validationErrors = append(validationErrors, errs...)
153153
}
154154
}
155155

156156
if !dependenciesFound {
157-
i.logger.Info("Could not find optional dependencies file")
157+
i.logger.Debug("Could not find optional dependencies file")
158158
} else {
159-
i.logger.Info("Found dependencies file")
159+
i.logger.Debug("Found dependencies file")
160160
errs := validateDependencies(dependenciesFile)
161161
if errs != nil {
162162
validationErrors = append(validationErrors, errs...)

‎pkg/lib/image/registry.go

+6-6
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,6 @@ import (
1313
"fmt"
1414
"io"
1515
"io/ioutil"
16-
"k8s.io/apimachinery/pkg/util/wait"
1716
"math/big"
1817
"net"
1918
"net/http"
@@ -25,6 +24,7 @@ import (
2524
_ "github.com/docker/distribution/registry/storage/driver/filesystem" // Driver for persisting docker image data to the filesystem.
2625
_ "github.com/docker/distribution/registry/storage/driver/inmemory" // Driver for keeping docker image data in memory.
2726
"github.com/phayes/freeport"
27+
"k8s.io/apimachinery/pkg/util/wait"
2828
)
2929

3030
// RunDockerRegistry runs a docker registry on an available port and returns its host string if successful, otherwise it returns an error.
@@ -67,7 +67,7 @@ func RunDockerRegistry(ctx context.Context, rootDir string) (string, string, err
6767
config.HTTP.Addr = host
6868
config.HTTP.TLS.Certificate = certfile.Name()
6969
config.HTTP.TLS.Key = keyfile.Name()
70-
config.Log.Level = "debug"
70+
config.Log.Level = "error"
7171

7272
if rootDir != "" {
7373
config.Storage = map[string]configuration.Parameters{"filesystem": map[string]interface{}{
@@ -100,7 +100,7 @@ func RunDockerRegistry(ctx context.Context, rootDir string) (string, string, err
100100
RootCAs: certPool,
101101
}}
102102
client := &http.Client{Transport: tr}
103-
r, err := client.Get("https://"+host+"/v2/")
103+
r, err := client.Get("https://" + host + "/v2/")
104104
if err != nil {
105105
return false, nil
106106
}
@@ -128,7 +128,7 @@ func certToPem(der []byte) ([]byte, error) {
128128
func keyToPem(key *ecdsa.PrivateKey) ([]byte, error) {
129129
b, err := x509.MarshalECPrivateKey(key)
130130
if err != nil {
131-
return nil, fmt.Errorf( "unable to marshal private key: %v", err)
131+
return nil, fmt.Errorf("unable to marshal private key: %v", err)
132132
}
133133
out := &bytes.Buffer{}
134134
if err := pem.Encode(out, &pem.Block{Type: "EC PRIVATE KEY", Bytes: b}); err != nil {
@@ -137,7 +137,7 @@ func keyToPem(key *ecdsa.PrivateKey) ([]byte, error) {
137137
return out.Bytes(), nil
138138
}
139139

140-
func GenerateCerts(caWriter, certWriter, keyWriter io.Writer, pool *x509.CertPool ) error {
140+
func GenerateCerts(caWriter, certWriter, keyWriter io.Writer, pool *x509.CertPool) error {
141141
priv, err := ecdsa.GenerateKey(elliptic.P521(), rand.Reader)
142142
if err != nil {
143143
return err
@@ -153,7 +153,7 @@ func GenerateCerts(caWriter, certWriter, keyWriter io.Writer, pool *x509.CertPoo
153153
KeyUsage: x509.KeyUsageKeyEncipherment | x509.KeyUsageDigitalSignature | x509.KeyUsageCertSign,
154154
ExtKeyUsage: []x509.ExtKeyUsage{x509.ExtKeyUsageServerAuth},
155155
BasicConstraintsValid: true,
156-
IsCA: true,
156+
IsCA: true,
157157
}
158158
cert := x509.Certificate{
159159
SerialNumber: big.NewInt(2),

‎test/e2e/e2e_suite_test.go

+14-1
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,9 @@ import (
88

99
. "github.com/onsi/ginkgo"
1010
. "github.com/onsi/gomega"
11+
"github.com/spf13/cobra"
12+
13+
opmroot "github.com/operator-framework/operator-registry/cmd/opm/root"
1114
)
1215

1316
// quay.io is the default registry used if no local registry endpoint is provided
@@ -18,6 +21,9 @@ var (
1821
dockerUsername = os.Getenv("DOCKER_USERNAME")
1922
dockerPassword = os.Getenv("DOCKER_PASSWORD")
2023
dockerHost = os.Getenv("DOCKER_REGISTRY_HOST") // 'DOCKER_HOST' is reserved for the docker daemon
24+
25+
// opm command under test.
26+
opm *cobra.Command
2127
)
2228

2329
func TestE2E(t *testing.T) {
@@ -26,6 +32,13 @@ func TestE2E(t *testing.T) {
2632
}
2733

2834
var _ = BeforeSuite(func() {
35+
// Configure test registry (hostnames, credentials, etc.)
36+
configureRegistry()
37+
38+
opm = opmroot.NewCmd() // Creating multiple instances would cause flag registration conflicts
39+
})
40+
41+
func configureRegistry() {
2942
switch {
3043
case dockerUsername == "" && dockerPassword == "" && dockerHost == "":
3144
// No registry credentials or local registry host provided
@@ -46,4 +59,4 @@ var _ = BeforeSuite(func() {
4659
Expect(err).ToNot(HaveOccurred(), "Error logging into %s: %s", dockerHost, out)
4760

4861
By(fmt.Sprintf("Using container image registry %s", dockerHost))
49-
})
62+
}

‎test/e2e/opm_bundle_test.go

+122
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,122 @@
1+
package e2e_test
2+
3+
import (
4+
"bytes"
5+
"context"
6+
"io/ioutil"
7+
"os"
8+
"path/filepath"
9+
10+
. "github.com/onsi/ginkgo"
11+
. "github.com/onsi/gomega"
12+
"golang.org/x/mod/sumdb/dirhash"
13+
14+
libimage "github.com/operator-framework/operator-registry/pkg/lib/image"
15+
)
16+
17+
var _ = Describe("opm alpha bundle", func() {
18+
// out captures opm command output
19+
var out bytes.Buffer
20+
21+
BeforeEach(func() {
22+
// Reset the command's output buffer
23+
out = bytes.Buffer{}
24+
opm.SetOut(&out)
25+
opm.SetErr(&out)
26+
})
27+
28+
Context("for an invalid bundle", func() {
29+
var (
30+
bundleRef string
31+
bundleChecksum string
32+
tmpDir string
33+
rootCA string
34+
stopRegistry func()
35+
)
36+
37+
BeforeEach(func() {
38+
ctx, cancel := context.WithCancel(context.Background())
39+
stopRegistry = func() {
40+
cancel()
41+
<-ctx.Done()
42+
}
43+
44+
// Spin up an in-process docker registry with a set of preconfigured test images
45+
var (
46+
// Directory containing the docker registry filesystem
47+
goldenFiles = "../../pkg/image/testdata/golden"
48+
49+
host string
50+
err error
51+
)
52+
host, rootCA, err = libimage.RunDockerRegistry(ctx, goldenFiles)
53+
Expect(err).ToNot(HaveOccurred())
54+
55+
// Create a bundle ref using the local registry host name and the namespace/name of a bundle we already know the content of
56+
bundleRef = host + "/olmtest/kiali@sha256:a1bec450c104ceddbb25b252275eb59f1f1e6ca68e0ced76462042f72f7057d8"
57+
58+
// Generate a checksum of the expected content for the bundle under test
59+
bundleChecksum, err = dirhash.HashDir(filepath.Join(goldenFiles, "bundles/kiali"), "", dirhash.DefaultHash)
60+
Expect(err).ToNot(HaveOccurred())
61+
62+
// Set up a temporary directory that we can use for testing
63+
tmpDir, err = ioutil.TempDir("", "opm-alpha-bundle-")
64+
Expect(err).ToNot(HaveOccurred())
65+
})
66+
67+
AfterEach(func() {
68+
stopRegistry()
69+
if CurrentGinkgoTestDescription().Failed {
70+
// Skip additional cleanup
71+
return
72+
}
73+
74+
Expect(os.RemoveAll(tmpDir)).To(Succeed())
75+
})
76+
77+
It("fails to unpack", func() {
78+
unpackDir := filepath.Join(tmpDir, "unpacked")
79+
opm.SetArgs([]string{
80+
"alpha",
81+
"bundle",
82+
"unpack",
83+
"--root-ca",
84+
rootCA,
85+
"--out",
86+
unpackDir,
87+
bundleRef,
88+
})
89+
90+
Expect(opm.Execute()).ToNot(Succeed())
91+
result, err := ioutil.ReadAll(&out)
92+
Expect(err).ToNot(HaveOccurred())
93+
Expect(string(result)).To(ContainSubstring("bundle content validation failed"))
94+
})
95+
96+
It("unpacks successfully", func() {
97+
By("setting --skip-validation")
98+
99+
unpackDir := filepath.Join(tmpDir, "unpacked")
100+
opm.SetArgs([]string{
101+
"alpha",
102+
"bundle",
103+
"unpack",
104+
"--root-ca",
105+
rootCA,
106+
"--out",
107+
unpackDir,
108+
bundleRef,
109+
"--skip-validation",
110+
})
111+
112+
Expect(opm.Execute()).To(Succeed())
113+
result, err := ioutil.ReadAll(&out)
114+
Expect(err).ToNot(HaveOccurred())
115+
Expect(result).ToNot(ContainSubstring("bundle content validation failed"))
116+
117+
checksum, err := dirhash.HashDir(unpackDir, "", dirhash.DefaultHash)
118+
Expect(err).ToNot(HaveOccurred())
119+
Expect(checksum).To(Equal(bundleChecksum))
120+
})
121+
})
122+
})

‎vendor/modules.txt

+59
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,7 @@ github.com/Microsoft/go-winio
88
github.com/Microsoft/go-winio/pkg/guid
99
github.com/Microsoft/go-winio/vhd
1010
# github.com/Microsoft/hcsshim v0.8.9
11+
## explicit
1112
github.com/Microsoft/hcsshim
1213
github.com/Microsoft/hcsshim/internal/cow
1314
github.com/Microsoft/hcsshim/internal/hcs
@@ -33,30 +34,35 @@ github.com/PuerkitoBio/urlesc
3334
# github.com/Shopify/logrus-bugsnag v0.0.0-20171204204709-577dee27f20d
3435
github.com/Shopify/logrus-bugsnag
3536
# github.com/antihax/optional v0.0.0-20180407024304-ca021399b1a6
37+
## explicit
3638
github.com/antihax/optional
3739
# github.com/asaskevich/govalidator v0.0.0-20190424111038-f61b66f89f4a
3840
github.com/asaskevich/govalidator
3941
# github.com/beorn7/perks v1.0.1
4042
github.com/beorn7/perks/quantile
4143
# github.com/blang/semver v3.5.1+incompatible
44+
## explicit
4245
github.com/blang/semver
4346
# github.com/blang/semver/v4 v4.0.0
4447
github.com/blang/semver/v4
4548
# github.com/bshuster-repo/logrus-logstash-hook v0.4.1
4649
github.com/bshuster-repo/logrus-logstash-hook
4750
# github.com/bugsnag/bugsnag-go v1.5.3
51+
## explicit
4852
github.com/bugsnag/bugsnag-go
4953
github.com/bugsnag/bugsnag-go/device
5054
github.com/bugsnag/bugsnag-go/errors
5155
github.com/bugsnag/bugsnag-go/headers
5256
github.com/bugsnag/bugsnag-go/sessions
5357
# github.com/bugsnag/panicwrap v1.2.0
58+
## explicit
5459
github.com/bugsnag/panicwrap
5560
# github.com/cespare/xxhash/v2 v2.1.1
5661
github.com/cespare/xxhash/v2
5762
# github.com/containerd/cgroups v0.0.0-20190919134610-bf292b21730f
5863
github.com/containerd/cgroups/stats/v1
5964
# github.com/containerd/containerd v1.3.2 => github.com/ecordell/containerd v1.3.1-0.20200629153125-0ff1a1be2fa5
65+
## explicit
6066
github.com/containerd/containerd/archive
6167
github.com/containerd/containerd/archive/compression
6268
github.com/containerd/containerd/containers
@@ -83,18 +89,22 @@ github.com/containerd/containerd/snapshots
8389
github.com/containerd/containerd/sys
8490
github.com/containerd/containerd/version
8591
# github.com/containerd/continuity v0.0.0-20200413184840-d3ef23f19fbb
92+
## explicit
8693
github.com/containerd/continuity/fs
8794
github.com/containerd/continuity/sysx
8895
# github.com/containerd/ttrpc v1.0.1
96+
## explicit
8997
github.com/containerd/ttrpc
9098
# github.com/davecgh/go-spew v1.1.1
9199
github.com/davecgh/go-spew/spew
92100
# github.com/docker/cli v0.0.0-20200130152716-5d0cf8839492
101+
## explicit
93102
github.com/docker/cli/cli/config
94103
github.com/docker/cli/cli/config/configfile
95104
github.com/docker/cli/cli/config/credentials
96105
github.com/docker/cli/cli/config/types
97106
# github.com/docker/distribution v2.7.1+incompatible => github.com/docker/distribution v0.0.0-20191216044856-a8371794149d
107+
## explicit
98108
github.com/docker/distribution
99109
github.com/docker/distribution/configuration
100110
github.com/docker/distribution/context
@@ -136,6 +146,7 @@ github.com/docker/distribution/registry/storage/driver/middleware
136146
github.com/docker/distribution/uuid
137147
github.com/docker/distribution/version
138148
# github.com/docker/docker v1.4.2-0.20200203170920-46ec8731fbce
149+
## explicit
139150
github.com/docker/docker/api/types
140151
github.com/docker/docker/api/types/blkiodev
141152
github.com/docker/docker/api/types/container
@@ -160,16 +171,21 @@ github.com/docker/docker/registry
160171
github.com/docker/docker/registry/resumable
161172
github.com/docker/docker/rootless
162173
# github.com/docker/docker-credential-helpers v0.6.3
174+
## explicit
163175
github.com/docker/docker-credential-helpers/client
164176
github.com/docker/docker-credential-helpers/credentials
165177
# github.com/docker/go-connections v0.4.0
166178
github.com/docker/go-connections/nat
167179
github.com/docker/go-connections/tlsconfig
180+
# github.com/docker/go-events v0.0.0-20190806004212-e31b211e4f1c
181+
## explicit
168182
# github.com/docker/go-metrics v0.0.1
183+
## explicit
169184
github.com/docker/go-metrics
170185
# github.com/docker/go-units v0.4.0
171186
github.com/docker/go-units
172187
# github.com/docker/libtrust v0.0.0-20160708172513-aabc10ec26b7
188+
## explicit
173189
github.com/docker/libtrust
174190
# github.com/docker/spdystream v0.0.0-20160310174837-449fdfce4d96
175191
github.com/docker/spdystream
@@ -179,9 +195,11 @@ github.com/evanphx/json-patch
179195
# github.com/fsnotify/fsnotify v1.4.9
180196
github.com/fsnotify/fsnotify
181197
# github.com/garyburd/redigo v1.6.0
198+
## explicit
182199
github.com/garyburd/redigo/internal
183200
github.com/garyburd/redigo/redis
184201
# github.com/ghodss/yaml v1.0.0
202+
## explicit
185203
github.com/ghodss/yaml
186204
# github.com/go-logr/logr v0.3.0
187205
github.com/go-logr/logr
@@ -194,6 +212,7 @@ github.com/go-openapi/spec
194212
# github.com/go-openapi/swag v0.19.5
195213
github.com/go-openapi/swag
196214
# github.com/gofrs/uuid v3.3.0+incompatible
215+
## explicit
197216
github.com/gofrs/uuid
198217
# github.com/gogo/protobuf v1.3.1
199218
github.com/gogo/protobuf/gogoproto
@@ -202,20 +221,24 @@ github.com/gogo/protobuf/protoc-gen-gogo/descriptor
202221
github.com/gogo/protobuf/sortkeys
203222
github.com/gogo/protobuf/types
204223
# github.com/golang-migrate/migrate/v4 v4.6.2
224+
## explicit
205225
github.com/golang-migrate/migrate/v4/source
206226
github.com/golang-migrate/migrate/v4/source/file
207227
# github.com/golang/groupcache v0.0.0-20200121045136-8c9f03a8e57e
208228
github.com/golang/groupcache/lru
209229
# github.com/golang/mock v1.4.1
230+
## explicit
210231
github.com/golang/mock/gomock
211232
# github.com/golang/protobuf v1.4.3
233+
## explicit
212234
github.com/golang/protobuf/proto
213235
github.com/golang/protobuf/protoc-gen-go/descriptor
214236
github.com/golang/protobuf/ptypes
215237
github.com/golang/protobuf/ptypes/any
216238
github.com/golang/protobuf/ptypes/duration
217239
github.com/golang/protobuf/ptypes/timestamp
218240
# github.com/google/go-cmp v0.5.2
241+
## explicit
219242
github.com/google/go-cmp/cmp
220243
github.com/google/go-cmp/cmp/cmpopts
221244
github.com/google/go-cmp/cmp/internal/diff
@@ -230,10 +253,12 @@ github.com/googleapis/gnostic/extensions
230253
github.com/googleapis/gnostic/jsonschema
231254
github.com/googleapis/gnostic/openapiv2
232255
# github.com/gorilla/handlers v1.4.2
256+
## explicit
233257
github.com/gorilla/handlers
234258
# github.com/gorilla/mux v1.7.2
235259
github.com/gorilla/mux
236260
# github.com/grpc-ecosystem/grpc-health-probe v0.3.2
261+
## explicit
237262
github.com/grpc-ecosystem/grpc-health-probe
238263
# github.com/hashicorp/golang-lru v0.5.4
239264
github.com/hashicorp/golang-lru
@@ -253,10 +278,12 @@ github.com/mailru/easyjson/buffer
253278
github.com/mailru/easyjson/jlexer
254279
github.com/mailru/easyjson/jwriter
255280
# github.com/mattn/go-sqlite3 v1.10.0
281+
## explicit
256282
github.com/mattn/go-sqlite3
257283
# github.com/matttproud/golang_protobuf_extensions v1.0.2-0.20181231171920-c182affec369
258284
github.com/matttproud/golang_protobuf_extensions/pbutil
259285
# github.com/maxbrunsfeld/counterfeiter/v6 v6.2.2
286+
## explicit
260287
github.com/maxbrunsfeld/counterfeiter/v6
261288
github.com/maxbrunsfeld/counterfeiter/v6/arguments
262289
github.com/maxbrunsfeld/counterfeiter/v6/command
@@ -281,6 +308,7 @@ github.com/nxadm/tail/util
281308
github.com/nxadm/tail/watch
282309
github.com/nxadm/tail/winfile
283310
# github.com/onsi/ginkgo v1.14.1
311+
## explicit
284312
github.com/onsi/ginkgo
285313
github.com/onsi/ginkgo/config
286314
github.com/onsi/ginkgo/ginkgo
@@ -308,6 +336,7 @@ github.com/onsi/ginkgo/reporters/stenographer/support/go-colorable
308336
github.com/onsi/ginkgo/reporters/stenographer/support/go-isatty
309337
github.com/onsi/ginkgo/types
310338
# github.com/onsi/gomega v1.10.2
339+
## explicit
311340
github.com/onsi/gomega
312341
github.com/onsi/gomega/format
313342
github.com/onsi/gomega/gstruct/errors
@@ -324,11 +353,14 @@ github.com/onsi/gomega/types
324353
# github.com/opencontainers/go-digest v1.0.0
325354
github.com/opencontainers/go-digest
326355
# github.com/opencontainers/image-spec v1.0.2-0.20190823105129-775207bd45b6
356+
## explicit
327357
github.com/opencontainers/image-spec/specs-go
328358
github.com/opencontainers/image-spec/specs-go/v1
329359
# github.com/opencontainers/runc v0.1.1
360+
## explicit
330361
github.com/opencontainers/runc/libcontainer/system
331362
# github.com/operator-framework/api v0.5.0
363+
## explicit
332364
github.com/operator-framework/api/pkg/lib/version
333365
github.com/operator-framework/api/pkg/manifests
334366
github.com/operator-framework/api/pkg/operators
@@ -338,10 +370,13 @@ github.com/operator-framework/api/pkg/validation/errors
338370
github.com/operator-framework/api/pkg/validation/interfaces
339371
github.com/operator-framework/api/pkg/validation/internal
340372
# github.com/otiai10/copy v1.2.0
373+
## explicit
341374
github.com/otiai10/copy
342375
# github.com/phayes/freeport v0.0.0-20180830031419-95f893ade6f2
376+
## explicit
343377
github.com/phayes/freeport
344378
# github.com/pkg/errors v0.9.1
379+
## explicit
345380
github.com/pkg/errors
346381
# github.com/pmezard/go-difflib v1.0.0
347382
github.com/pmezard/go-difflib/difflib
@@ -362,21 +397,28 @@ github.com/prometheus/procfs/internal/util
362397
# github.com/russross/blackfriday v1.5.2
363398
github.com/russross/blackfriday
364399
# github.com/sirupsen/logrus v1.6.0
400+
## explicit
365401
github.com/sirupsen/logrus
366402
# github.com/spf13/cobra v1.1.1
403+
## explicit
367404
github.com/spf13/cobra
368405
# github.com/spf13/pflag v1.0.5
369406
github.com/spf13/pflag
370407
# github.com/stretchr/testify v1.6.1
408+
## explicit
371409
github.com/stretchr/testify/assert
372410
github.com/stretchr/testify/require
373411
# github.com/yvasiyarov/go-metrics v0.0.0-20150112132944-c25f46c4b940
412+
## explicit
374413
github.com/yvasiyarov/go-metrics
375414
# github.com/yvasiyarov/gorelic v0.0.7
415+
## explicit
376416
github.com/yvasiyarov/gorelic
377417
# github.com/yvasiyarov/newrelic_platform_go v0.0.0-20160601141957-9c099fbc30e9
418+
## explicit
378419
github.com/yvasiyarov/newrelic_platform_go
379420
# go.etcd.io/bbolt v1.3.5
421+
## explicit
380422
go.etcd.io/bbolt
381423
# go.opencensus.io v0.22.3
382424
go.opencensus.io
@@ -389,10 +431,12 @@ golang.org/x/crypto/acme
389431
golang.org/x/crypto/acme/autocert
390432
golang.org/x/crypto/ssh/terminal
391433
# golang.org/x/mod v0.3.0
434+
## explicit
392435
golang.org/x/mod/module
393436
golang.org/x/mod/semver
394437
golang.org/x/mod/sumdb/dirhash
395438
# golang.org/x/net v0.0.0-20201110031124-69a78807bb2b
439+
## explicit
396440
golang.org/x/net/context
397441
golang.org/x/net/context/ctxhttp
398442
golang.org/x/net/html
@@ -405,9 +449,11 @@ golang.org/x/net/idna
405449
golang.org/x/net/internal/timeseries
406450
golang.org/x/net/trace
407451
# golang.org/x/oauth2 v0.0.0-20200107190931-bf48bf16ab8d
452+
## explicit
408453
golang.org/x/oauth2
409454
golang.org/x/oauth2/internal
410455
# golang.org/x/sync v0.0.0-20190911185100-cd5d95a43a6e
456+
## explicit
411457
golang.org/x/sync/errgroup
412458
golang.org/x/sync/semaphore
413459
# golang.org/x/sys v0.0.0-20201112073958-5cba982894dd
@@ -470,6 +516,7 @@ google.golang.org/appengine/urlfetch
470516
# google.golang.org/genproto v0.0.0-20201110150050-8816d57aaa9a
471517
google.golang.org/genproto/googleapis/rpc/status
472518
# google.golang.org/grpc v1.30.0
519+
## explicit
473520
google.golang.org/grpc
474521
google.golang.org/grpc/attributes
475522
google.golang.org/grpc/backoff
@@ -514,8 +561,10 @@ google.golang.org/grpc/stats
514561
google.golang.org/grpc/status
515562
google.golang.org/grpc/tap
516563
# google.golang.org/grpc/cmd/protoc-gen-go-grpc v0.0.0-20200709232328-d8193ee9cc3e
564+
## explicit
517565
google.golang.org/grpc/cmd/protoc-gen-go-grpc
518566
# google.golang.org/protobuf v1.25.0
567+
## explicit
519568
google.golang.org/protobuf/cmd/protoc-gen-go
520569
google.golang.org/protobuf/cmd/protoc-gen-go/internal_gengo
521570
google.golang.org/protobuf/compiler/protogen
@@ -556,10 +605,12 @@ gopkg.in/inf.v0
556605
# gopkg.in/tomb.v1 v1.0.0-20141024135613-dd632973f1e7
557606
gopkg.in/tomb.v1
558607
# gopkg.in/yaml.v2 v2.3.0
608+
## explicit
559609
gopkg.in/yaml.v2
560610
# gopkg.in/yaml.v3 v3.0.0-20200615113413-eeeca48fe776
561611
gopkg.in/yaml.v3
562612
# k8s.io/api v0.20.0
613+
## explicit
563614
k8s.io/api/admissionregistration/v1
564615
k8s.io/api/admissionregistration/v1beta1
565616
k8s.io/api/apiserverinternal/v1alpha1
@@ -604,6 +655,7 @@ k8s.io/api/storage/v1
604655
k8s.io/api/storage/v1alpha1
605656
k8s.io/api/storage/v1beta1
606657
# k8s.io/apiextensions-apiserver v0.20.0
658+
## explicit
607659
k8s.io/apiextensions-apiserver/pkg/apihelpers
608660
k8s.io/apiextensions-apiserver/pkg/apis/apiextensions
609661
k8s.io/apiextensions-apiserver/pkg/apis/apiextensions/install
@@ -616,6 +668,7 @@ k8s.io/apiextensions-apiserver/pkg/apiserver/schema/objectmeta
616668
k8s.io/apiextensions-apiserver/pkg/apiserver/schema/pruning
617669
k8s.io/apiextensions-apiserver/pkg/apiserver/validation
618670
# k8s.io/apimachinery v0.20.0
671+
## explicit
619672
k8s.io/apimachinery/pkg/api/equality
620673
k8s.io/apimachinery/pkg/api/errors
621674
k8s.io/apimachinery/pkg/api/meta
@@ -664,6 +717,7 @@ k8s.io/apimachinery/third_party/forked/golang/json
664717
k8s.io/apimachinery/third_party/forked/golang/netutil
665718
k8s.io/apimachinery/third_party/forked/golang/reflect
666719
# k8s.io/apiserver v0.20.0
720+
## explicit
667721
k8s.io/apiserver/pkg/apis/apiserver
668722
k8s.io/apiserver/pkg/apis/apiserver/install
669723
k8s.io/apiserver/pkg/apis/apiserver/v1
@@ -674,6 +728,7 @@ k8s.io/apiserver/pkg/server/egressselector/metrics
674728
k8s.io/apiserver/pkg/storage/names
675729
k8s.io/apiserver/pkg/util/webhook
676730
# k8s.io/client-go v0.20.0
731+
## explicit
677732
k8s.io/client-go/discovery
678733
k8s.io/client-go/discovery/fake
679734
k8s.io/client-go/kubernetes
@@ -798,6 +853,7 @@ k8s.io/component-base/metrics
798853
k8s.io/component-base/metrics/legacyregistry
799854
k8s.io/component-base/version
800855
# k8s.io/klog v1.0.0
856+
## explicit
801857
k8s.io/klog
802858
# k8s.io/klog/v2 v2.4.0
803859
k8s.io/klog/v2
@@ -809,6 +865,7 @@ k8s.io/kube-openapi/pkg/validation/strfmt
809865
k8s.io/kube-openapi/pkg/validation/strfmt/bson
810866
k8s.io/kube-openapi/pkg/validation/validate
811867
# k8s.io/kubectl v0.20.0
868+
## explicit
812869
k8s.io/kubectl/pkg/util/interrupt
813870
k8s.io/kubectl/pkg/util/templates
814871
k8s.io/kubectl/pkg/util/term
@@ -824,3 +881,5 @@ sigs.k8s.io/apiserver-network-proxy/konnectivity-client/proto/client
824881
sigs.k8s.io/structured-merge-diff/v4/value
825882
# sigs.k8s.io/yaml v1.2.0
826883
sigs.k8s.io/yaml
884+
# github.com/containerd/containerd => github.com/ecordell/containerd v1.3.1-0.20200629153125-0ff1a1be2fa5
885+
# github.com/docker/distribution => github.com/docker/distribution v0.0.0-20191216044856-a8371794149d

0 commit comments

Comments
 (0)
Please sign in to comment.