-
Notifications
You must be signed in to change notification settings - Fork 248
/
interfaces.go
30 lines (26 loc) · 1.02 KB
/
interfaces.go
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
package bundle
import (
"github.com/sirupsen/logrus"
"github.com/operator-framework/operator-registry/pkg/image"
)
// BundleImageValidator provides a toolset for pulling and then validating
// bundle container images
type BundleImageValidator interface {
// PullBundleImage takes an imageTag to pull and a directory to push
// the contents of the image to
PullBundleImage(imageTag string, directory string) error
// Validate bundle takes a directory containing the contents of a bundle image
// and validates that the format is correct
ValidateBundleFormat(directory string) error
// Validate bundle takes a directory containing the contents of a bundle image
// and validates that the content is correct
ValidateBundleContent(directory string) error
}
// NewImageValidator is a constructor that returns an ImageValidator
func NewImageValidator(registry image.Registry, logger *logrus.Entry, options ...string) BundleImageValidator {
return imageValidator{
registry: registry,
logger: logger,
optional: options,
}
}