Merge branch 'release-1.8.0' of github.com:goharbor/harbor into release-1.8.0

This commit is contained in:
Steven Zou 2019-06-14 12:38:06 +08:00
commit c44bcca0b3
9 changed files with 37 additions and 18 deletions

View File

@ -2,7 +2,7 @@ swagger: '2.0'
info:
title: Harbor API
description: These APIs provide services for manipulating Harbor project.
version: 1.7.0
version: 1.8.0
host: localhost
schemes:
- http

View File

@ -25,6 +25,7 @@ import (
"time"
"errors"
"github.com/docker/distribution/manifest/schema1"
"github.com/docker/distribution/manifest/schema2"
"github.com/goharbor/harbor/src/common"
@ -682,14 +683,17 @@ func getTagDetail(client *registry.Repository, tag string) (*tagDetail, error) {
Name: tag,
}
digest, _, payload, err := client.PullManifest(tag, []string{schema2.MediaTypeManifest})
digest, mediaType, payload, err := client.PullManifest(tag, []string{schema2.MediaTypeManifest})
if err != nil {
return detail, err
}
detail.Digest = digest
manifest := &schema2.DeserializedManifest{}
if err = manifest.UnmarshalJSON(payload); err != nil {
if strings.Contains(mediaType, "application/json") {
mediaType = schema1.MediaTypeManifest
}
manifest, _, err := registry.UnMarshal(mediaType, payload)
if err != nil {
return detail, err
}
@ -699,7 +703,21 @@ func getTagDetail(client *registry.Repository, tag string) (*tagDetail, error) {
detail.Size += ref.Size
}
_, reader, err := client.PullBlob(manifest.Target().Digest.String())
// if the media type of the manifest isn't v2, doesn't parse image config
// and return directly
// this impacts that some detail information(os, arch, ...) of old images
// cannot be got
if mediaType != schema2.MediaTypeManifest {
log.Debugf("the media type of the manifest is %s, not v2, skip", mediaType)
return detail, nil
}
v2Manifest, ok := manifest.(*schema2.DeserializedManifest)
if !ok {
log.Debug("the manifest cannot be convert to DeserializedManifest, skip")
return detail, nil
}
_, reader, err := client.PullBlob(v2Manifest.Target().Digest.String())
if err != nil {
return detail, err
}

View File

@ -1,6 +1,6 @@
{
"name": "@harbor/ui",
"version": "1.7.4-rc2",
"version": "1.8.0-rc2",
"description": "Harbor shared UI components based on Clarity and Angular7",
"author": "CNCF",
"module": "index.js",

View File

@ -1,6 +1,6 @@
{
"name": "harbor",
"version": "1.7.1",
"version": "1.8.0",
"lockfileVersion": 1,
"requires": true,
"dependencies": {

View File

@ -1,6 +1,6 @@
{
"name": "harbor",
"version": "1.7.1",
"version": "1.8.0",
"description": "Harbor UI with Clarity",
"angular-cli": {},
"scripts": {

View File

@ -60,13 +60,13 @@
</clr-tooltip-content>
</clr-tooltip></label>
<input type="password" name="cli_password" disabled [ngModel]="'account.oidc_user_meta.secret'" size="33">
<button (click)="generateCli(account.user_id)" class="btn btn-outline btn-sm btn-padding-less" *ngIf="showGenerateCli">
<button (click)="generateCli(account.user_id)" id="generate-cli-btn" class="btn btn-outline btn-sm btn-padding-less" *ngIf="showGenerateCli">
{{'PROFILE.ADMIN_CIL_SECRET_BUTTON' | translate}}
</button>
<div class="rename-tool reset-cli">
<hbr-copy-input #copyInput (onCopySuccess)="onSuccess($event)" (onCopyError)="onError($event)" iconMode="true" [defaultValue]="account.oidc_user_meta.secret"></hbr-copy-input>
</div>
<div (click)="showGenerateCliFn()" *ngIf="!showGenerateCli" class="hidden-generate-cli">···</div>
<div (click)="showGenerateCliFn()" *ngIf="!showGenerateCli" id="hidden-generate-cli" class="hidden-generate-cli">···</div>
</div>
</section>
</form>

View File

@ -32,6 +32,7 @@ import { ProjectConfigComponent } from './project/project-config/project-config.
import zh from '@angular/common/locales/zh-Hans';
import es from '@angular/common/locales/es';
import localeFr from '@angular/common/locales/fr';
import localePt from '@angular/common/locales/pt-PT';
import { DevCenterComponent } from './dev-center/dev-center.component';
import { VulnerabilityPageComponent } from './vulnerability-page/vulnerability-page.component';
import { GcPageComponent } from './gc-page/gc-page.component';
@ -39,6 +40,7 @@ import { OidcOnboardModule } from './oidc-onboard/oidc-onboard.module';
registerLocaleData(zh, 'zh-cn');
registerLocaleData(es, 'es-es');
registerLocaleData(localeFr, 'fr-fr');
registerLocaleData(localePt, 'pt-br');
export function initConfig(configService: AppConfigService, skinableService: SkinableConfig) {

View File

@ -41,7 +41,8 @@
}
.nav-icon-width {
width: 98px !important;
width: auto !important;
padding-left: 18px !important;
.icon-left {
left: -8px;
}

View File

@ -211,18 +211,15 @@ func (t *transfer) copyContent(content distribution.Descriptor, srcRepo, dstRepo
case schema2.MediaTypeManifest:
// as using digest as the reference, so set the override to true directly
return t.copyImage(srcRepo, digest, dstRepo, digest, true)
// copy layer or image config
case schema2.MediaTypeLayer, schema2.MediaTypeImageConfig:
return t.copyBlob(srcRepo, dstRepo, digest)
// handle foreign layer
case schema2.MediaTypeForeignLayer:
t.logger.Infof("the layer %s is a foreign layer, skip", digest)
return nil
// others
// copy layer or image config
// the media type of the layer or config can be "application/octet-stream",
// schema1.MediaTypeManifestLayer, schema2.MediaTypeLayer, schema2.MediaTypeImageConfig
default:
err := fmt.Errorf("unsupported media type: %s", content.MediaType)
t.logger.Error(err.Error())
return err
return t.copyBlob(srcRepo, dstRepo, digest)
}
}
@ -288,6 +285,7 @@ func (t *transfer) handleManifest(manifest distribution.Manifest, repository, di
}
// manifest
if mediaType == schema1.MediaTypeManifest ||
mediaType == schema1.MediaTypeSignedManifest ||
mediaType == schema2.MediaTypeManifest {
return manifest, digest, nil
}