2021-06-07 04:06:06 +02:00
|
|
|
import { Component, Input, OnDestroy, OnInit, ViewChild } from '@angular/core';
|
|
|
|
import { forkJoin, Observable, of, Subject, Subscription } from 'rxjs';
|
|
|
|
import { catchError, debounceTime, distinctUntilChanged, finalize, map, switchMap } from 'rxjs/operators';
|
2020-02-13 08:39:29 +01:00
|
|
|
import { TranslateService } from '@ngx-translate/core';
|
|
|
|
import { NgForm } from '@angular/forms';
|
2021-02-18 02:12:23 +01:00
|
|
|
import { AVAILABLE_TIME } from "../artifact-list-page/artifact-list/artifact-list-tab/artifact-list-tab.component";
|
|
|
|
import { OperationService } from "../../../../../shared/components/operation/operation.service";
|
|
|
|
import { ErrorHandler } from "../../../../../shared/units/error-handler";
|
|
|
|
import { ConfirmationButtons, ConfirmationState, ConfirmationTargets } from "../../../../../shared/entities/shared.const";
|
|
|
|
import { operateChanges, OperateInfo, OperationState } from "../../../../../shared/components/operation/operate";
|
2022-03-18 12:41:59 +01:00
|
|
|
import { AccessoryQueryParams, AccessoryType, ArtifactFront as Artifact, ArtifactType, getPullCommandByTag } from '../artifact';
|
2021-02-18 02:12:23 +01:00
|
|
|
import { ArtifactService } from '../../../../../../../ng-swagger-gen/services/artifact.service';
|
|
|
|
import { Tag } from '../../../../../../../ng-swagger-gen/models/tag';
|
2021-06-07 04:06:06 +02:00
|
|
|
import { SystemInfo, SystemInfoService, UserPermissionService, USERSTATICPERMISSION } from "../../../../../shared/services";
|
2020-03-31 08:23:49 +02:00
|
|
|
import { ClrDatagridStateInterface } from '@clr/angular';
|
2020-04-13 05:26:03 +02:00
|
|
|
import {
|
|
|
|
calculatePage,
|
|
|
|
dbEncodeURIComponent,
|
|
|
|
doFiltering,
|
2022-04-29 10:24:07 +02:00
|
|
|
doSorting, getPageSizeFromLocalStorage,
|
|
|
|
getSortingString, PageSizeMapKeys, setPageSizeToLocalStorage
|
2021-02-18 02:12:23 +01:00
|
|
|
} from '../../../../../shared/units/utils';
|
|
|
|
import { AppConfigService } from "../../../../../services/app-config.service";
|
|
|
|
import { errorHandler } from "../../../../../shared/units/shared.utils";
|
|
|
|
import { ConfirmationDialogComponent } from "../../../../../shared/components/confirmation-dialog";
|
|
|
|
import { ConfirmationMessage } from "../../../../global-confirmation-dialog/confirmation-message";
|
|
|
|
import { ConfirmationAcknowledgement } from "../../../../global-confirmation-dialog/confirmation-state-message";
|
2022-03-03 03:06:28 +01:00
|
|
|
import { ActivatedRoute } from '@angular/router';
|
2020-03-31 08:23:49 +02:00
|
|
|
|
2020-02-13 08:39:29 +01:00
|
|
|
class InitTag {
|
|
|
|
name = "";
|
|
|
|
}
|
2020-04-17 06:12:16 +02:00
|
|
|
const DeleteTagWithNotoryCommand1 = 'notary -s https://';
|
2020-09-14 12:39:22 +02:00
|
|
|
const DeleteTagWithNotoryCommand2 = ':4443 -d ~/.docker/trust remove -p ';
|
2020-02-13 08:39:29 +01:00
|
|
|
@Component({
|
|
|
|
selector: 'artifact-tag',
|
|
|
|
templateUrl: './artifact-tag.component.html',
|
|
|
|
styleUrls: ['./artifact-tag.component.scss']
|
|
|
|
})
|
2020-04-07 10:28:51 +02:00
|
|
|
export class ArtifactTagComponent implements OnInit, OnDestroy {
|
2020-02-13 08:39:29 +01:00
|
|
|
@Input() artifactDetails: Artifact;
|
|
|
|
@Input() projectName: string;
|
2020-09-07 04:17:59 +02:00
|
|
|
@Input() isProxyCacheProject: boolean = false;
|
2020-03-24 03:56:18 +01:00
|
|
|
@Input() projectId: number;
|
2020-02-13 08:39:29 +01:00
|
|
|
@Input() repositoryName: string;
|
|
|
|
newTagName = new InitTag();
|
|
|
|
newTagForm: NgForm;
|
|
|
|
@ViewChild("newTagForm", { static: true }) currentForm: NgForm;
|
|
|
|
selectedRow: Tag[] = [];
|
|
|
|
isTagNameExist = false;
|
|
|
|
newTagformShow = false;
|
2020-03-31 08:23:49 +02:00
|
|
|
loading = true;
|
2020-02-13 08:39:29 +01:00
|
|
|
openTag = false;
|
|
|
|
availableTime = AVAILABLE_TIME;
|
2020-09-22 11:42:01 +02:00
|
|
|
@ViewChild("confirmationDialog")
|
2020-02-13 08:39:29 +01:00
|
|
|
confirmationDialog: ConfirmationDialogComponent;
|
2020-03-24 03:56:18 +01:00
|
|
|
hasDeleteTagPermission: boolean;
|
2020-03-31 08:23:49 +02:00
|
|
|
hasCreateTagPermission: boolean;
|
|
|
|
|
|
|
|
totalCount: number = 0;
|
|
|
|
allTags: Tag[] = [];
|
|
|
|
currentTags: Tag[] = [];
|
2022-04-29 10:24:07 +02:00
|
|
|
pageSize: number = getPageSizeFromLocalStorage(PageSizeMapKeys.ARTIFACT_TAGS_COMPONENT);
|
2020-03-31 08:23:49 +02:00
|
|
|
currentPage = 1;
|
2020-04-07 10:28:51 +02:00
|
|
|
tagNameChecker: Subject<string> = new Subject<string>();
|
|
|
|
tagNameCheckSub: Subscription;
|
|
|
|
tagNameCheckOnGoing = false;
|
2020-04-17 06:12:16 +02:00
|
|
|
systemInfo: SystemInfo;
|
2022-03-03 03:06:28 +01:00
|
|
|
accessoryType: string;
|
2020-02-13 08:39:29 +01:00
|
|
|
constructor(
|
|
|
|
private operationService: OperationService,
|
2020-03-16 07:00:51 +01:00
|
|
|
private artifactService: ArtifactService,
|
2020-02-13 08:39:29 +01:00
|
|
|
private translateService: TranslateService,
|
2020-03-24 03:56:18 +01:00
|
|
|
private userPermissionService: UserPermissionService,
|
2020-04-17 06:12:16 +02:00
|
|
|
private systemInfoService: SystemInfoService,
|
2020-04-09 07:08:39 +02:00
|
|
|
private appConfigService: AppConfigService,
|
2022-03-03 03:06:28 +01:00
|
|
|
private errorHandlerService: ErrorHandler,
|
|
|
|
private activatedRoute: ActivatedRoute,
|
2020-02-13 08:39:29 +01:00
|
|
|
|
2022-03-03 03:06:28 +01:00
|
|
|
) {
|
|
|
|
this.accessoryType = this.activatedRoute.snapshot.queryParams[AccessoryQueryParams.ACCESSORY_TYPE];
|
|
|
|
}
|
2020-02-13 08:39:29 +01:00
|
|
|
ngOnInit() {
|
2020-03-24 03:56:18 +01:00
|
|
|
this.getImagePermissionRule(this.projectId);
|
2020-04-07 10:28:51 +02:00
|
|
|
this.invalidCreateTag();
|
2020-04-17 06:12:16 +02:00
|
|
|
this.systemInfoService.getSystemInfo()
|
|
|
|
.subscribe(systemInfo => this.systemInfo = systemInfo, error => this.errorHandlerService.error(error));
|
2020-04-07 10:28:51 +02:00
|
|
|
}
|
|
|
|
checkTagName(name) {
|
2020-11-26 07:39:33 +01:00
|
|
|
const listTagParams: ArtifactService.ListTagsParams = {
|
2020-04-07 10:28:51 +02:00
|
|
|
projectName: this.projectName,
|
2020-04-07 11:06:26 +02:00
|
|
|
repositoryName: dbEncodeURIComponent(this.repositoryName),
|
2020-11-26 07:39:33 +01:00
|
|
|
reference: this.artifactDetails.digest,
|
|
|
|
withSignature: true,
|
|
|
|
withImmutableStatus: true,
|
|
|
|
q: encodeURIComponent(`name=${name}`)
|
2020-04-07 10:28:51 +02:00
|
|
|
};
|
2020-11-26 07:39:33 +01:00
|
|
|
return this.artifactService.listTags(listTagParams)
|
2020-04-07 10:28:51 +02:00
|
|
|
.pipe(finalize(() => this.tagNameCheckOnGoing = false));
|
|
|
|
}
|
|
|
|
invalidCreateTag() {
|
|
|
|
if (!this.tagNameCheckSub) {
|
|
|
|
this.tagNameCheckSub = this.tagNameChecker
|
2020-11-26 07:39:33 +01:00
|
|
|
.pipe(debounceTime(500))
|
2020-04-07 10:28:51 +02:00
|
|
|
.pipe(distinctUntilChanged())
|
|
|
|
.pipe(switchMap(name => {
|
|
|
|
this.tagNameCheckOnGoing = true;
|
|
|
|
this.isTagNameExist = false;
|
|
|
|
return this.checkTagName(name);
|
|
|
|
}))
|
|
|
|
.subscribe(response => {
|
|
|
|
// tag existing
|
|
|
|
if (response && response.length) {
|
|
|
|
this.isTagNameExist = true;
|
|
|
|
}
|
|
|
|
}, error => {
|
|
|
|
this.errorHandlerService.error(error);
|
|
|
|
});
|
|
|
|
}
|
2020-03-31 08:23:49 +02:00
|
|
|
}
|
|
|
|
getCurrentArtifactTags(state: ClrDatagridStateInterface) {
|
|
|
|
if (!state || !state.page) {
|
|
|
|
return ;
|
|
|
|
}
|
2020-10-16 11:17:33 +02:00
|
|
|
this.pageSize = state.page.size;
|
2022-04-29 10:24:07 +02:00
|
|
|
setPageSizeToLocalStorage(PageSizeMapKeys.ARTIFACT_TAGS_COMPONENT, this.pageSize);
|
2020-03-31 08:23:49 +02:00
|
|
|
let pageNumber: number = calculatePage(state);
|
|
|
|
if (pageNumber <= 0) { pageNumber = 1; }
|
2020-04-07 10:28:51 +02:00
|
|
|
let params: ArtifactService.ListTagsParams = {
|
2020-03-31 08:23:49 +02:00
|
|
|
projectName: this.projectName,
|
2020-04-07 11:06:26 +02:00
|
|
|
repositoryName: dbEncodeURIComponent(this.repositoryName),
|
2020-04-07 10:28:51 +02:00
|
|
|
reference: this.artifactDetails.digest,
|
2020-03-31 08:23:49 +02:00
|
|
|
page: pageNumber,
|
|
|
|
withSignature: true,
|
|
|
|
withImmutableStatus: true,
|
2021-03-15 03:07:31 +01:00
|
|
|
pageSize: this.pageSize,
|
|
|
|
sort: getSortingString(state)
|
2020-03-31 08:23:49 +02:00
|
|
|
};
|
2021-03-15 03:07:31 +01:00
|
|
|
this.loading = true;
|
2020-04-07 10:28:51 +02:00
|
|
|
this.artifactService.listTagsResponse(params).pipe(finalize(() => {
|
2020-03-31 08:23:49 +02:00
|
|
|
this.loading = false;
|
|
|
|
})).subscribe(res => {
|
|
|
|
if (res.headers) {
|
|
|
|
let xHeader: string = res.headers.get("x-total-count");
|
|
|
|
if (xHeader) {
|
2022-03-18 12:41:59 +01:00
|
|
|
this.totalCount = Number.parseInt(xHeader, 10);
|
2020-03-31 08:23:49 +02:00
|
|
|
}
|
|
|
|
}
|
|
|
|
this.currentTags = res.body;
|
2020-04-13 05:26:03 +02:00
|
|
|
// Do customising filtering and sorting
|
|
|
|
this.currentTags = doFiltering<Tag>(this.currentTags, state);
|
|
|
|
this.currentTags = doSorting<Tag>(this.currentTags, state);
|
2020-03-31 08:23:49 +02:00
|
|
|
}, error => {
|
|
|
|
this.errorHandlerService.error(error);
|
|
|
|
});
|
|
|
|
}
|
2020-03-24 03:56:18 +01:00
|
|
|
getImagePermissionRule(projectId: number): void {
|
|
|
|
const permissions = [
|
2020-03-31 08:23:49 +02:00
|
|
|
{ resource: USERSTATICPERMISSION.REPOSITORY_TAG.KEY, action: USERSTATICPERMISSION.REPOSITORY_TAG.VALUE.DELETE },
|
|
|
|
{ resource: USERSTATICPERMISSION.REPOSITORY_TAG.KEY, action: USERSTATICPERMISSION.REPOSITORY_TAG.VALUE.CREATE },
|
|
|
|
|
2020-03-24 03:56:18 +01:00
|
|
|
];
|
|
|
|
this.userPermissionService.hasProjectPermissions(this.projectId, permissions).subscribe((results: Array<boolean>) => {
|
|
|
|
this.hasDeleteTagPermission = results[0];
|
2020-03-31 08:23:49 +02:00
|
|
|
this.hasCreateTagPermission = results[1];
|
2020-03-24 03:56:18 +01:00
|
|
|
}, error => this.errorHandlerService.error(error));
|
2020-02-13 08:39:29 +01:00
|
|
|
}
|
|
|
|
|
|
|
|
addTag() {
|
|
|
|
this.newTagformShow = true;
|
|
|
|
|
|
|
|
}
|
|
|
|
cancelAddTag() {
|
|
|
|
this.newTagformShow = false;
|
|
|
|
this.newTagName = new InitTag();
|
|
|
|
}
|
|
|
|
saveAddTag() {
|
2020-03-16 07:00:51 +01:00
|
|
|
// const tag: NewTag = {name: this.newTagName};
|
|
|
|
const createTagParams: ArtifactService.CreateTagParams = {
|
|
|
|
projectName: this.projectName,
|
2020-04-09 07:08:39 +02:00
|
|
|
repositoryName: dbEncodeURIComponent(this.repositoryName),
|
2020-03-16 07:00:51 +01:00
|
|
|
reference: this.artifactDetails.digest,
|
|
|
|
tag: this.newTagName
|
|
|
|
};
|
2020-03-31 08:23:49 +02:00
|
|
|
this.loading = true;
|
2020-03-16 07:00:51 +01:00
|
|
|
this.artifactService.createTag(createTagParams).subscribe(res => {
|
2020-02-13 08:39:29 +01:00
|
|
|
this.newTagformShow = false;
|
|
|
|
this.newTagName = new InitTag();
|
2021-01-27 08:38:17 +01:00
|
|
|
this.refresh();
|
2020-02-13 08:39:29 +01:00
|
|
|
}, error => {
|
2020-03-31 08:23:49 +02:00
|
|
|
this.loading = false;
|
2020-02-20 09:12:46 +01:00
|
|
|
this.errorHandlerService.error(error);
|
2020-02-13 08:39:29 +01:00
|
|
|
});
|
|
|
|
}
|
|
|
|
removeTag() {
|
|
|
|
if (this.selectedRow && this.selectedRow.length) {
|
|
|
|
let tagNames: string[] = [];
|
|
|
|
this.selectedRow.forEach(artifact => {
|
|
|
|
tagNames.push(artifact.name);
|
|
|
|
});
|
|
|
|
let titleKey: string, summaryKey: string, content: string, buttons: ConfirmationButtons;
|
|
|
|
titleKey = "REPOSITORY.DELETION_TITLE_TAG";
|
|
|
|
summaryKey = "REPOSITORY.DELETION_SUMMARY_TAG";
|
|
|
|
buttons = ConfirmationButtons.DELETE_CANCEL;
|
|
|
|
content = tagNames.join(" , ");
|
|
|
|
|
|
|
|
let message = new ConfirmationMessage(
|
|
|
|
titleKey,
|
|
|
|
summaryKey,
|
|
|
|
content,
|
|
|
|
this.selectedRow,
|
|
|
|
ConfirmationTargets.TAG,
|
|
|
|
buttons);
|
|
|
|
this.confirmationDialog.open(message);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
confirmDeletion(message: ConfirmationAcknowledgement) {
|
|
|
|
if (message &&
|
|
|
|
message.source === ConfirmationTargets.TAG
|
|
|
|
&& message.state === ConfirmationState.CONFIRMED) {
|
|
|
|
let tagList: Tag[] = message.data;
|
|
|
|
if (tagList && tagList.length) {
|
|
|
|
let observableLists: any[] = [];
|
|
|
|
tagList.forEach(tag => {
|
|
|
|
observableLists.push(this.delOperate(tag));
|
|
|
|
});
|
2020-03-31 08:23:49 +02:00
|
|
|
this.loading = true;
|
|
|
|
forkJoin(...observableLists).subscribe((deleteResult) => {
|
2020-02-13 08:39:29 +01:00
|
|
|
// if delete one success refresh list
|
2020-03-31 08:23:49 +02:00
|
|
|
let deleteSuccessList = [];
|
|
|
|
let deleteErrorList = [];
|
|
|
|
deleteResult.forEach(result => {
|
|
|
|
if (!result) {
|
|
|
|
// delete success
|
|
|
|
deleteSuccessList.push(result);
|
|
|
|
} else {
|
|
|
|
deleteErrorList.push(result);
|
|
|
|
}
|
|
|
|
});
|
|
|
|
this.selectedRow = [];
|
|
|
|
if (deleteSuccessList.length === deleteResult.length) {
|
|
|
|
// all is success
|
2021-01-27 08:38:17 +01:00
|
|
|
this.refresh();
|
2020-03-31 08:23:49 +02:00
|
|
|
} else if (deleteErrorList.length === deleteResult.length) {
|
|
|
|
// all is error
|
|
|
|
this.loading = false;
|
2020-07-17 07:25:46 +02:00
|
|
|
this.errorHandlerService.error(deleteResult[deleteResult.length - 1]);
|
2020-03-31 08:23:49 +02:00
|
|
|
} else {
|
|
|
|
// some artifact delete success but it has error delete things
|
2020-07-17 07:25:46 +02:00
|
|
|
this.errorHandlerService.error(deleteErrorList[deleteErrorList.length - 1]);
|
2020-03-31 08:23:49 +02:00
|
|
|
// if delete one success refresh list
|
|
|
|
this.currentPage = 1;
|
|
|
|
let st: ClrDatagridStateInterface = { page: {from: 0, to: this.pageSize - 1, size: this.pageSize} };
|
|
|
|
this.getCurrentArtifactTags(st);
|
2020-02-13 08:39:29 +01:00
|
|
|
}
|
|
|
|
});
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
2020-09-14 12:39:22 +02:00
|
|
|
deletePort(url): string {
|
|
|
|
if (url && url.indexOf(':') !== -1) {
|
|
|
|
return url.split(':')[0];
|
|
|
|
}
|
|
|
|
return url;
|
|
|
|
}
|
2020-04-17 10:04:16 +02:00
|
|
|
delOperate(tag: Tag): Observable<any> | null {
|
2020-02-13 08:39:29 +01:00
|
|
|
// init operation info
|
|
|
|
let operMessage = new OperateInfo();
|
|
|
|
operMessage.name = 'OPERATION.DELETE_TAG';
|
|
|
|
operMessage.state = OperationState.progressing;
|
|
|
|
operMessage.data.name = tag.name;
|
|
|
|
this.operationService.publishInfo(operMessage);
|
2020-04-17 06:12:16 +02:00
|
|
|
|
2020-04-17 10:04:16 +02:00
|
|
|
if (tag.signed) {
|
2020-04-17 06:12:16 +02:00
|
|
|
forkJoin(this.translateService.get("BATCH.DELETED_FAILURE"),
|
|
|
|
this.translateService.get("REPOSITORY.DELETION_SUMMARY_TAG_DENIED")).subscribe(res => {
|
2020-09-14 12:39:22 +02:00
|
|
|
const wrongInfo: string = res[1] + DeleteTagWithNotoryCommand1 + this.deletePort(this.registryUrl) +
|
2020-04-17 06:12:16 +02:00
|
|
|
DeleteTagWithNotoryCommand2 +
|
|
|
|
this.registryUrl + "/" + this.repositoryName +
|
2020-09-14 12:39:22 +02:00
|
|
|
" " + tag.name;
|
2020-04-17 06:12:16 +02:00
|
|
|
operateChanges(operMessage, OperationState.failure, wrongInfo);
|
|
|
|
});
|
|
|
|
return of(null);
|
|
|
|
} else {
|
2020-03-16 07:00:51 +01:00
|
|
|
const deleteTagParams: ArtifactService.DeleteTagParams = {
|
|
|
|
projectName: this.projectName,
|
2020-04-09 07:08:39 +02:00
|
|
|
repositoryName: dbEncodeURIComponent(this.repositoryName),
|
2020-03-16 07:00:51 +01:00
|
|
|
reference: this.artifactDetails.digest,
|
|
|
|
tagName: tag.name
|
|
|
|
};
|
|
|
|
return this.artifactService.deleteTag(deleteTagParams)
|
2020-02-13 08:39:29 +01:00
|
|
|
.pipe(map(
|
|
|
|
response => {
|
|
|
|
this.translateService.get("BATCH.DELETED_SUCCESS")
|
|
|
|
.subscribe(res => {
|
|
|
|
operateChanges(operMessage, OperationState.success);
|
|
|
|
});
|
|
|
|
}), catchError(error => {
|
2020-02-20 09:12:46 +01:00
|
|
|
const message = errorHandler(error);
|
2020-02-13 08:39:29 +01:00
|
|
|
this.translateService.get(message).subscribe(res =>
|
|
|
|
operateChanges(operMessage, OperationState.failure, res)
|
|
|
|
);
|
|
|
|
return of(error);
|
|
|
|
}));
|
2020-04-17 06:12:16 +02:00
|
|
|
}
|
2020-02-13 08:39:29 +01:00
|
|
|
}
|
|
|
|
|
|
|
|
existValid(name) {
|
2020-04-07 10:28:51 +02:00
|
|
|
if (name) {
|
|
|
|
this.tagNameChecker.next(name);
|
2020-04-07 11:06:26 +02:00
|
|
|
} else {
|
|
|
|
this.isTagNameExist = false;
|
2020-02-13 08:39:29 +01:00
|
|
|
}
|
|
|
|
}
|
|
|
|
toggleTagListOpenOrClose() {
|
|
|
|
this.openTag = !this.openTag;
|
|
|
|
this.newTagformShow = false;
|
|
|
|
}
|
2020-03-24 03:56:18 +01:00
|
|
|
hasImmutableOnTag(): boolean {
|
|
|
|
return this.selectedRow.some((artifact) => artifact.immutable);
|
|
|
|
}
|
2020-03-31 08:23:49 +02:00
|
|
|
refresh() {
|
|
|
|
this.loading = true;
|
|
|
|
this.currentPage = 1;
|
2021-01-27 08:38:17 +01:00
|
|
|
this.selectedRow = [];
|
2020-03-31 08:23:49 +02:00
|
|
|
let st: ClrDatagridStateInterface = { page: {from: 0, to: this.pageSize - 1, size: this.pageSize} };
|
|
|
|
this.getCurrentArtifactTags(st);
|
|
|
|
}
|
2020-04-07 10:28:51 +02:00
|
|
|
ngOnDestroy(): void {
|
|
|
|
this.tagNameCheckSub.unsubscribe();
|
|
|
|
}
|
2020-04-09 07:08:39 +02:00
|
|
|
get withNotary(): boolean {
|
|
|
|
return this.appConfigService.getConfig().with_notary;
|
|
|
|
}
|
2020-04-17 06:12:16 +02:00
|
|
|
public get registryUrl(): string {
|
2021-04-08 12:42:46 +02:00
|
|
|
if (this.systemInfo && this.systemInfo.registry_url) {
|
|
|
|
return this.systemInfo.registry_url;
|
|
|
|
}
|
|
|
|
return location.hostname;
|
2020-04-17 06:12:16 +02:00
|
|
|
}
|
2020-07-30 10:38:45 +02:00
|
|
|
hasPullCommand(): boolean {
|
|
|
|
return this.artifactDetails
|
2022-03-18 12:41:59 +01:00
|
|
|
&& (this.artifactDetails.type === ArtifactType.IMAGE
|
|
|
|
|| this.artifactDetails.type === ArtifactType.CHART
|
|
|
|
|| this.artifactDetails.type === ArtifactType.CNAB)
|
2022-03-03 03:06:28 +01:00
|
|
|
&& this.accessoryType !== AccessoryType.COSIGN;
|
2020-07-30 10:38:45 +02:00
|
|
|
}
|
|
|
|
getPullCommand(tag: Tag): string {
|
|
|
|
let pullCommand: string = '';
|
|
|
|
if (tag && tag.name && this.artifactDetails ) {
|
2022-03-18 12:41:59 +01:00
|
|
|
pullCommand = getPullCommandByTag(this.artifactDetails?.type,
|
|
|
|
`${this.registryUrl}/${this.projectName}/${this.repositoryName}`, tag.name);
|
2020-07-30 10:38:45 +02:00
|
|
|
}
|
2022-03-18 12:41:59 +01:00
|
|
|
return pullCommand;
|
2020-07-30 10:38:45 +02:00
|
|
|
}
|
2020-02-13 08:39:29 +01:00
|
|
|
}
|