Documentation ¶
Index ¶
- Constants
- func AddNotary(pod, notary string)
- func AddRegistry(pod, registry string)
- func AssertEquals(t *testing.T, expected, actual string)
- func DeleteLocalRepo(namespace, image, registry, notaryServer string) error
- func GetSettings(baseURL string) *models.Settings
- func SetLocalImages(images []string)
- func SetRemoteImages(images []string)
- func Setup() (*http.ServeMux, *httptest.Server, *url.URL)
- func Teardown(server *httptest.Server)
- type FakeImages
- func (d *FakeImages) AddTargetHash(repo notaryClient.Repository, digest *models.ContentDigest, tag string, ...) error
- func (d *FakeImages) CheckChangelist(repo notaryClient.Repository, ip prompts.IPrompts) error
- func (d *FakeImages) DeleteTag(imageName, tagName string) error
- func (d *FakeImages) DeleteTargets(repo notaryClient.Repository, tags []string, publish bool) error
- func (d *FakeImages) GetGloballyUniqueNamespace(name string, env *models.Environment, includeRegistry bool) (string, string, error)
- func (d *FakeImages) GetNotaryRepository(pod, imageName string, user *models.User) notaryClient.Repository
- func (d *FakeImages) InitNotaryRepo(repo notaryClient.Repository, rootKeyPath string) error
- func (d *FakeImages) ListImages() (*[]string, error)
- func (d *FakeImages) ListTags(imageName string) (*[]string, error)
- func (d *FakeImages) ListTargets(repo notaryClient.Repository, roles ...string) ([]*images.Target, error)
- func (d *FakeImages) LookupTarget(repo notaryClient.Repository, tag string) (*images.Target, error)
- func (d *FakeImages) PrintChangelist(changes []changelist.Change)
- func (d *FakeImages) Publish(repo notaryClient.Repository) error
- func (d *FakeImages) Pull(name string, target *images.Target, user *models.User, env *models.Environment) error
- func (d *FakeImages) Push(name string, user *models.User, env *models.Environment, ip prompts.IPrompts) (*models.Image, error)
- type FakePrompts
- func (f *FakePrompts) CaptureInput(msg string) string
- func (f *FakePrompts) EmailPassword(e, p string) (string, string, error)
- func (f *FakePrompts) GenericPrompt(msg, prompt string, validOptions []string) string
- func (f *FakePrompts) KeyPassphrase(string) string
- func (f *FakePrompts) OTP(string) string
- func (f *FakePrompts) PHI() error
- func (f *FakePrompts) Password(msg string) string
- func (f *FakePrompts) YesNo(msg, prompt string) error
Constants ¶
const ( Registry = "registry.datica.com" Image = "hello-world" Tag = "latest" )
Testing constants
const ( InvalidImageName = "Invalid image name" IncorrectNamespace = "Incorrect namespace for your environment" IncorrectRegistryOrNamespace = "Incorrect registry or namespace for your environment" MissingTrustData = "does not have trust data for" ImageDoesNotExist = "No such image" )
Errors for image handling
const ( Alias = "1" EnvID = "env1" EnvName = "cli-tests1" Namespace = "namespace1" OrgID = "org1" Pod = "pod1" SvcID = "svc1" SvcLabel = "code1" JobID = "00000000-0000-0000-0000-aaaaaaaaaaaa" Target = "target1" AliasAlt = "2" EnvIDAlt = "env2" EnvNameAlt = "cli-tests2" NamespaceAlt = "namespace2" OrgIDAlt = "org2" PodAlt = "pod2" SvcIDAlt = "svc2" SvcLabelAlt = "code2" JobIDAlt = "abcdefgh" TargetAlt = "target2" DownStream = "service_proxy" GoodDate = "2017-09-24T17:23:04.999999999Z07:00" BadDate = "2017-09-22T17:23:04.999999999Z07:00" )
const (
DefaultTag = "latest"
)
Constants for image handling
Variables ¶
This section is empty.
Functions ¶
func AssertEquals ¶
func DeleteLocalRepo ¶
DeleteLocalRepo deletes the local trust repo created in testing
func GetSettings ¶
func SetLocalImages ¶
func SetLocalImages(images []string)
SetLocalImages sets the mock list of local images
func SetRemoteImages ¶
func SetRemoteImages(images []string)
SetRemoteImages sets the mock list of remote images
Types ¶
type FakeImages ¶
FakeImages is a mock images struct
func (*FakeImages) AddTargetHash ¶
func (d *FakeImages) AddTargetHash(repo notaryClient.Repository, digest *models.ContentDigest, tag string, publish bool) error
AddTargetHash adds the given content hash to a notary repo and sends a signing request to the server
func (*FakeImages) CheckChangelist ¶
func (d *FakeImages) CheckChangelist(repo notaryClient.Repository, ip prompts.IPrompts) error
CheckChangelist prompts the user if they have unpublished changes to let them clear
undesired changes before publishing, or verify that the changes should be published
func (*FakeImages) DeleteTag ¶
func (d *FakeImages) DeleteTag(imageName, tagName string) error
DeleteTag stub to make golinter happy
func (*FakeImages) DeleteTargets ¶
func (d *FakeImages) DeleteTargets(repo notaryClient.Repository, tags []string, publish bool) error
DeleteTargets deletes the signed targets for a list of tags
func (*FakeImages) GetGloballyUniqueNamespace ¶
func (d *FakeImages) GetGloballyUniqueNamespace(name string, env *models.Environment, includeRegistry bool) (string, string, error)
GetGloballyUniqueNamespace returns the fully formatted name for an image <registry>/<namespace>/<image> and a tag if present
func (*FakeImages) GetNotaryRepository ¶
func (d *FakeImages) GetNotaryRepository(pod, imageName string, user *models.User) notaryClient.Repository
GetNotaryRepository returns a pointer to the notary repository for an image
func (*FakeImages) InitNotaryRepo ¶
func (d *FakeImages) InitNotaryRepo(repo notaryClient.Repository, rootKeyPath string) error
InitNotaryRepo intializes a notary repository
func (*FakeImages) ListImages ¶
func (d *FakeImages) ListImages() (*[]string, error)
ListImages stub to make golinter happy
func (*FakeImages) ListTags ¶
func (d *FakeImages) ListTags(imageName string) (*[]string, error)
ListTags stub to make golinter happy
func (*FakeImages) ListTargets ¶
func (d *FakeImages) ListTargets(repo notaryClient.Repository, roles ...string) ([]*images.Target, error)
ListTargets intializes a notary repository
func (*FakeImages) LookupTarget ¶
func (d *FakeImages) LookupTarget(repo notaryClient.Repository, tag string) (*images.Target, error)
LookupTarget searches for a specific target in a repository by tag name
func (*FakeImages) PrintChangelist ¶
func (d *FakeImages) PrintChangelist(changes []changelist.Change)
PrintChangelist prints out the users unpublished changes in a formatted table
func (*FakeImages) Publish ¶
func (d *FakeImages) Publish(repo notaryClient.Repository) error
Publish pretends to publish changes. But actually just clear the changes
type FakePrompts ¶
type FakePrompts struct{}
func (*FakePrompts) CaptureInput ¶
func (f *FakePrompts) CaptureInput(msg string) string
func (*FakePrompts) EmailPassword ¶
func (f *FakePrompts) EmailPassword(e, p string) (string, string, error)
func (*FakePrompts) GenericPrompt ¶
func (f *FakePrompts) GenericPrompt(msg, prompt string, validOptions []string) string
func (*FakePrompts) KeyPassphrase ¶
func (f *FakePrompts) KeyPassphrase(string) string
func (*FakePrompts) OTP ¶
func (f *FakePrompts) OTP(string) string
func (*FakePrompts) PHI ¶
func (f *FakePrompts) PHI() error
func (*FakePrompts) Password ¶
func (f *FakePrompts) Password(msg string) string
func (*FakePrompts) YesNo ¶
func (f *FakePrompts) YesNo(msg, prompt string) error