mirror of
https://github.com/goharbor/harbor.git
synced 2025-01-30 19:41:29 +01:00
fix issue
Signed-off-by: stonezdj <stonezdj@gmail.com>
This commit is contained in:
parent
918fe125b7
commit
e6f80259f7
@ -171,15 +171,15 @@ func (c *clientTestSuite) TestManifestExist() {
|
|||||||
|
|
||||||
client := NewClient(server.URL, "", "", true)
|
client := NewClient(server.URL, "", "", true)
|
||||||
// doesn't exist
|
// doesn't exist
|
||||||
exist, digest, err := client.ManifestExist("library/alpine", "latest")
|
exist, desc, err := client.ManifestExist("library/alpine", "latest")
|
||||||
c.Require().Nil(err)
|
c.Require().Nil(err)
|
||||||
c.False(exist)
|
c.False(exist)
|
||||||
|
|
||||||
// exist
|
// exist
|
||||||
exist, digest, err = client.ManifestExist("library/hello-world", "latest")
|
exist, desc, err = client.ManifestExist("library/hello-world", "latest")
|
||||||
c.Require().Nil(err)
|
c.Require().Nil(err)
|
||||||
c.True(exist)
|
c.True(exist)
|
||||||
c.Equal("digest", digest)
|
c.Equal("digest", string(desc.Digest))
|
||||||
}
|
}
|
||||||
|
|
||||||
func (c *clientTestSuite) TestPullManifest() {
|
func (c *clientTestSuite) TestPullManifest() {
|
||||||
|
@ -44,7 +44,7 @@ func TestAdapter_FetchArtifacts(t *testing.T) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
func TestAdapter_ManifestExist(t *testing.T) {
|
func TestAdapter_ManifestExist(t *testing.T) {
|
||||||
exist, digest, err := HWAdapter.ManifestExist("", "")
|
exist, desc, err := HWAdapter.ManifestExist("", "")
|
||||||
if err != nil {
|
if err != nil {
|
||||||
if strings.HasPrefix(err.Error(), "[401]") {
|
if strings.HasPrefix(err.Error(), "[401]") {
|
||||||
t.Log("huawei ak/sk is not available", err.Error())
|
t.Log("huawei ak/sk is not available", err.Error())
|
||||||
@ -53,7 +53,7 @@ func TestAdapter_ManifestExist(t *testing.T) {
|
|||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
if exist {
|
if exist {
|
||||||
t.Log(digest)
|
t.Log(desc.Digest)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user