Documentation ¶
Index ¶
- Constants
- func CompareFiles(t *testing.T, path1, path2 string)
- func ExtractDigest(t *testing.T, out string) string
- type Assertion
- func (a *Assertion) AssertBundleLock(path, expectedBundleRef, expectedTag string)
- func (a *Assertion) AssertImagesLock(path string, images []lockconfig.ImageRef)
- func (a *Assertion) ImagesDigestIsOnTar(tarFilePath string, imagesDigestRef ...string)
- func (a *Assertion) ValidateCosignSignature(refs []string)
- func (a *Assertion) ValidateImagesPresenceInRegistry(refs []string) error
- type Assets
- func (a *Assets) AddFileToFolder(path, content string)
- func (a *Assets) CleanCreatedFolders()
- func (a *Assets) CreateAndCopySimpleApp(prefix string) string
- func (a *Assets) CreateTempFolder(prefix string) string
- func (a Assets) FilesInFolder() []string
- func (a Assets) SimpleAppDir() string
- func (a *Assets) ValidateFilesAreEqual(expected, got string, fileToCheck []string)
- type BundleFactory
- type BundleInfo
- type Env
- type FakeTestRegistryBuilder
- func (r *FakeTestRegistryBuilder) Build() registry.Registry
- func (r *FakeTestRegistryBuilder) BuildWithRegistryOpts(opts registry.Opts) registry.Registry
- func (r *FakeTestRegistryBuilder) CleanUp()
- func (r *FakeTestRegistryBuilder) CopyAllImagesFromRepo(imageRef, to string)
- func (r *FakeTestRegistryBuilder) CopyBundleImage(bundleInfo BundleInfo, to string) BundleInfo
- func (r *FakeTestRegistryBuilder) CopyFromImageRef(imageRef, to string) *ImageOrImageIndexWithTarPath
- func (r *FakeTestRegistryBuilder) CopyImage(img ImageOrImageIndexWithTarPath, to string) *ImageOrImageIndexWithTarPath
- func (r *FakeTestRegistryBuilder) Host() string
- func (r *FakeTestRegistryBuilder) ReferenceOnTestServer(repo string) string
- func (r *FakeTestRegistryBuilder) RemoveByImageRef(imageRef string)
- func (r *FakeTestRegistryBuilder) RemoveImage(imageRef string)
- func (r *FakeTestRegistryBuilder) ResetHandler() *FakeTestRegistryBuilder
- func (r *FakeTestRegistryBuilder) WithARandomImageIndex(imageName string, numImages int64) *ImageOrImageIndexWithTarPath
- func (r *FakeTestRegistryBuilder) WithBasicAuth(username string, password string)
- func (r *FakeTestRegistryBuilder) WithBasicAuthPerRepository(repo, username, password string)
- func (r *FakeTestRegistryBuilder) WithBundleFromPath(bundleName string, path string) BundleInfo
- func (r *FakeTestRegistryBuilder) WithCustomHandler(handler http.HandlerFunc)
- func (r *FakeTestRegistryBuilder) WithHandlerFunc(handler func(writer http.ResponseWriter, request *http.Request) bool)
- func (r *FakeTestRegistryBuilder) WithIdentityToken(idToken string)
- func (r *FakeTestRegistryBuilder) WithImage(imageNameFromTest string, image v1.Image) *ImageOrImageIndexWithTarPath
- func (r *FakeTestRegistryBuilder) WithImageFromPath(imageNameFromTest string, path string, labels map[string]string) *ImageOrImageIndexWithTarPath
- func (r *FakeTestRegistryBuilder) WithImageIndex(imageIndexName string, images ...mutate.Appendable) *ImageOrImageIndexWithTarPath
- func (r *FakeTestRegistryBuilder) WithImageStatusCodeRemap(img string, originalStatusCode int, remappedStatusCode int) *FakeTestRegistryBuilder
- func (r *FakeTestRegistryBuilder) WithImmutableTags(repo string, imgTag string) *FakeTestRegistryBuilder
- func (r *FakeTestRegistryBuilder) WithLocationsImage(bundleRef string, tmpFolder string, config bundle.ImageLocationsConfig) *ImageOrImageIndexWithTarPath
- func (r *FakeTestRegistryBuilder) WithNonDistributableLayerInImage(imageNames ...string)
- func (r *FakeTestRegistryBuilder) WithRandomBundle(bundleName string) BundleInfo
- func (r *FakeTestRegistryBuilder) WithRandomImage(imageNameFromTest string) *ImageOrImageIndexWithTarPath
- func (r *FakeTestRegistryBuilder) WithRegistryToken(regToken string)
- func (r *FakeTestRegistryBuilder) WithRequestLogging() *HTTPRequestLogs
- type HTTPRequestLog
- type HTTPRequestLogs
- type ImageFactory
- func (i *ImageFactory) Download(imgRef, location string)
- func (i *ImageFactory) ImageDigest(imgRef string) string
- func (i *ImageFactory) PushImageIndex(imgRef string)
- func (i *ImageFactory) PushImageWithANonDistributableLayer(imgRef string, mediaType types.MediaType) string
- func (i *ImageFactory) PushImageWithLayerSize(imgRef string, size int64) string
- func (i *ImageFactory) PushSimpleAppImageWithRandomFile(imgpkg Imgpkg, imgRef string) string
- func (i *ImageFactory) PushSimpleAppImageWithRandomFileWithAuth(imgpkg Imgpkg, imgRef string, host, username, password string) string
- func (i *ImageFactory) SignImage(imgRef string) string
- type ImageOrImageIndexWithTarPath
- type Imgpkg
- type LogLevel
- type Logger
- func (l Logger) Debugf(msg string, args ...interface{})
- func (l Logger) Errorf(msg string, args ...interface{})
- func (l Logger) Logf(msg string, args ...interface{})
- func (l Logger) Section(msg string, f func())
- func (l Logger) Tracef(msg string, args ...interface{})
- func (l Logger) Warnf(msg string, args ...interface{})
- type RunOpts
Constants ¶
const BundleFile = "bundle.yml"
const BundleYAML = `` /* 152-byte string literal not displayed */
const ImageFile = "images.yml"
const ImagesYAML = `---
apiVersion: imgpkg.carvel.dev/v1alpha1
kind: ImagesLock
`
Variables ¶
This section is empty.
Functions ¶
func CompareFiles ¶
Types ¶
type Assertion ¶
func (*Assertion) AssertBundleLock ¶
func (*Assertion) AssertImagesLock ¶
func (a *Assertion) AssertImagesLock(path string, images []lockconfig.ImageRef)
func (*Assertion) ImagesDigestIsOnTar ¶
func (*Assertion) ValidateCosignSignature ¶
func (*Assertion) ValidateImagesPresenceInRegistry ¶
type Assets ¶
func (*Assets) AddFileToFolder ¶
func (*Assets) CleanCreatedFolders ¶
func (a *Assets) CleanCreatedFolders()
func (*Assets) CreateAndCopySimpleApp ¶
func (*Assets) CreateTempFolder ¶
func (Assets) FilesInFolder ¶
func (Assets) SimpleAppDir ¶
func (*Assets) ValidateFilesAreEqual ¶
type BundleFactory ¶
type BundleFactory struct {
// contains filtered or unexported fields
}
func NewBundleDir ¶
func NewBundleDir(t *testing.T, assets *Assets) BundleFactory
func (*BundleFactory) AddFileToBundle ¶
func (b *BundleFactory) AddFileToBundle(path, content string)
func (*BundleFactory) CreateBundleDir ¶
func (b *BundleFactory) CreateBundleDir(bYml, iYml string) string
type BundleInfo ¶
type BundleInfo struct { Image v1.Image BundleName string BundlePath string Digest string RefDigest string // contains filtered or unexported fields }
func (BundleInfo) WithEveryImageFromPath ¶
func (b BundleInfo) WithEveryImageFromPath(path string, labels map[string]string) BundleInfo
func (BundleInfo) WithImageRefs ¶
func (b BundleInfo) WithImageRefs(imageRefs []lockconfig.ImageRef) BundleInfo
type Env ¶
type Env struct { Image string ImgpkgPath string RelocationRepo string BundleFactory BundleFactory Assets *Assets Assert Assertion ImageFactory ImageFactory Logger *Logger // contains filtered or unexported fields }
func (*Env) AddCleanup ¶
func (e *Env) AddCleanup(f func())
type FakeTestRegistryBuilder ¶
type FakeTestRegistryBuilder struct {
// contains filtered or unexported fields
}
func NewFakeRegistry ¶
func NewFakeRegistry(t *testing.T, logger *Logger) *FakeTestRegistryBuilder
func (*FakeTestRegistryBuilder) Build ¶
func (r *FakeTestRegistryBuilder) Build() registry.Registry
func (*FakeTestRegistryBuilder) BuildWithRegistryOpts ¶ added in v0.23.0
func (r *FakeTestRegistryBuilder) BuildWithRegistryOpts(opts registry.Opts) registry.Registry
BuildWithRegistryOpts Builds registry with provided Registry Opts
func (*FakeTestRegistryBuilder) CleanUp ¶
func (r *FakeTestRegistryBuilder) CleanUp()
func (*FakeTestRegistryBuilder) CopyAllImagesFromRepo ¶
func (r *FakeTestRegistryBuilder) CopyAllImagesFromRepo(imageRef, to string)
func (*FakeTestRegistryBuilder) CopyBundleImage ¶
func (r *FakeTestRegistryBuilder) CopyBundleImage(bundleInfo BundleInfo, to string) BundleInfo
func (*FakeTestRegistryBuilder) CopyFromImageRef ¶
func (r *FakeTestRegistryBuilder) CopyFromImageRef(imageRef, to string) *ImageOrImageIndexWithTarPath
func (*FakeTestRegistryBuilder) CopyImage ¶
func (r *FakeTestRegistryBuilder) CopyImage(img ImageOrImageIndexWithTarPath, to string) *ImageOrImageIndexWithTarPath
func (*FakeTestRegistryBuilder) Host ¶
func (r *FakeTestRegistryBuilder) Host() string
func (*FakeTestRegistryBuilder) ReferenceOnTestServer ¶
func (r *FakeTestRegistryBuilder) ReferenceOnTestServer(repo string) string
func (*FakeTestRegistryBuilder) RemoveByImageRef ¶
func (r *FakeTestRegistryBuilder) RemoveByImageRef(imageRef string)
RemoveByImageRef This function only works as expected before running Build() Prevents the creation in the registry of the image provided
func (*FakeTestRegistryBuilder) RemoveImage ¶
func (r *FakeTestRegistryBuilder) RemoveImage(imageRef string)
func (*FakeTestRegistryBuilder) ResetHandler ¶
func (r *FakeTestRegistryBuilder) ResetHandler() *FakeTestRegistryBuilder
func (*FakeTestRegistryBuilder) WithARandomImageIndex ¶
func (r *FakeTestRegistryBuilder) WithARandomImageIndex(imageName string, numImages int64) *ImageOrImageIndexWithTarPath
func (*FakeTestRegistryBuilder) WithBasicAuth ¶
func (r *FakeTestRegistryBuilder) WithBasicAuth(username string, password string)
func (*FakeTestRegistryBuilder) WithBasicAuthPerRepository ¶ added in v0.23.0
func (r *FakeTestRegistryBuilder) WithBasicAuthPerRepository(repo, username, password string)
WithBasicAuthPerRepository Adds authentication check for a particular repository
func (*FakeTestRegistryBuilder) WithBundleFromPath ¶
func (r *FakeTestRegistryBuilder) WithBundleFromPath(bundleName string, path string) BundleInfo
func (*FakeTestRegistryBuilder) WithCustomHandler ¶
func (r *FakeTestRegistryBuilder) WithCustomHandler(handler http.HandlerFunc)
func (*FakeTestRegistryBuilder) WithHandlerFunc ¶ added in v0.24.0
func (r *FakeTestRegistryBuilder) WithHandlerFunc(handler func(writer http.ResponseWriter, request *http.Request) bool)
WithHandlerFunc Adds authentication check for a particular repository
func (*FakeTestRegistryBuilder) WithIdentityToken ¶
func (r *FakeTestRegistryBuilder) WithIdentityToken(idToken string)
func (*FakeTestRegistryBuilder) WithImage ¶
func (r *FakeTestRegistryBuilder) WithImage(imageNameFromTest string, image v1.Image) *ImageOrImageIndexWithTarPath
func (*FakeTestRegistryBuilder) WithImageFromPath ¶
func (r *FakeTestRegistryBuilder) WithImageFromPath(imageNameFromTest string, path string, labels map[string]string) *ImageOrImageIndexWithTarPath
func (*FakeTestRegistryBuilder) WithImageIndex ¶
func (r *FakeTestRegistryBuilder) WithImageIndex(imageIndexName string, images ...mutate.Appendable) *ImageOrImageIndexWithTarPath
func (*FakeTestRegistryBuilder) WithImageStatusCodeRemap ¶
func (r *FakeTestRegistryBuilder) WithImageStatusCodeRemap(img string, originalStatusCode int, remappedStatusCode int) *FakeTestRegistryBuilder
func (*FakeTestRegistryBuilder) WithImmutableTags ¶
func (r *FakeTestRegistryBuilder) WithImmutableTags(repo string, imgTag string) *FakeTestRegistryBuilder
func (*FakeTestRegistryBuilder) WithLocationsImage ¶
func (r *FakeTestRegistryBuilder) WithLocationsImage(bundleRef string, tmpFolder string, config bundle.ImageLocationsConfig) *ImageOrImageIndexWithTarPath
func (*FakeTestRegistryBuilder) WithNonDistributableLayerInImage ¶
func (r *FakeTestRegistryBuilder) WithNonDistributableLayerInImage(imageNames ...string)
func (*FakeTestRegistryBuilder) WithRandomBundle ¶
func (r *FakeTestRegistryBuilder) WithRandomBundle(bundleName string) BundleInfo
func (*FakeTestRegistryBuilder) WithRandomImage ¶
func (r *FakeTestRegistryBuilder) WithRandomImage(imageNameFromTest string) *ImageOrImageIndexWithTarPath
func (*FakeTestRegistryBuilder) WithRegistryToken ¶
func (r *FakeTestRegistryBuilder) WithRegistryToken(regToken string)
func (*FakeTestRegistryBuilder) WithRequestLogging ¶
func (r *FakeTestRegistryBuilder) WithRequestLogging() *HTTPRequestLogs
WithRequestLogging enables the logging of the HTTP requests sent to the registry
type HTTPRequestLog ¶
HTTPRequestLog Log entry for HTTP requests sent to the registry
type HTTPRequestLogs ¶ added in v0.23.0
type HTTPRequestLogs struct {
// contains filtered or unexported fields
}
HTTPRequestLogs Slice of HTTP Requests
func NewHTTPRequestLogs ¶ added in v0.23.0
func NewHTTPRequestLogs() *HTTPRequestLogs
NewHTTPRequestLogs Build a new HTTPRequestLogs struct
func (*HTTPRequestLogs) Add ¶ added in v0.23.0
func (h *HTTPRequestLogs) Add(request HTTPRequestLog)
Add new HTTP Request to the Log
func (*HTTPRequestLogs) Last ¶ added in v0.23.0
func (h *HTTPRequestLogs) Last() HTTPRequestLog
Last Retrieve Last HTTP Request
func (*HTTPRequestLogs) Len ¶ added in v0.23.1
func (h *HTTPRequestLogs) Len() int
Len Length of request logs
type ImageFactory ¶
func (*ImageFactory) Download ¶
func (i *ImageFactory) Download(imgRef, location string)
func (*ImageFactory) ImageDigest ¶
func (i *ImageFactory) ImageDigest(imgRef string) string
func (*ImageFactory) PushImageIndex ¶
func (i *ImageFactory) PushImageIndex(imgRef string)
func (*ImageFactory) PushImageWithANonDistributableLayer ¶
func (i *ImageFactory) PushImageWithANonDistributableLayer(imgRef string, mediaType types.MediaType) string
func (*ImageFactory) PushImageWithLayerSize ¶
func (i *ImageFactory) PushImageWithLayerSize(imgRef string, size int64) string
func (*ImageFactory) PushSimpleAppImageWithRandomFile ¶
func (i *ImageFactory) PushSimpleAppImageWithRandomFile(imgpkg Imgpkg, imgRef string) string
func (*ImageFactory) PushSimpleAppImageWithRandomFileWithAuth ¶
func (i *ImageFactory) PushSimpleAppImageWithRandomFileWithAuth(imgpkg Imgpkg, imgRef string, host, username, password string) string
func (*ImageFactory) SignImage ¶
func (i *ImageFactory) SignImage(imgRef string) string
type ImageOrImageIndexWithTarPath ¶
type ImageOrImageIndexWithTarPath struct { Image v1.Image ImageIndex v1.ImageIndex RefDigest string Digest string Tag string // contains filtered or unexported fields }
func (*ImageOrImageIndexWithTarPath) WithNonDistributableLayer ¶
func (r *ImageOrImageIndexWithTarPath) WithNonDistributableLayer() *ImageOrImageIndexWithTarPath