mirror of
https://github.com/goharbor/harbor.git
synced 2024-12-22 08:38:03 +01:00
feat: extend the p2p preheat policy (#21115)
Add the field extra_attrs to the p2p preheat policy for the provider to define their specified parameters when preheating. Signed-off-by: chlins <chlins.zhang@gmail.com>
This commit is contained in:
parent
e417875377
commit
a548ab705f
2
Makefile
2
Makefile
@ -468,7 +468,7 @@ misspell:
|
||||
@echo checking misspell...
|
||||
@find . -type d \( -path ./tests \) -prune -o -name '*.go' -print | xargs misspell -error
|
||||
|
||||
# golangci-lint binary installation or refer to https://golangci-lint.run/usage/install/#local-installation
|
||||
# golangci-lint binary installation or refer to https://golangci-lint.run/usage/install/#local-installation
|
||||
# curl -sSfL https://raw.githubusercontent.com/golangci/golangci-lint/master/install.sh | sh -s -- -b $(go env GOPATH)/bin v1.55.2
|
||||
GOLANGCI_LINT := $(shell go env GOPATH)/bin/golangci-lint
|
||||
lint:
|
||||
|
@ -1193,7 +1193,7 @@ paths:
|
||||
'404':
|
||||
$ref: '#/responses/404'
|
||||
'422':
|
||||
$ref: '#/responses/422'
|
||||
$ref: '#/responses/422'
|
||||
'500':
|
||||
$ref: '#/responses/500'
|
||||
/projects/{project_name}/repositories/{repository_name}/artifacts/{reference}/scan/stop:
|
||||
@ -1226,7 +1226,7 @@ paths:
|
||||
'404':
|
||||
$ref: '#/responses/404'
|
||||
'422':
|
||||
$ref: '#/responses/422'
|
||||
$ref: '#/responses/422'
|
||||
'500':
|
||||
$ref: '#/responses/500'
|
||||
/projects/{project_name}/repositories/{repository_name}/artifacts/{reference}/scan/{report_id}/log:
|
||||
@ -6553,7 +6553,7 @@ responses:
|
||||
description: The ID of the corresponding request for the response
|
||||
type: string
|
||||
schema:
|
||||
$ref: '#/definitions/Errors'
|
||||
$ref: '#/definitions/Errors'
|
||||
'500':
|
||||
description: Internal server error
|
||||
headers:
|
||||
@ -7095,9 +7095,9 @@ definitions:
|
||||
type: boolean
|
||||
description: Whether the preheat policy enabled
|
||||
x-omitempty: false
|
||||
scope:
|
||||
extra_attrs:
|
||||
type: string
|
||||
description: The scope of preheat policy
|
||||
description: The extra attributes of preheat policy
|
||||
creation_time:
|
||||
type: string
|
||||
format: date-time
|
||||
@ -7937,7 +7937,7 @@ definitions:
|
||||
properties:
|
||||
resource:
|
||||
type: string
|
||||
description: The resource of the access. Possible resources are listed here for system and project level https://github.com/goharbor/harbor/blob/main/src/common/rbac/const.go
|
||||
description: The resource of the access. Possible resources are listed here for system and project level https://github.com/goharbor/harbor/blob/main/src/common/rbac/const.go
|
||||
action:
|
||||
type: string
|
||||
description: The action of the access. Possible actions are *, pull, push, create, read, update, delete, list, operate, scanner-pull and stop.
|
||||
@ -10112,4 +10112,4 @@ definitions:
|
||||
scan_type:
|
||||
type: string
|
||||
description: 'The scan type for the scan request. Two options are currently supported, vulnerability and sbom'
|
||||
enum: [ vulnerability, sbom ]
|
||||
enum: [ vulnerability, sbom ]
|
||||
|
2
make/migrations/postgresql/0160_2.13.0_schema.up.sql
Normal file
2
make/migrations/postgresql/0160_2.13.0_schema.up.sql
Normal file
@ -0,0 +1,2 @@
|
||||
ALTER TABLE p2p_preheat_policy DROP COLUMN IF EXISTS scope;
|
||||
ALTER TABLE p2p_preheat_policy ADD COLUMN IF NOT EXISTS extra_attrs text;
|
@ -246,4 +246,3 @@ cleanimage:
|
||||
|
||||
.PHONY: clean
|
||||
clean: cleanimage
|
||||
|
||||
|
@ -402,7 +402,7 @@ func (de *defaultEnforcer) launchExecutions(ctx context.Context, candidates []*s
|
||||
// Start tasks
|
||||
count := 0
|
||||
for _, c := range candidates {
|
||||
if _, err = de.startTask(ctx, eid, c, insData, pl.Scope); err != nil {
|
||||
if _, err = de.startTask(ctx, eid, c, insData, pl.ExtraAttrs); err != nil {
|
||||
// Just log the error and skip
|
||||
log.Errorf("start task error for preheating image: %s/%s:%s@%s", c.Namespace, c.Repository, c.Tags[0], c.Digest)
|
||||
continue
|
||||
@ -421,7 +421,7 @@ func (de *defaultEnforcer) launchExecutions(ctx context.Context, candidates []*s
|
||||
}
|
||||
|
||||
// startTask starts the preheat task(job) for the given candidate
|
||||
func (de *defaultEnforcer) startTask(ctx context.Context, executionID int64, candidate *selector.Candidate, instance, scope string) (int64, error) {
|
||||
func (de *defaultEnforcer) startTask(ctx context.Context, executionID int64, candidate *selector.Candidate, instance string, extraAttrs map[string]interface{}) (int64, error) {
|
||||
u, err := de.fullURLGetter(candidate)
|
||||
if err != nil {
|
||||
return -1, err
|
||||
@ -438,10 +438,10 @@ func (de *defaultEnforcer) startTask(ctx context.Context, executionID int64, can
|
||||
Headers: map[string]interface{}{
|
||||
accessCredHeaderKey: cred,
|
||||
},
|
||||
ImageName: fmt.Sprintf("%s/%s", candidate.Namespace, candidate.Repository),
|
||||
Tag: candidate.Tags[0],
|
||||
Digest: candidate.Digest,
|
||||
Scope: scope,
|
||||
ImageName: fmt.Sprintf("%s/%s", candidate.Namespace, candidate.Repository),
|
||||
Tag: candidate.Tags[0],
|
||||
Digest: candidate.Digest,
|
||||
ExtraAttrs: extraAttrs,
|
||||
}
|
||||
|
||||
piData, err := pi.ToJSON()
|
||||
|
@ -210,7 +210,6 @@ func mockPolicies() []*po.Schema {
|
||||
Type: po.TriggerTypeManual,
|
||||
},
|
||||
Enabled: true,
|
||||
Scope: "single_peer",
|
||||
CreatedAt: time.Now().UTC(),
|
||||
UpdatedTime: time.Now().UTC(),
|
||||
}, {
|
||||
@ -236,7 +235,6 @@ func mockPolicies() []*po.Schema {
|
||||
Trigger: &po.Trigger{
|
||||
Type: po.TriggerTypeEventBased,
|
||||
},
|
||||
Scope: "all_peers",
|
||||
Enabled: true,
|
||||
CreatedAt: time.Now().UTC(),
|
||||
UpdatedTime: time.Now().UTC(),
|
||||
|
@ -30,9 +30,6 @@ func init() {
|
||||
beego_orm.RegisterModel(&Schema{})
|
||||
}
|
||||
|
||||
// ScopeType represents the preheat scope type.
|
||||
type ScopeType = string
|
||||
|
||||
const (
|
||||
// Filters:
|
||||
// Repository : type=Repository value=name text (double star pattern used)
|
||||
@ -58,11 +55,6 @@ const (
|
||||
TriggerTypeScheduled TriggerType = "scheduled"
|
||||
// TriggerTypeEventBased represents the event_based trigger type
|
||||
TriggerTypeEventBased TriggerType = "event_based"
|
||||
|
||||
// ScopeTypeSinglePeer represents preheat image to single peer in p2p cluster.
|
||||
ScopeTypeSinglePeer ScopeType = "single_peer"
|
||||
// ScopeTypeAllPeers represents preheat image to all peers in p2p cluster.
|
||||
ScopeTypeAllPeers ScopeType = "all_peers"
|
||||
)
|
||||
|
||||
// Schema defines p2p preheat policy schema
|
||||
@ -80,10 +72,11 @@ type Schema struct {
|
||||
// Use JSON data format (query by trigger type should be supported)
|
||||
TriggerStr string `orm:"column(trigger)" json:"-"`
|
||||
Enabled bool `orm:"column(enabled)" json:"enabled"`
|
||||
// Scope decides the preheat scope.
|
||||
Scope string `orm:"column(scope)" json:"scope"`
|
||||
CreatedAt time.Time `orm:"column(creation_time)" json:"creation_time"`
|
||||
UpdatedTime time.Time `orm:"column(update_time)" json:"update_time"`
|
||||
// ExtraAttrs is used to store extra attributes provided by vendor.
|
||||
ExtraAttrsStr string `orm:"column(extra_attrs)" json:"-"`
|
||||
ExtraAttrs map[string]interface{} `orm:"-" json:"extra_attrs"`
|
||||
CreatedAt time.Time `orm:"column(creation_time)" json:"creation_time"`
|
||||
UpdatedTime time.Time `orm:"column(update_time)" json:"update_time"`
|
||||
}
|
||||
|
||||
// TableName specifies the policy schema table name.
|
||||
@ -136,11 +129,6 @@ func (s *Schema) ValidatePreheatPolicy() error {
|
||||
}
|
||||
}
|
||||
|
||||
// validate preheat scope
|
||||
if s.Scope != "" && s.Scope != ScopeTypeSinglePeer && s.Scope != ScopeTypeAllPeers {
|
||||
return errors.New(nil).WithCode(errors.BadRequestCode).WithMessagef("invalid scope for preheat policy: %s", s.Scope)
|
||||
}
|
||||
|
||||
return nil
|
||||
}
|
||||
|
||||
@ -162,6 +150,14 @@ func (s *Schema) Encode() error {
|
||||
s.TriggerStr = string(triggerStr)
|
||||
}
|
||||
|
||||
if s.ExtraAttrs != nil {
|
||||
extraAttrsStr, err := json.Marshal(s.ExtraAttrs)
|
||||
if err != nil {
|
||||
return err
|
||||
}
|
||||
s.ExtraAttrsStr = string(extraAttrsStr)
|
||||
}
|
||||
|
||||
return nil
|
||||
}
|
||||
|
||||
@ -181,6 +177,13 @@ func (s *Schema) Decode() error {
|
||||
}
|
||||
s.Trigger = trigger
|
||||
|
||||
// parse extra attributes
|
||||
extraAttrs, err := decodeExtraAttrs(s.ExtraAttrsStr)
|
||||
if err != nil {
|
||||
return err
|
||||
}
|
||||
s.ExtraAttrs = extraAttrs
|
||||
|
||||
return nil
|
||||
}
|
||||
|
||||
@ -230,3 +233,17 @@ func decodeTrigger(triggerStr string) (*Trigger, error) {
|
||||
|
||||
return trigger, nil
|
||||
}
|
||||
|
||||
// decodeExtraAttrs parse extraAttrsStr to extraAttrs.
|
||||
func decodeExtraAttrs(extraAttrsStr string) (map[string]interface{}, error) {
|
||||
if len(extraAttrsStr) == 0 {
|
||||
return nil, nil
|
||||
}
|
||||
|
||||
extraAttrs := make(map[string]interface{})
|
||||
if err := json.Unmarshal([]byte(extraAttrsStr), &extraAttrs); err != nil {
|
||||
return nil, err
|
||||
}
|
||||
|
||||
return extraAttrs, nil
|
||||
}
|
||||
|
@ -64,35 +64,28 @@ func (p *PolicyTestSuite) TestValidatePreheatPolicy() {
|
||||
// valid cron string
|
||||
p.schema.Trigger.Settings.Cron = "0 0 0 1 1 *"
|
||||
p.NoError(p.schema.ValidatePreheatPolicy())
|
||||
|
||||
// invalid preheat scope
|
||||
p.schema.Scope = "invalid scope"
|
||||
p.Error(p.schema.ValidatePreheatPolicy())
|
||||
// valid preheat scope
|
||||
p.schema.Scope = "single_peer"
|
||||
p.NoError(p.schema.ValidatePreheatPolicy())
|
||||
}
|
||||
|
||||
// TestDecode tests decode.
|
||||
func (p *PolicyTestSuite) TestDecode() {
|
||||
s := &Schema{
|
||||
ID: 100,
|
||||
Name: "test-for-decode",
|
||||
Description: "",
|
||||
ProjectID: 1,
|
||||
ProviderID: 1,
|
||||
Filters: nil,
|
||||
FiltersStr: "[{\"type\":\"repository\",\"value\":\"**\"},{\"type\":\"tag\",\"value\":\"**\"},{\"type\":\"label\",\"value\":\"test\"}]",
|
||||
Trigger: nil,
|
||||
TriggerStr: "{\"type\":\"event_based\",\"trigger_setting\":{\"cron\":\"\"}}",
|
||||
Enabled: false,
|
||||
Scope: "all_peers",
|
||||
ID: 100,
|
||||
Name: "test-for-decode",
|
||||
Description: "",
|
||||
ProjectID: 1,
|
||||
ProviderID: 1,
|
||||
Filters: nil,
|
||||
FiltersStr: "[{\"type\":\"repository\",\"value\":\"**\"},{\"type\":\"tag\",\"value\":\"**\"},{\"type\":\"label\",\"value\":\"test\"}]",
|
||||
Trigger: nil,
|
||||
TriggerStr: "{\"type\":\"event_based\",\"trigger_setting\":{\"cron\":\"\"}}",
|
||||
Enabled: false,
|
||||
ExtraAttrsStr: "{\"key\":\"value\"}",
|
||||
}
|
||||
p.NoError(s.Decode())
|
||||
p.Len(s.Filters, 3)
|
||||
p.NotNil(s.Trigger)
|
||||
|
||||
p.Equal(ScopeTypeAllPeers, s.Scope)
|
||||
p.Equal(map[string]interface{}{"key": "value"}, s.ExtraAttrs)
|
||||
|
||||
// invalid filter or trigger
|
||||
s.FiltersStr = ""
|
||||
@ -132,10 +125,12 @@ func (p *PolicyTestSuite) TestEncode() {
|
||||
},
|
||||
TriggerStr: "",
|
||||
Enabled: false,
|
||||
Scope: "single_peer",
|
||||
ExtraAttrs: map[string]interface{}{
|
||||
"key": "value",
|
||||
},
|
||||
}
|
||||
p.NoError(s.Encode())
|
||||
p.Equal(`[{"type":"repository","value":"**"},{"type":"tag","value":"**"},{"type":"label","value":"test"}]`, s.FiltersStr)
|
||||
p.Equal(`{"type":"event_based","trigger_setting":{}}`, s.TriggerStr)
|
||||
p.Equal(ScopeTypeSinglePeer, s.Scope)
|
||||
p.Equal(`{"key":"value"}`, s.ExtraAttrsStr)
|
||||
}
|
||||
|
@ -36,6 +36,15 @@ const (
|
||||
|
||||
// dragonflyJobPath is the job path for dragonfly openapi.
|
||||
dragonflyJobPath = "/oapi/v1/jobs"
|
||||
|
||||
// scopeTypeSingleSeedPeer represents preheat image to single seed peer in p2p cluster.
|
||||
scopeTypeSingleSeedPeer = "single_seed_peer"
|
||||
|
||||
// scopeTypeAllSeedPeers represents preheat image to all seed peers in p2p cluster.
|
||||
scopeTypeAllSeedPeers = "all_seed_peers"
|
||||
|
||||
// scopeTypeAllPeers represents preheat image to all peers in p2p cluster.
|
||||
scopeTypeAllPeers = "all_peers"
|
||||
)
|
||||
|
||||
const (
|
||||
@ -54,13 +63,13 @@ const (
|
||||
|
||||
type dragonflyCreateJobRequest struct {
|
||||
// Type is the job type, support preheat.
|
||||
Type string `json:"type" binding:"required"`
|
||||
Type string `json:"type"`
|
||||
|
||||
// Args is the preheating args.
|
||||
Args dragonflyCreateJobRequestArgs `json:"args" binding:"omitempty"`
|
||||
Args dragonflyCreateJobRequestArgs `json:"args"`
|
||||
|
||||
// SchedulerClusterIDs is the scheduler cluster ids for preheating.
|
||||
SchedulerClusterIDs []uint `json:"scheduler_cluster_ids" binding:"omitempty"`
|
||||
SchedulerClusterIDs []uint `json:"scheduler_cluster_ids"`
|
||||
}
|
||||
|
||||
type dragonflyCreateJobRequestArgs struct {
|
||||
@ -150,6 +159,14 @@ type dragonflyJobResponse struct {
|
||||
} `json:"result"`
|
||||
}
|
||||
|
||||
// dragonflyExtraAttrs is the extra attributes model definition for dragonfly provider.
|
||||
type dragonflyExtraAttrs struct {
|
||||
// Scope is the scope for preheating, default behavior is single_peer.
|
||||
Scope string `json:"scope"`
|
||||
// ClusterIDs is the cluster ids for dragonfly provider.
|
||||
ClusterIDs []uint `json:"cluster_ids"`
|
||||
}
|
||||
|
||||
// DragonflyDriver implements the provider driver interface for Alibaba dragonfly.
|
||||
// More details, please refer to https://github.com/alibaba/Dragonfly
|
||||
type DragonflyDriver struct {
|
||||
@ -201,6 +218,18 @@ func (dd *DragonflyDriver) Preheat(preheatingImage *PreheatImage) (*PreheatingSt
|
||||
return nil, errors.New("no image specified")
|
||||
}
|
||||
|
||||
var extraAttrs dragonflyExtraAttrs
|
||||
if len(preheatingImage.ExtraAttrs) > 0 {
|
||||
extraAttrsStr, err := json.Marshal(preheatingImage.ExtraAttrs)
|
||||
if err != nil {
|
||||
return nil, errors.Wrap(err, "failed to marshal extra attributes")
|
||||
}
|
||||
|
||||
if err := json.Unmarshal(extraAttrsStr, &extraAttrs); err != nil {
|
||||
return nil, errors.Wrap(err, "failed to unmarshal extra attributes")
|
||||
}
|
||||
}
|
||||
|
||||
// Construct the preheat job request by the given parameters of the preheating image .
|
||||
req := &dragonflyCreateJobRequest{
|
||||
Type: "preheat",
|
||||
@ -209,10 +238,23 @@ func (dd *DragonflyDriver) Preheat(preheatingImage *PreheatImage) (*PreheatingSt
|
||||
Type: preheatingImage.Type,
|
||||
URL: preheatingImage.URL,
|
||||
Headers: headerToMapString(preheatingImage.Headers),
|
||||
Scope: preheatingImage.Scope,
|
||||
},
|
||||
}
|
||||
|
||||
// Set the scope if it is specified.
|
||||
if extraAttrs.Scope != "" {
|
||||
if err := isScopeValid(extraAttrs.Scope); err != nil {
|
||||
return nil, errors.Wrap(err, "specify the invalid scope")
|
||||
}
|
||||
|
||||
req.Args.Scope = extraAttrs.Scope
|
||||
}
|
||||
|
||||
// Set the cluster ids if it is specified.
|
||||
if len(extraAttrs.ClusterIDs) > 0 {
|
||||
req.SchedulerClusterIDs = extraAttrs.ClusterIDs
|
||||
}
|
||||
|
||||
url := fmt.Sprintf("%s%s", strings.TrimSuffix(dd.instance.Endpoint, "/"), dragonflyJobPath)
|
||||
data, err := client.GetHTTPClient(dd.instance.Insecure).Post(url, dd.getCred(), req, nil)
|
||||
if err != nil {
|
||||
@ -326,3 +368,15 @@ func headerToMapString(header map[string]interface{}) map[string]string {
|
||||
|
||||
return m
|
||||
}
|
||||
|
||||
// isScopeValid checks whether the scope is valid.
|
||||
func isScopeValid(scope string) error {
|
||||
switch scope {
|
||||
case scopeTypeSingleSeedPeer,
|
||||
scopeTypeAllSeedPeers,
|
||||
scopeTypeAllPeers:
|
||||
return nil
|
||||
default:
|
||||
return errors.Errorf("invalid scope: %s", scope)
|
||||
}
|
||||
}
|
||||
|
@ -85,7 +85,10 @@ func (suite *DragonflyTestSuite) TestPreheat() {
|
||||
Tag: "latest",
|
||||
URL: "https://harbor.com",
|
||||
Digest: "sha256:f3c97e3bd1e27393eb853a5c90b1132f2cda84336d5ba5d100c720dc98524c82",
|
||||
Scope: "single_peer",
|
||||
ExtraAttrs: map[string]interface{}{
|
||||
"scope": "all_peers",
|
||||
"cluster_ids": []uint{1, 2, 3},
|
||||
},
|
||||
})
|
||||
require.NoError(suite.T(), err, "preheat image")
|
||||
suite.Equal(provider.PreheatingStatusPending, st.Status, "preheat status")
|
||||
|
@ -46,8 +46,8 @@ type PreheatImage struct {
|
||||
// Digest of the preheating image
|
||||
Digest string `json:"digest"`
|
||||
|
||||
// Scope indicates the preheat scope.
|
||||
Scope string `json:"scope,omitempty"`
|
||||
// ExtraAttrs contains extra attributes for the preheating image.
|
||||
ExtraAttrs map[string]interface{} `json:"extra_attrs,omitempty"`
|
||||
}
|
||||
|
||||
// FromJSON build preheating image from the given data.
|
||||
|
@ -457,29 +457,66 @@
|
||||
(inputvalue)="setCron($event)"></cron-selection>
|
||||
</div>
|
||||
</div>
|
||||
<!-- scope -->
|
||||
<div class="clr-form-control">
|
||||
<clr-select-container>
|
||||
<label class="clr-control-label width-6rem">
|
||||
{{ 'P2P_PROVIDER.SCOPE' | translate }}
|
||||
</label>
|
||||
<select
|
||||
class="width-380"
|
||||
[disabled]="loading"
|
||||
clrSelect
|
||||
name="scope"
|
||||
id="scope"
|
||||
[(ngModel)]="scope"
|
||||
#ngScope="ngModel">
|
||||
<option class="display-none" value=""></option>
|
||||
<option
|
||||
[selected]="policy.scope === item"
|
||||
*ngFor="let item of scopes"
|
||||
value="{{ item }}">
|
||||
{{ getScopeI18n(item) | translate }}
|
||||
</option>
|
||||
</select>
|
||||
</clr-select-container>
|
||||
<!-- dragonfly provider customization -->
|
||||
<div *ngIf="isDragonflyProvider(policy.provider_id)">
|
||||
<!-- scope -->
|
||||
<div class="clr-form-control">
|
||||
<clr-select-container>
|
||||
<label class="clr-control-label width-6rem">
|
||||
{{
|
||||
'P2P_PROVIDER.DRAGONFLY.SCOPE'
|
||||
| translate
|
||||
}}
|
||||
</label>
|
||||
<select
|
||||
class="width-380"
|
||||
[disabled]="loading"
|
||||
clrSelect
|
||||
name="scope"
|
||||
id="scope"
|
||||
[(ngModel)]="scope"
|
||||
#ngScope="ngModel">
|
||||
<option
|
||||
class="display-none"
|
||||
value=""></option>
|
||||
<option
|
||||
[selected]="policy.scope === item"
|
||||
*ngFor="let item of scopes"
|
||||
value="{{ item }}">
|
||||
{{ getScopeI18n(item) | translate }}
|
||||
</option>
|
||||
</select>
|
||||
</clr-select-container>
|
||||
</div>
|
||||
<!-- cluster_ids -->
|
||||
<div class="clr-form-control">
|
||||
<label
|
||||
for="clusterIDs"
|
||||
class="clr-control-label width-6rem"
|
||||
>{{
|
||||
'P2P_PROVIDER.DRAGONFLY.CLUSTER_IDS'
|
||||
| translate
|
||||
}}</label
|
||||
>
|
||||
<div class="clr-control-container">
|
||||
<div class="clr-input-wrapper">
|
||||
<input
|
||||
[disabled]="loading"
|
||||
autocomplete="off"
|
||||
class="clr-input width-380"
|
||||
type="text"
|
||||
id="clusterIDs"
|
||||
[(ngModel)]="clusterIDs"
|
||||
size="30"
|
||||
name="clusterIDs"
|
||||
#ngClusterIDs="ngModel" />
|
||||
</div>
|
||||
<clr-control-helper class="opacity-08">{{
|
||||
'P2P_PROVIDER.DRAGONFLY.CLUSTER_IDS_SEPARATOR'
|
||||
| translate
|
||||
}}</clr-control-helper>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</section>
|
||||
</form>
|
||||
|
@ -12,6 +12,7 @@ import { NgForm } from '@angular/forms';
|
||||
import { OriginCron, ProjectService } from '../../../../shared/services';
|
||||
import { CronScheduleComponent } from '../../../../shared/components/cron-schedule';
|
||||
import { PreheatService } from '../../../../../../ng-swagger-gen/services/preheat.service';
|
||||
import { ExtraAttrs } from '../../../../../../ng-swagger-gen/models/extra-attrs';
|
||||
import {
|
||||
debounceTime,
|
||||
distinctUntilChanged,
|
||||
@ -29,8 +30,8 @@ import {
|
||||
PROJECT_SEVERITY_LEVEL_MAP,
|
||||
TRIGGER,
|
||||
TRIGGER_I18N_MAP,
|
||||
SCOPE,
|
||||
SCOPE_I18N_MAP,
|
||||
DRAGONFLY_SCOPE,
|
||||
DRAGONFLY_SCOPE_I18N_MAP,
|
||||
} from '../p2p-provider.service';
|
||||
import { ProviderUnderProject } from '../../../../../../ng-swagger-gen/models/provider-under-project';
|
||||
import { AppConfigService } from '../../../../services/app-config.service';
|
||||
@ -75,7 +76,8 @@ export class AddP2pPolicyComponent implements OnInit, OnDestroy {
|
||||
severity: number;
|
||||
labels: string;
|
||||
triggerType: string = TRIGGER.MANUAL;
|
||||
scope: string = SCOPE.SINGLE_PEER;
|
||||
scope: string = DRAGONFLY_SCOPE.SINGLE_SEED_PEER;
|
||||
clusterIDs: string;
|
||||
cron: string;
|
||||
@ViewChild('policyForm', { static: true }) currentForm: NgForm;
|
||||
loading: boolean = false;
|
||||
@ -90,6 +92,8 @@ export class AddP2pPolicyComponent implements OnInit, OnDestroy {
|
||||
originLabelsForEdit: string;
|
||||
originTriggerTypeForEdit: string;
|
||||
originCronForEdit: string;
|
||||
originScopeForEdit: string;
|
||||
originClusterIDsForEdit: string;
|
||||
@Input()
|
||||
providers: ProviderUnderProject[] = [];
|
||||
preventVul: boolean = false;
|
||||
@ -99,7 +103,11 @@ export class AddP2pPolicyComponent implements OnInit, OnDestroy {
|
||||
TRIGGER.SCHEDULED,
|
||||
TRIGGER.EVENT_BASED,
|
||||
];
|
||||
scopes: string[] = [SCOPE.SINGLE_PEER, SCOPE.ALL_PEERS];
|
||||
scopes: string[] = [
|
||||
DRAGONFLY_SCOPE.SINGLE_SEED_PEER,
|
||||
DRAGONFLY_SCOPE.ALL_SEED_PEERS,
|
||||
DRAGONFLY_SCOPE.ALL_PEERS,
|
||||
];
|
||||
enableContentTrust: boolean = false;
|
||||
private _nameSubject: Subject<string> = new Subject<string>();
|
||||
private _nameSubscription: Subscription;
|
||||
@ -202,7 +210,7 @@ export class AddP2pPolicyComponent implements OnInit, OnDestroy {
|
||||
}
|
||||
this.currentForm.reset({
|
||||
triggerType: 'manual',
|
||||
scope: 'single_peer',
|
||||
scope: DRAGONFLY_SCOPE.SINGLE_SEED_PEER,
|
||||
severity: PROJECT_SEVERITY_LEVEL_MAP[this.projectSeverity],
|
||||
onlySignedImages: this.enableContentTrust,
|
||||
provider: this.policy.provider_id,
|
||||
@ -308,7 +316,21 @@ export class AddP2pPolicyComponent implements OnInit, OnDestroy {
|
||||
policy.trigger = JSON.stringify(trigger);
|
||||
this.loading = true;
|
||||
this.buttonStatus = ClrLoadingState.LOADING;
|
||||
policy.scope = this.scope ? this.scope : SCOPE.SINGLE_PEER;
|
||||
// assemble extra attrs for dragonfly provider
|
||||
let extraAttrs: ExtraAttrs = {};
|
||||
if (this.isDragonflyProvider(policy.provider_id)) {
|
||||
if (this.scope) {
|
||||
extraAttrs['scope'] = this.scope;
|
||||
}
|
||||
if (this.clusterIDs) {
|
||||
extraAttrs['cluster_ids'] = this.clusterIDs
|
||||
.split(',')
|
||||
.map(Number);
|
||||
}
|
||||
}
|
||||
if (Object.keys(extraAttrs).length) {
|
||||
policy.extra_attrs = JSON.stringify(extraAttrs);
|
||||
}
|
||||
deleteEmptyKey(policy);
|
||||
if (isAdd) {
|
||||
policy.project_id = this.projectId;
|
||||
@ -410,7 +432,11 @@ export class AddP2pPolicyComponent implements OnInit, OnDestroy {
|
||||
return true;
|
||||
}
|
||||
// eslint-disable-next-line eqeqeq
|
||||
if (this.policy.scope != this.scope) {
|
||||
if (this.originScopeForEdit != this.scope) {
|
||||
return true;
|
||||
}
|
||||
// eslint-disable-next-line eqeqeq
|
||||
if (this.originClusterIDsForEdit != this.clusterIDs) {
|
||||
return true;
|
||||
}
|
||||
// eslint-disable-next-line eqeqeq
|
||||
@ -430,7 +456,7 @@ export class AddP2pPolicyComponent implements OnInit, OnDestroy {
|
||||
|
||||
getScopeI18n(scope): string {
|
||||
if (scope) {
|
||||
return SCOPE_I18N_MAP[scope];
|
||||
return DRAGONFLY_SCOPE_I18N_MAP[scope];
|
||||
}
|
||||
return '';
|
||||
}
|
||||
@ -444,4 +470,15 @@ export class AddP2pPolicyComponent implements OnInit, OnDestroy {
|
||||
showExplainForEventBased(): boolean {
|
||||
return this.triggerType === TRIGGER.EVENT_BASED;
|
||||
}
|
||||
|
||||
isDragonflyProvider(provider_id: number): boolean {
|
||||
if (this.providers && this.providers.length) {
|
||||
return this.providers.some(
|
||||
provider =>
|
||||
provider_id == provider.id &&
|
||||
provider.provider.startsWith('dragonfly')
|
||||
);
|
||||
}
|
||||
return false;
|
||||
}
|
||||
}
|
||||
|
@ -77,14 +77,16 @@ export const TRIGGER_I18N_MAP = {
|
||||
'scheduled(paused)': 'JOB_SERVICE_DASHBOARD.SCHEDULE_PAUSED',
|
||||
};
|
||||
|
||||
export enum SCOPE {
|
||||
SINGLE_PEER = 'single_peer',
|
||||
export enum DRAGONFLY_SCOPE {
|
||||
SINGLE_SEED_PEER = 'single_seed_peer',
|
||||
ALL_SEED_PEERS = 'all_seed_peers',
|
||||
ALL_PEERS = 'all_peers',
|
||||
}
|
||||
|
||||
export const SCOPE_I18N_MAP = {
|
||||
single_peer: 'P2P_PROVIDER.SCOPE_SINGLE_PEER',
|
||||
all_peers: 'P2P_PROVIDER.SCOPE_ALL_PEERS',
|
||||
export const DRAGONFLY_SCOPE_I18N_MAP = {
|
||||
single_seed_peer: 'P2P_PROVIDER.DRAGONFLY.SCOPE_SINGLE_SEED_PEER',
|
||||
all_seed_peers: 'P2P_PROVIDER.DRAGONFLY.SCOPE_ALL_SEED_PEERS',
|
||||
all_peers: 'P2P_PROVIDER.DRAGONFLY.SCOPE_ALL_PEERS',
|
||||
};
|
||||
|
||||
export const TIME_OUT: number = 7000;
|
||||
|
@ -19,11 +19,11 @@
|
||||
height: 100%;
|
||||
}
|
||||
|
||||
.margin-left-5px{
|
||||
.margin-left-5px {
|
||||
margin-left: 5px;
|
||||
}
|
||||
|
||||
.margin-left-10px{
|
||||
.margin-left-10px {
|
||||
margin-left: 10px;
|
||||
}
|
||||
|
||||
|
@ -480,6 +480,13 @@ export class PolicyComponent implements OnInit, OnDestroy {
|
||||
this.addP2pPolicyComponent.triggerType = trigger.type;
|
||||
this.addP2pPolicyComponent.cron = trigger.trigger_setting.cron;
|
||||
}
|
||||
if (this.addP2pPolicyComponent.policy.extra_attrs) {
|
||||
const { scope = '', cluster_ids = [] } = JSON.parse(
|
||||
this.addP2pPolicyComponent.policy.extra_attrs
|
||||
);
|
||||
this.addP2pPolicyComponent.scope = scope;
|
||||
this.addP2pPolicyComponent.clusterIDs = cluster_ids.join(',');
|
||||
}
|
||||
this.addP2pPolicyComponent.currentForm.reset({
|
||||
provider: this.addP2pPolicyComponent.policy.provider_id,
|
||||
name: this.addP2pPolicyComponent.policy.name,
|
||||
@ -491,6 +498,7 @@ export class PolicyComponent implements OnInit, OnDestroy {
|
||||
label: this.addP2pPolicyComponent.labels,
|
||||
triggerType: this.addP2pPolicyComponent.triggerType,
|
||||
scope: this.addP2pPolicyComponent.scope,
|
||||
clusterIDs: this.addP2pPolicyComponent.clusterIDs,
|
||||
});
|
||||
this.addP2pPolicyComponent.originPolicyForEdit = clone(
|
||||
this.selectedRow
|
||||
@ -509,6 +517,10 @@ export class PolicyComponent implements OnInit, OnDestroy {
|
||||
this.addP2pPolicyComponent.triggerType;
|
||||
this.addP2pPolicyComponent.originCronForEdit =
|
||||
this.addP2pPolicyComponent.cron;
|
||||
this.addP2pPolicyComponent.originScopeForEdit =
|
||||
this.addP2pPolicyComponent.scope;
|
||||
this.addP2pPolicyComponent.originClusterIDsForEdit =
|
||||
this.addP2pPolicyComponent.clusterIDs;
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -16,7 +16,7 @@
|
||||
"HEADER_LINK": "Einloggen",
|
||||
"OR": "ODER",
|
||||
"VIA_LOCAL_DB": "LOGIN MIT LOKALER DB",
|
||||
"CORE_SERVICE_NOT_AVAILABLE": "Core Service ist nicht verfügbar"
|
||||
"CORE_SERVICE_NOT_AVAILABLE": "Core Service ist nicht verfügbar"
|
||||
},
|
||||
"SIGN_UP": {
|
||||
"TITLE": "Registrieren"
|
||||
@ -246,7 +246,7 @@
|
||||
"TOGGLED_SUCCESS": "Projekt erfolgreich geändert.",
|
||||
"FAILED_TO_DELETE_PROJECT": "Das Projekt enthält Repositories, Replikations-Regeln oder Helm-Charts und kann daher nicht gelöscht werden.",
|
||||
"INLINE_HELP_PUBLIC": "Wenn ein Projekt öffentlich ist, hat jeder lesenden Zugriff auf die Repositories innerhalb des Projekts. Der Nutzer muss nicht \"docker login\" vor dem Pull eines Images durchführen.",
|
||||
"PROXY_CACHE_BANDWIDTH":"Set the maximum network bandwidth to pull image from upstream for proxy-cache. For unlimited bandwidth, please enter -1. ",
|
||||
"PROXY_CACHE_BANDWIDTH": "Set the maximum network bandwidth to pull image from upstream for proxy-cache. For unlimited bandwidth, please enter -1. ",
|
||||
"BANDWIDTH": "Bandwidth",
|
||||
"SPEED_LIMIT_TIP": "Please enter -1 or an integer greater than 0. ",
|
||||
"OF": "von",
|
||||
@ -385,7 +385,7 @@
|
||||
"INVALID_VALUE": "Der Wert der Ablaufzeit ist ungültig",
|
||||
"NEVER_EXPIRED": "Läuft nie ab",
|
||||
"NAME_PREFIX": "Prefix für den Namen der Robot-Zugänge",
|
||||
"NAME_PREFIX_REQUIRED": "Es ist ein Prefix für den Robot-Zugang erforderlich",
|
||||
"NAME_PREFIX_REQUIRED": "Es ist ein Prefix für den Robot-Zugang erforderlich",
|
||||
"UPDATE": "Update",
|
||||
"AUDIT_LOG": "Audit Log",
|
||||
"PREHEAT_INSTANCE": "Preheat Instance",
|
||||
@ -936,7 +936,6 @@
|
||||
"LDAP_GROUP_MEMBERSHIP_INFO": "Dass Attribut, das die Mitglieder einer LDAP-Gruppe identifiziert. Standardwert ist memberof, in manchen LDAP Servern kann es \"ismemberof\" sein. Das Feld darf nicht leer sein, sofern eine LDAP Gruppen Funktion eingesetzt wird.",
|
||||
"GROUP_SCOPE": "LDAP Gruppen Search Scope",
|
||||
"GROUP_SCOPE_INFO": "Der Scope mit dem nach Gruppen gesucht wird. Standard ist Subtree."
|
||||
|
||||
},
|
||||
"UAA": {
|
||||
"ENDPOINT": "UAA Endpunkt",
|
||||
@ -966,8 +965,8 @@
|
||||
"OIDC_USERNAME": "Nutzername",
|
||||
"GROUP_CLAIM_NAME": "Group Claim Name",
|
||||
"GROUP_CLAIM_NAME_INFO": "The name of a custom group claim that you have configured in your OIDC provider",
|
||||
"OIDC_ADMIN_GROUP": "OIDC Administratorengruppe",
|
||||
"OIDC_ADMIN_GROUP_INFO": "Spezifiziere den Namen einer OIDC Administratorengruppe. Alle Mitglieder dieser Gruppe haben in Harbor administrative Berechtigungen. Falls dies nicht gewünscht ist, kann das Feld leer gelassen werden.",
|
||||
"OIDC_ADMIN_GROUP": "OIDC Administratorengruppe",
|
||||
"OIDC_ADMIN_GROUP_INFO": "Spezifiziere den Namen einer OIDC Administratorengruppe. Alle Mitglieder dieser Gruppe haben in Harbor administrative Berechtigungen. Falls dies nicht gewünscht ist, kann das Feld leer gelassen werden.",
|
||||
"OIDC_GROUP_FILTER": "OIDC Group Filter",
|
||||
"OIDC_GROUP_FILTER_INFO": "Filter OIDC groups who match the provided regular expression.Keep it blank to match all the groups."
|
||||
},
|
||||
@ -1310,7 +1309,6 @@
|
||||
"ON": "am",
|
||||
"AT": "um",
|
||||
"NOSCHEDULE": "Ein Fehler ist aufgetreten beim setzen des Intervalls"
|
||||
|
||||
},
|
||||
"GC": {
|
||||
"CURRENT_SCHEDULE": "Speicherbereinigungs-Intervall",
|
||||
@ -1444,8 +1442,8 @@
|
||||
"DAYS_LARGE": "Parameter \"TAGE\" ist zu hoch",
|
||||
"EXECUTION_TYPE": "Ausführungstyp",
|
||||
"ACTION": "AKTION",
|
||||
"YES": "Ja",
|
||||
"NO": "Nein"
|
||||
"YES": "Ja",
|
||||
"NO": "Nein"
|
||||
},
|
||||
"IMMUTABLE_TAG": {
|
||||
"IMMUTABLE_RULES": "Immutability Regeln",
|
||||
@ -1623,6 +1621,14 @@
|
||||
"CREATE_INSTANCE": "Instanz erstellen"
|
||||
},
|
||||
"P2P_PROVIDER": {
|
||||
"DRAGONFLY": {
|
||||
"SCOPE": "Scope",
|
||||
"SCOPE_SINGLE_SEED_PEER": "Single Seed Peer",
|
||||
"SCOPE_ALL_SEED_PEERS": "All Seed Peers",
|
||||
"SCOPE_ALL_PEERS": "All Peers",
|
||||
"CLUSTER_IDS": "Cluster IDs",
|
||||
"CLUSTER_IDS_SEPARATOR": "Enter multiple comma separated cluster ids, eg., 1,2,3 (If empty, preheat all clusters)"
|
||||
},
|
||||
"P2P_PROVIDER": "P2P-Verteilung",
|
||||
"POLICIES": "REGELWERKE",
|
||||
"NEW_POLICY": "NEUES REGELWERK",
|
||||
@ -1633,9 +1639,6 @@
|
||||
"TRIGGER": "Trigger",
|
||||
"CREATED": "Erzeugt am",
|
||||
"DESCRIPTION": "Beschreibung",
|
||||
"SCOPE": "Umfang",
|
||||
"SCOPE_SINGLE_PEER": "Einzelner Peer",
|
||||
"SCOPE_ALL_PEERS": "Alle Peers",
|
||||
"NO_POLICY": "Keine Regelwerke",
|
||||
"ENABLED_POLICY_SUMMARY": "Soll das Regelwerk {{name}} aktiviert werden?",
|
||||
"DISABLED_POLICY_SUMMARY": "Soll das Regelwerk {{name}} deaktiviert werden?",
|
||||
|
@ -246,7 +246,7 @@
|
||||
"TOGGLED_SUCCESS": "Toggled project successfully.",
|
||||
"FAILED_TO_DELETE_PROJECT": "Project contains repositories or replication rules or helm-charts cannot be deleted.",
|
||||
"INLINE_HELP_PUBLIC": "When a project is set to public, anyone has read permission to the repositories under this project, and the user does not need to run \"docker login\" before pulling images under this project.",
|
||||
"PROXY_CACHE_BANDWIDTH":"Set the maximum network bandwidth to pull image from upstream for proxy-cache. For unlimited bandwidth, please enter -1. ",
|
||||
"PROXY_CACHE_BANDWIDTH": "Set the maximum network bandwidth to pull image from upstream for proxy-cache. For unlimited bandwidth, please enter -1. ",
|
||||
"BANDWIDTH": "Bandwidth",
|
||||
"SPEED_LIMIT_TIP": "Please enter -1 or an integer greater than 0. ",
|
||||
"OF": "of",
|
||||
@ -486,7 +486,6 @@
|
||||
"CLOUD_EVENT": "CloudEvents",
|
||||
"PAYLOAD_DATA": "Payload Data",
|
||||
"SLACK_RATE_LIMIT": "Please be aware of Slack Rate Limits"
|
||||
|
||||
},
|
||||
"GROUP": {
|
||||
"GROUP": "Group",
|
||||
@ -936,10 +935,9 @@
|
||||
"LDAP_GROUP_MEMBERSHIP": "LDAP Group Membership",
|
||||
"LDAP_GROUP_MEMBERSHIP_INFO": "The attribute indicates the membership of LDAP group, default value is memberof, in some LDAP server it could be \"ismemberof\". This field cannot be empty if you need to enable the LDAP group related feature.",
|
||||
"GROUP_SCOPE": "LDAP Group Search Scope",
|
||||
"GROUP_SCOPE_INFO": "The scope to search for groups, select Subtree by default.",
|
||||
"GROUP_ATTACH_PARALLEL": "LDAP Group Attached In Parallel",
|
||||
"GROUP_ATTACH_PARALLEL_INFO": "Enable this option to attach group in parallel to avoid timeout when there are too many groups. If disabled, the LDAP group information will be attached sequentially."
|
||||
|
||||
"GROUP_SCOPE_INFO": "The scope to search for groups, select Subtree by default.",
|
||||
"GROUP_ATTACH_PARALLEL": "LDAP Group Attached In Parallel",
|
||||
"GROUP_ATTACH_PARALLEL_INFO": "Enable this option to attach group in parallel to avoid timeout when there are too many groups. If disabled, the LDAP group information will be attached sequentially."
|
||||
},
|
||||
"UAA": {
|
||||
"ENDPOINT": "UAA Endpoint",
|
||||
@ -1313,7 +1311,6 @@
|
||||
"ON": "on",
|
||||
"AT": "at",
|
||||
"NOSCHEDULE": "An error occurred in Get schedule"
|
||||
|
||||
},
|
||||
"GC": {
|
||||
"CURRENT_SCHEDULE": "Schedule to GC",
|
||||
@ -1626,6 +1623,14 @@
|
||||
"CREATE_INSTANCE": "Create instance"
|
||||
},
|
||||
"P2P_PROVIDER": {
|
||||
"DRAGONFLY": {
|
||||
"SCOPE": "Scope",
|
||||
"SCOPE_SINGLE_SEED_PEER": "Single Seed Peer",
|
||||
"SCOPE_ALL_SEED_PEERS": "All Seed Peers",
|
||||
"SCOPE_ALL_PEERS": "All Peers",
|
||||
"CLUSTER_IDS": "Cluster IDs",
|
||||
"CLUSTER_IDS_SEPARATOR": "Enter multiple comma separated cluster ids, eg., 1,2,3 (If empty, preheat all clusters)"
|
||||
},
|
||||
"P2P_PROVIDER": "P2P Preheat",
|
||||
"POLICIES": "Policies",
|
||||
"NEW_POLICY": "NEW POLICY",
|
||||
@ -1636,9 +1641,6 @@
|
||||
"TRIGGER": "Trigger",
|
||||
"CREATED": "Creation Time",
|
||||
"DESCRIPTION": "Description",
|
||||
"SCOPE": "Scope",
|
||||
"SCOPE_SINGLE_PEER": "Single Peer",
|
||||
"SCOPE_ALL_PEERS": "All Peers",
|
||||
"NO_POLICY": "No policy",
|
||||
"ENABLED_POLICY_SUMMARY": "Do you want to enable policy {{name}}?",
|
||||
"DISABLED_POLICY_SUMMARY": "Do you want to deactivate policy {{name}}?",
|
||||
|
@ -247,7 +247,7 @@
|
||||
"TOGGLED_SUCCESS": "Proyecto alternado satisfactoriamente.",
|
||||
"FAILED_TO_DELETE_PROJECT": "Project contains repositories or replication rules or helm-charts cannot be deleted.",
|
||||
"INLINE_HELP_PUBLIC": "Cuando un proyecto se marca como público, todo el mundo tiene permisos de lectura sobre los repositorio de dicho proyecto, y no hace falta hacer \"docker login\" antes de subir imágenes a ellos.",
|
||||
"PROXY_CACHE_BANDWIDTH":"Set the maximum network bandwidth to pull image from upstream for proxy-cache. For unlimited bandwidth, please enter -1. ",
|
||||
"PROXY_CACHE_BANDWIDTH": "Set the maximum network bandwidth to pull image from upstream for proxy-cache. For unlimited bandwidth, please enter -1. ",
|
||||
"BANDWIDTH": "Bandwidth",
|
||||
"SPEED_LIMIT_TIP": "Please enter -1 or an integer greater than 0. ",
|
||||
"OF": "of",
|
||||
@ -913,7 +913,6 @@
|
||||
"WEEKLY_CRON": "Run once a week, midnight between Sat/Sun. Equivalente a 0 0 0 * * 0.",
|
||||
"DAILY_CRON": "Run once a day, midnight. Equivalente a 0 0 0 * * *.",
|
||||
"SKIP_SCANNER_PULL_TIME_TOOLTIP": "Vulnerability scanner(e.g. Trivy) will not update the image \"last pull time\" when the image is scanned."
|
||||
|
||||
},
|
||||
"LDAP": {
|
||||
"URL": "LDAP URL",
|
||||
@ -1196,7 +1195,6 @@
|
||||
"ADD_TAG": "ADD TAG",
|
||||
"REMOVE_TAG": "REMOVE TAG",
|
||||
"NAME_ALREADY_EXISTS": "Tag already exists under the repository"
|
||||
|
||||
},
|
||||
"LABEL": {
|
||||
"LABEL": "Label",
|
||||
@ -1307,7 +1305,6 @@
|
||||
"ON": "on",
|
||||
"AT": "at",
|
||||
"NOSCHEDULE": "An error occurred in Get schedule"
|
||||
|
||||
},
|
||||
"GC": {
|
||||
"CURRENT_SCHEDULE": "Schedule to GC",
|
||||
@ -1620,6 +1617,14 @@
|
||||
"CREATE_INSTANCE": "Create instance"
|
||||
},
|
||||
"P2P_PROVIDER": {
|
||||
"DRAGONFLY": {
|
||||
"SCOPE": "Scope",
|
||||
"SCOPE_SINGLE_SEED_PEER": "Single Seed Peer",
|
||||
"SCOPE_ALL_SEED_PEERS": "All Seed Peers",
|
||||
"SCOPE_ALL_PEERS": "All Peers",
|
||||
"CLUSTER_IDS": "Cluster IDs",
|
||||
"CLUSTER_IDS_SEPARATOR": "Enter multiple comma separated cluster ids, eg., 1,2,3 (If empty, preheat all clusters)"
|
||||
},
|
||||
"P2P_PROVIDER": "P2P Preheat",
|
||||
"POLICIES": "Policies",
|
||||
"NEW_POLICY": "NEW POLICY",
|
||||
@ -1630,9 +1635,6 @@
|
||||
"TRIGGER": "Trigger",
|
||||
"CREATED": "Creation Time",
|
||||
"DESCRIPTION": "Description",
|
||||
"SCOPE": "Scope",
|
||||
"SCOPE_SINGLE_PEER": "Single Peer",
|
||||
"SCOPE_ALL_PEERS": "All Peers",
|
||||
"NO_POLICY": "No policy",
|
||||
"ENABLED_POLICY_SUMMARY": "Do you want to enable policy {{name}}?",
|
||||
"DISABLED_POLICY_SUMMARY": "Do you want to disable policy {{name}}?",
|
||||
|
@ -246,7 +246,7 @@
|
||||
"TOGGLED_SUCCESS": "Projet basculé avec succès.",
|
||||
"FAILED_TO_DELETE_PROJECT": "Le projet contient des dépôts, des règles de réplication ou des charts Helm et ne peut pas être supprimé.",
|
||||
"INLINE_HELP_PUBLIC": "Lorsqu'un projet est mis en public, n'importe qui a l'autorisation de lire les dépôts sous ce projet, et l'utilisateur n'a pas besoin d'exécuter \"docker login\" avant de prendre des images de ce projet.",
|
||||
"PROXY_CACHE_BANDWIDTH":"Définissez la bande passante maximale du réseau pour les pulls d'image en amont pour le proxy-cache. Pour une bande passante illimitée, entrez -1. ",
|
||||
"PROXY_CACHE_BANDWIDTH": "Définissez la bande passante maximale du réseau pour les pulls d'image en amont pour le proxy-cache. Pour une bande passante illimitée, entrez -1. ",
|
||||
"BANDWIDTH": "Bande passante",
|
||||
"SPEED_LIMIT_TIP": "Entrez -1 ou un nombre entier supérieur à 0. ",
|
||||
"OF": "sur",
|
||||
@ -340,7 +340,7 @@
|
||||
"SWITCHED_SUCCESS": "Rôle du membre changé avec succès.",
|
||||
"OF": "sur",
|
||||
"SWITCH_TITLE": "Confirmez le changement de membres projet",
|
||||
"SWITCH_SUMMARY": "Voulez-vous changer les membres projet {{param}}?",
|
||||
"SWITCH_SUMMARY": "Voulez-vous changer les membres projet {{param}}?",
|
||||
"SET_ROLE": "Définir Role",
|
||||
"REMOVE": "Retirer",
|
||||
"GROUP_NAME_REQUIRED": "Le nom du groupe est requis",
|
||||
@ -562,7 +562,7 @@
|
||||
"OVERRIDE": "Surcharger",
|
||||
"ENABLED_RULE": "Activer la règle",
|
||||
"OVERRIDE_INFO": "Surcharger",
|
||||
"OPERATION": "Opération",
|
||||
"OPERATION": "Opération",
|
||||
"CURRENT": "courant",
|
||||
"FILTER_PLACEHOLDER": "Filtrer les tâches",
|
||||
"STOP_TITLE": "Confirmer l'arrêt des exécutions",
|
||||
@ -587,7 +587,7 @@
|
||||
"DELETION_TITLE": "Confirmer la suppression de la règle",
|
||||
"DELETION_SUMMARY": "Voulez-vous supprimer la règle {{param}} ?",
|
||||
"REPLICATION_TITLE": "Confirmer la règle de réplication",
|
||||
"REPLICATION_SUMMARY": "Voulez-vous répliquer la règle {{param}}?",
|
||||
"REPLICATION_SUMMARY": "Voulez-vous répliquer la règle {{param}}?",
|
||||
"DELETION_TITLE_FAILURE": "la règle {{param}} n'a pas été supprimée",
|
||||
"DELETION_SUMMARY_FAILURE": "{{param}} ont le statut en attente/en fonctionnement/en train de réessayer",
|
||||
"REPLICATE_SUMMARY_FAILURE": "ont le statut pending/running",
|
||||
@ -602,7 +602,7 @@
|
||||
"TESTING_CONNECTION": "En train de tester la connexion...",
|
||||
"TEST_CONNECTION_SUCCESS": "Connexion testée avec succès.",
|
||||
"TEST_CONNECTION_FAILURE": "Échec du ping de l'endpoint.",
|
||||
"ID": "ID",
|
||||
"ID": "ID",
|
||||
"NAME": "Nom",
|
||||
"NAME_IS_REQUIRED": "Le nom est obligatoire.",
|
||||
"DESCRIPTION": "Description",
|
||||
@ -624,7 +624,7 @@
|
||||
"ACTIVATION": "Activation",
|
||||
"REPLICATION_EXECUTION": "Travaux de réplication",
|
||||
"REPLICATION_EXECUTIONS": "Travaux de réplication",
|
||||
"STOPJOB": "Stop",
|
||||
"STOPJOB": "Stop",
|
||||
"ALL": "Tous",
|
||||
"PENDING": "En attente",
|
||||
"RUNNING": "En fonctionnement",
|
||||
@ -639,7 +639,7 @@
|
||||
"OPERATION": "Opération",
|
||||
"CREATION_TIME": "Heure de départ",
|
||||
"UPDATE_TIME": "Heure de mise à jour",
|
||||
"END_TIME": "Fin",
|
||||
"END_TIME": "Fin",
|
||||
"LOGS": "Logs",
|
||||
"OF": "sur",
|
||||
"ITEMS": "entrées",
|
||||
@ -735,7 +735,7 @@
|
||||
"TEST_CONNECTION": "Test de connexion",
|
||||
"TITLE_EDIT": "Éditer l'endpoint",
|
||||
"TITLE_ADD": "Nouveau endpoint de registre",
|
||||
"EDIT": "Éditer",
|
||||
"EDIT": "Éditer",
|
||||
"DELETE": "Supprimer l'endpoint",
|
||||
"TESTING_CONNECTION": "En train de tester la connexion...",
|
||||
"TEST_CONNECTION_SUCCESS": "Connexion testée avec succès.",
|
||||
@ -805,7 +805,7 @@
|
||||
"COPY": "Copier",
|
||||
"NOTARY_IS_UNDETERMINED": "Ne peut pas déterminer la signature de ce tag.",
|
||||
"PLACEHOLDER": "Nous n'avons trouvé aucun dépôt !",
|
||||
"INFO": "Info",
|
||||
"INFO": "Info",
|
||||
"NO_INFO": "Pas de description pour ce dépôt. Vous pouvez l'ajouter à ce dépôt.",
|
||||
"IMAGE": "Images",
|
||||
"LABELS": "Labels",
|
||||
@ -1623,6 +1623,14 @@
|
||||
"CREATE_INSTANCE": "Créer une instance"
|
||||
},
|
||||
"P2P_PROVIDER": {
|
||||
"DRAGONFLY": {
|
||||
"SCOPE": "Scope",
|
||||
"SCOPE_SINGLE_SEED_PEER": "Single Seed Peer",
|
||||
"SCOPE_ALL_SEED_PEERS": "All Seed Peers",
|
||||
"SCOPE_ALL_PEERS": "All Peers",
|
||||
"CLUSTER_IDS": "Cluster IDs",
|
||||
"CLUSTER_IDS_SEPARATOR": "Enter multiple comma separated cluster ids, eg., 1,2,3 (If empty, preheat all clusters)"
|
||||
},
|
||||
"P2P_PROVIDER": "Préchauffage P2P",
|
||||
"POLICIES": "Stratégies",
|
||||
"NEW_POLICY": "Nouvelle stratégie",
|
||||
@ -1633,9 +1641,6 @@
|
||||
"TRIGGER": "Déclencheur",
|
||||
"CREATED": "Date/Heure de création",
|
||||
"DESCRIPTION": "Description",
|
||||
"SCOPE": "Champ d'application",
|
||||
"SCOPE_SINGLE_PEER": "Pair unique",
|
||||
"SCOPE_ALL_PEERS": "Tous les pairs",
|
||||
"NO_POLICY": "Aucune stratégie",
|
||||
"ENABLED_POLICY_SUMMARY": "Voulez-vous activer la stratégie {{name}} ?",
|
||||
"DISABLED_POLICY_SUMMARY": "Voulez-vous désactiver la stratégie {{name}} ?",
|
||||
|
@ -246,7 +246,7 @@
|
||||
"TOGGLED_SUCCESS": "프로젝트가 성공적으로 전환됐습니다.",
|
||||
"FAILED_TO_DELETE_PROJECT": "프로젝트에 리포지토리 또는 복제 규칙이 포함되어 있거나 헬름 차트를 삭제할 수 없습니다.",
|
||||
"INLINE_HELP_PUBLIC": "프로젝트가 공개로 설정되면 누구나 이 프로젝트의 저장소에 대한 읽기 권한을 갖게 되며 사용자는 이 프로젝트에서 이미지를 가져오기 전에 \"docker login\"을 실행할 필요가 없습니다.",
|
||||
"PROXY_CACHE_BANDWIDTH":"Set the maximum network bandwidth to pull image from upstream for proxy-cache. For unlimited bandwidth, please enter -1. ",
|
||||
"PROXY_CACHE_BANDWIDTH": "Set the maximum network bandwidth to pull image from upstream for proxy-cache. For unlimited bandwidth, please enter -1. ",
|
||||
"BANDWIDTH": "Bandwidth",
|
||||
"SPEED_LIMIT_TIP": "Please enter -1 or an integer greater than 0. ",
|
||||
"OF": "of",
|
||||
@ -483,7 +483,6 @@
|
||||
"CLOUD_EVENT": "클라우드이벤트",
|
||||
"PAYLOAD_DATA": "페이로드 데이터",
|
||||
"SLACK_RATE_LIMIT": "Slack 속도 제한에 유의하세요."
|
||||
|
||||
},
|
||||
"GROUP": {
|
||||
"GROUP": "그룹",
|
||||
@ -934,7 +933,6 @@
|
||||
"LDAP_GROUP_MEMBERSHIP_INFO": "속성은 LDAP 그룹의 멤버십을 나타내며 기본값은 memberof이며 일부 LDAP 서버에서는 \"ismemberof\"일 수 있습니다. LDAP 그룹 관련 기능을 활성화해야 하는 경우 이 필드를 비워둘 수 없습니다.",
|
||||
"GROUP_SCOPE": "LDAP 그룹 검색 범위",
|
||||
"GROUP_SCOPE_INFO": "그룹을 검색할 범위는 기본적으로 Subtree를 선택합니다."
|
||||
|
||||
},
|
||||
"UAA": {
|
||||
"ENDPOINT": "UAA 엔드포인트",
|
||||
@ -1308,7 +1306,6 @@
|
||||
"ON": "on",
|
||||
"AT": "at",
|
||||
"NOSCHEDULE": "예약내역을 가져오던 중 에러가 발생했습니다"
|
||||
|
||||
},
|
||||
"GC": {
|
||||
"CURRENT_SCHEDULE": "가비지 컬렉션 예약",
|
||||
@ -1617,6 +1614,14 @@
|
||||
"CREATE_INSTANCE": "인스턴스 생성"
|
||||
},
|
||||
"P2P_PROVIDER": {
|
||||
"DRAGONFLY": {
|
||||
"SCOPE": "Scope",
|
||||
"SCOPE_SINGLE_SEED_PEER": "Single Seed Peer",
|
||||
"SCOPE_ALL_SEED_PEERS": "All Seed Peers",
|
||||
"SCOPE_ALL_PEERS": "All Peers",
|
||||
"CLUSTER_IDS": "Cluster IDs",
|
||||
"CLUSTER_IDS_SEPARATOR": "Enter multiple comma separated cluster ids, eg., 1,2,3 (If empty, preheat all clusters)"
|
||||
},
|
||||
"P2P_PROVIDER": "P2P 예열",
|
||||
"POLICIES": "정책",
|
||||
"NEW_POLICY": "새 정책",
|
||||
@ -1627,9 +1632,6 @@
|
||||
"TRIGGER": "트리거",
|
||||
"CREATED": "생성 시간",
|
||||
"DESCRIPTION": "설명",
|
||||
"SCOPE": "범위",
|
||||
"SCOPE_SINGLE_PEER": "싱글 피어",
|
||||
"SCOPE_ALL_PEERS": "모든 피어",
|
||||
"NO_POLICY": "정책 없음",
|
||||
"ENABLED_POLICY_SUMMARY": "정책{{name}}을 활성화하시겠습니까?",
|
||||
"DISABLED_POLICY_SUMMARY": "정책{{name}}을 비활성화하시겠습니까?",
|
||||
|
@ -245,7 +245,7 @@
|
||||
"TOGGLED_SUCCESS": "Projeto alterado com sucesso.",
|
||||
"FAILED_TO_DELETE_PROJECT": "Projeto não pode ser removido porque ainda possui recursos em repositórios, regras de replicação ou helm charts.",
|
||||
"INLINE_HELP_PUBLIC": "Quando o projeto é público, o acesso de leitura aos repositórios é liberado, incluindo usuários anônimos não autenticados. O usuário não precisa executar \"docker login\" para baixar imagens desse projeto.",
|
||||
"PROXY_CACHE_BANDWIDTH":"Set the maximum network bandwidth to pull image from upstream for proxy-cache. For unlimited bandwidth, please enter -1. ",
|
||||
"PROXY_CACHE_BANDWIDTH": "Set the maximum network bandwidth to pull image from upstream for proxy-cache. For unlimited bandwidth, please enter -1. ",
|
||||
"BANDWIDTH": "Bandwidth",
|
||||
"SPEED_LIMIT_TIP": "Please enter -1 or an integer greater than 0. ",
|
||||
"OF": "de",
|
||||
@ -933,7 +933,6 @@
|
||||
"LDAP_GROUP_MEMBERSHIP_INFO": "Atributo que informa a lista de grupos do usuário. Se não informado, o nome \"memberof\" será usado. Alguns servidores LDAP utilizam o atributo \"ismemberof\". This field cannot be empty if you need to enable the LDAP group related feature.",
|
||||
"GROUP_SCOPE": "LDAP Group Search Scope",
|
||||
"GROUP_SCOPE_INFO": "O escopo que deve ser utilizado na busca por grupos, utiliza Subtree por padrão."
|
||||
|
||||
},
|
||||
"UAA": {
|
||||
"ENDPOINT": "Endereço UAA",
|
||||
@ -1303,7 +1302,6 @@
|
||||
"ON": "em",
|
||||
"AT": "às",
|
||||
"NOSCHEDULE": "Ocorreu um erro na rotina Get"
|
||||
|
||||
},
|
||||
"GC": {
|
||||
"CURRENT_SCHEDULE": "Agenda",
|
||||
@ -1620,6 +1618,14 @@
|
||||
"CREATE_INSTANCE": "Criar instância"
|
||||
},
|
||||
"P2P_PROVIDER": {
|
||||
"DRAGONFLY": {
|
||||
"SCOPE": "Scope",
|
||||
"SCOPE_SINGLE_SEED_PEER": "Single Seed Peer",
|
||||
"SCOPE_ALL_SEED_PEERS": "All Seed Peers",
|
||||
"SCOPE_ALL_PEERS": "All Peers",
|
||||
"CLUSTER_IDS": "Cluster IDs",
|
||||
"CLUSTER_IDS_SEPARATOR": "Enter multiple comma separated cluster ids, eg., 1,2,3 (If empty, preheat all clusters)"
|
||||
},
|
||||
"P2P_PROVIDER": "Pré-análise P2P",
|
||||
"POLICIES": "Políticas",
|
||||
"NEW_POLICY": "NOVA POLÍTICA",
|
||||
@ -1630,9 +1636,6 @@
|
||||
"TRIGGER": "Disparo",
|
||||
"CREATED": "Criado em",
|
||||
"DESCRIPTION": "Descrição",
|
||||
"SCOPE": "Escopo",
|
||||
"SCOPE_SINGLE_PEER": "Par único",
|
||||
"SCOPE_ALL_PEERS": "Todos os pares",
|
||||
"NO_POLICY": "Nenhuma política",
|
||||
"ENABLED_POLICY_SUMMARY": "Gostaria de habilitar a política {{name}}?",
|
||||
"DISABLED_POLICY_SUMMARY": "Gostaria de desabilitar a política {{name}}?",
|
||||
|
@ -246,7 +246,7 @@
|
||||
"TOGGLED_SUCCESS": "Proje başarıyla değiştirildi.",
|
||||
"FAILED_TO_DELETE_PROJECT": "Proje havuzları veya çoğaltma kurallarını içeriyor veya helm tabloları silinemiyor.",
|
||||
"INLINE_HELP_PUBLIC": "Bir proje herkese açık olarak ayarlandığında, herkes bu proje altındaki depoları okuma iznine sahiptir ve kullanıcının bu proje altındaki imajları çekmeden önce \"docker login\" çalıştırması gerekmez.",
|
||||
"PROXY_CACHE_BANDWIDTH":"Set the maximum network bandwidth to pull image from upstream for proxy-cache. For unlimited bandwidth, please enter -1. ",
|
||||
"PROXY_CACHE_BANDWIDTH": "Set the maximum network bandwidth to pull image from upstream for proxy-cache. For unlimited bandwidth, please enter -1. ",
|
||||
"BANDWIDTH": "Bandwidth",
|
||||
"SPEED_LIMIT_TIP": "Please enter -1 or an integer greater than 0. ",
|
||||
"OF": "of",
|
||||
@ -936,7 +936,6 @@
|
||||
"LDAP_GROUP_MEMBERSHIP_INFO": "Öznitelik, LDAP grubunun üyeliğini gösterir, varsayılan değer memberof, bazı LDAP sunucularında \"ismemberof\" olabilir. This field cannot be empty if you need to enable the LDAP group related feature.",
|
||||
"GROUP_SCOPE": "LDAP Group Search Scope",
|
||||
"GROUP_SCOPE_INFO": "Grupları aramak için kapsamı, Varsayılan olarak Alt Ağaç'ı seçin."
|
||||
|
||||
},
|
||||
"UAA": {
|
||||
"ENDPOINT": "UAA Uç Noktası",
|
||||
@ -1310,7 +1309,6 @@
|
||||
"ON": "on",
|
||||
"AT": "at",
|
||||
"NOSCHEDULE": "Takvimlendirme de bir hata oluştu"
|
||||
|
||||
},
|
||||
"GC": {
|
||||
"CURRENT_SCHEDULE": "Schedule to GC",
|
||||
@ -1623,6 +1621,14 @@
|
||||
"CREATE_INSTANCE": "Create instance"
|
||||
},
|
||||
"P2P_PROVIDER": {
|
||||
"DRAGONFLY": {
|
||||
"SCOPE": "Scope",
|
||||
"SCOPE_SINGLE_SEED_PEER": "Single Seed Peer",
|
||||
"SCOPE_ALL_SEED_PEERS": "All Seed Peers",
|
||||
"SCOPE_ALL_PEERS": "All Peers",
|
||||
"CLUSTER_IDS": "Cluster IDs",
|
||||
"CLUSTER_IDS_SEPARATOR": "Enter multiple comma separated cluster ids, eg., 1,2,3 (If empty, preheat all clusters)"
|
||||
},
|
||||
"P2P_PROVIDER": "P2P Preheat",
|
||||
"POLICIES": "Policies",
|
||||
"NEW_POLICY": "NEW POLICY",
|
||||
@ -1633,9 +1639,6 @@
|
||||
"TRIGGER": "Trigger",
|
||||
"CREATED": "Creation Time",
|
||||
"DESCRIPTION": "Description",
|
||||
"SCOPE": "Scope",
|
||||
"SCOPE_SINGLE_PEER": "Single Peer",
|
||||
"SCOPE_ALL_PEERS": "All Peers",
|
||||
"NO_POLICY": "No policy",
|
||||
"ENABLED_POLICY_SUMMARY": "Do you want to enable policy {{name}}?",
|
||||
"DISABLED_POLICY_SUMMARY": "Do you want to disable policy {{name}}?",
|
||||
|
@ -246,7 +246,7 @@
|
||||
"TOGGLED_SUCCESS": "切换状态成功。",
|
||||
"FAILED_TO_DELETE_PROJECT": "项目包含镜像仓库或复制规则或Helm Charts,无法删除。",
|
||||
"INLINE_HELP_PUBLIC": "当项目设为公开后,任何人都有此项目下镜像的读权限。命令行用户不需要“docker login”就可以拉取此项目下的镜像。",
|
||||
"PROXY_CACHE_BANDWIDTH":"Set the maximum network bandwidth to pull image from upstream for proxy-cache. For unlimited bandwidth, please enter -1. ",
|
||||
"PROXY_CACHE_BANDWIDTH": "Set the maximum network bandwidth to pull image from upstream for proxy-cache. For unlimited bandwidth, please enter -1. ",
|
||||
"BANDWIDTH": "Bandwidth",
|
||||
"SPEED_LIMIT_TIP": "Please enter -1 or an integer greater than 0. ",
|
||||
"COUNT_QUOTA": "存储数量",
|
||||
@ -934,10 +934,9 @@
|
||||
"LDAP_GROUP_MEMBERSHIP": "LDAP 组成员",
|
||||
"LDAP_GROUP_MEMBERSHIP_INFO": "LDAP组成员的membership属性,默认为 memberof, 在某些LDAP服务器会变为 ismemberof。如果要开启LDAP组功能,则此项必填",
|
||||
"GROUP_SCOPE": "LDAP组搜索范围",
|
||||
"GROUP_SCOPE_INFO": "搜索组的范围,默认值为\"子树\"",
|
||||
"GROUP_ATTACH_PARALLEL": "LDAP组并行同步",
|
||||
"GROUP_ATTACH_PARALLEL_INFO": "打开这个选项时,LDAP组的信息是并行同步到Harbor, 这样可以防止用户组太多时造成的登录超时,如果关闭这个选项,LDAP组信息是顺序同步到Harbor"
|
||||
|
||||
"GROUP_SCOPE_INFO": "搜索组的范围,默认值为\"子树\"",
|
||||
"GROUP_ATTACH_PARALLEL": "LDAP组并行同步",
|
||||
"GROUP_ATTACH_PARALLEL_INFO": "打开这个选项时,LDAP组的信息是并行同步到Harbor, 这样可以防止用户组太多时造成的登录超时,如果关闭这个选项,LDAP组信息是顺序同步到Harbor"
|
||||
},
|
||||
"UAA": {
|
||||
"ENDPOINT": "UAA Endpoint",
|
||||
@ -1309,7 +1308,6 @@
|
||||
"ON": " ",
|
||||
"AT": " ",
|
||||
"NOSCHEDULE": "获取schedule时出现错误"
|
||||
|
||||
},
|
||||
"GC": {
|
||||
"CURRENT_SCHEDULE": "当前定时任务",
|
||||
@ -1622,6 +1620,14 @@
|
||||
"CREATE_INSTANCE": "新建实例"
|
||||
},
|
||||
"P2P_PROVIDER": {
|
||||
"DRAGONFLY": {
|
||||
"SCOPE": "范围",
|
||||
"SCOPE_SINGLE_SEED_PEER": "单个种子节点",
|
||||
"SCOPE_ALL_SEED_PEERS": "所有种子节点",
|
||||
"SCOPE_ALL_PEERS": "所有节点",
|
||||
"CLUSTER_IDS": "集群 IDs",
|
||||
"CLUSTER_IDS_SEPARATOR": "使用逗号分隔集群ID, 例如 1,2,3 (若为空则预热所有集群)"
|
||||
},
|
||||
"P2P_PROVIDER": "P2P 预热",
|
||||
"POLICIES": "策略",
|
||||
"NEW_POLICY": "新建策略",
|
||||
@ -1632,9 +1638,6 @@
|
||||
"TRIGGER": "触发器",
|
||||
"CREATED": "创建时间",
|
||||
"DESCRIPTION": "描述",
|
||||
"SCOPE": "范围",
|
||||
"SCOPE_SINGLE_PEER": "单节点",
|
||||
"SCOPE_ALL_PEERS": "全节点",
|
||||
"NO_POLICY": "暂无记录",
|
||||
"ENABLED_POLICY_SUMMARY": "是否启用策略 {{name}}?",
|
||||
"DISABLED_POLICY_SUMMARY": "是否禁用策略 {{name}}?",
|
||||
|
File diff suppressed because it is too large
Load Diff
@ -483,7 +483,7 @@ func convertPolicyToPayload(policy *policy.Schema) (*models.PreheatPolicy, error
|
||||
ProjectID: policy.ProjectID,
|
||||
ProviderID: policy.ProviderID,
|
||||
Trigger: policy.TriggerStr,
|
||||
Scope: policy.Scope,
|
||||
ExtraAttrs: policy.ExtraAttrsStr,
|
||||
UpdateTime: strfmt.DateTime(policy.UpdatedTime),
|
||||
}, nil
|
||||
}
|
||||
@ -504,17 +504,17 @@ func convertParamPolicyToModelPolicy(model *models.PreheatPolicy) (*policy.Schem
|
||||
}
|
||||
|
||||
return &policy.Schema{
|
||||
ID: model.ID,
|
||||
Name: model.Name,
|
||||
Description: model.Description,
|
||||
ProjectID: model.ProjectID,
|
||||
ProviderID: model.ProviderID,
|
||||
FiltersStr: model.Filters,
|
||||
TriggerStr: model.Trigger,
|
||||
Enabled: model.Enabled,
|
||||
Scope: model.Scope,
|
||||
CreatedAt: time.Time(model.CreationTime),
|
||||
UpdatedTime: time.Time(model.UpdateTime),
|
||||
ID: model.ID,
|
||||
Name: model.Name,
|
||||
Description: model.Description,
|
||||
ProjectID: model.ProjectID,
|
||||
ProviderID: model.ProviderID,
|
||||
FiltersStr: model.Filters,
|
||||
TriggerStr: model.Trigger,
|
||||
Enabled: model.Enabled,
|
||||
ExtraAttrsStr: model.ExtraAttrs,
|
||||
CreatedAt: time.Time(model.CreationTime),
|
||||
UpdatedTime: time.Time(model.UpdateTime),
|
||||
}, nil
|
||||
}
|
||||
|
||||
|
@ -79,7 +79,6 @@ func Test_convertPolicyToPayload(t *testing.T) {
|
||||
Trigger: nil,
|
||||
TriggerStr: "",
|
||||
Enabled: false,
|
||||
Scope: "all_peers",
|
||||
CreatedAt: time.Time{},
|
||||
UpdatedTime: time.Time{},
|
||||
},
|
||||
@ -93,7 +92,6 @@ func Test_convertPolicyToPayload(t *testing.T) {
|
||||
ProjectID: 0,
|
||||
ProviderID: 0,
|
||||
Trigger: "",
|
||||
Scope: "all_peers",
|
||||
UpdateTime: strfmt.DateTime{},
|
||||
},
|
||||
},
|
||||
@ -143,7 +141,6 @@ func Test_convertParamPolicyToModelPolicy(t *testing.T) {
|
||||
ProjectID: 0,
|
||||
ProviderID: 0,
|
||||
Trigger: "",
|
||||
Scope: "single_peer",
|
||||
UpdateTime: strfmt.DateTime{},
|
||||
},
|
||||
expect: &policy.Schema{
|
||||
@ -157,7 +154,6 @@ func Test_convertParamPolicyToModelPolicy(t *testing.T) {
|
||||
Trigger: nil,
|
||||
TriggerStr: "",
|
||||
Enabled: false,
|
||||
Scope: "single_peer",
|
||||
CreatedAt: time.Time{},
|
||||
UpdatedTime: time.Time{},
|
||||
},
|
||||
|
Loading…
Reference in New Issue
Block a user