From 62cdff93df24ac1c11e5e03f0778974a676dd081 Mon Sep 17 00:00:00 2001 From: Karolis Rusenas Date: Sat, 3 Mar 2018 20:06:30 +0000 Subject: [PATCH] registry test --- registry/registry_test.go | 35 +++++++++++++++++++++++++++++++++++ 1 file changed, 35 insertions(+) diff --git a/registry/registry_test.go b/registry/registry_test.go index a23af9fc..70b0226a 100644 --- a/registry/registry_test.go +++ b/registry/registry_test.go @@ -41,6 +41,41 @@ func TestGet(t *testing.T) { fmt.Println(repo.Tags) } +// https://registry.opensource.zalan.do/v2/teapot/external-dns +func TestGetNonDockerRegistryTags(t *testing.T) { + client := New() + + repo, err := client.Get(Opts{ + Registry: "https://registry.opensource.zalan.do", + Name: "teapot/external-dns", + }) + + if err != nil { + t.Errorf("error while getting repo: %s", err) + } + + fmt.Println(repo.Name) + fmt.Println(repo.Tags) +} + +func TestGetNonDockerRegistryManifest(t *testing.T) { + client := New() + + d, err := client.Digest(Opts{ + Registry: "https://registry.opensource.zalan.do", + Name: "teapot/external-dns", + Tag: "v0.4.8", + }) + + if err != nil { + t.Errorf("error while getting repo manifest: %s", err) + } + + if d != "sha256:7aa5175f39a7e8a4172972524302c9a8196f681e40d6ee5d2f6bf0ab7d600fee" { + t.Errorf("unexpected sha?") + } +} + var EnvArtifactoryUsername = "ARTIFACTORY_USERNAME" var EnvArtifactoryPassword = "ARTIFACTORY_PASSWORD"