Skip to content

Commit

Permalink
Merge branch 'main' into feat/add-job-skipper
Browse files Browse the repository at this point in the history
  • Loading branch information
bupd authored Feb 13, 2025
2 parents bd43b88 + cc96643 commit 14f8c56
Show file tree
Hide file tree
Showing 9 changed files with 69 additions and 22 deletions.
4 changes: 2 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@
</br> </br>

**Note**: The `main` branch may be in an *unstable or even broken state* during development.
Please use [releases](https://github.com/vmware/harbor/releases) instead of the `main` branch in order to get a stable set of binaries.
Please use [releases](https://github.com/goharbor/harbor/releases) instead of the `main` branch in order to get a stable set of binaries.

<img alt="Harbor" src="https://raw.githubusercontent.com/goharbor/website/master/docs/img/readme/harbor_logo.png">

Expand Down Expand Up @@ -57,7 +57,7 @@ For learning the architecture design of Harbor, check the document [Architecture

**On a Linux host:** docker 20.10.10-ce+ and docker-compose 1.18.0+ .

Download binaries of **[Harbor release ](https://github.com/vmware/harbor/releases)** and follow **[Installation & Configuration Guide](https://goharbor.io/docs/latest/install-config/)** to install Harbor.
Download binaries of **[Harbor release ](https://github.com/goharbor/harbor/releases)** and follow **[Installation & Configuration Guide](https://goharbor.io/docs/latest/install-config/)** to install Harbor.

If you want to deploy Harbor on Kubernetes, please use the **[Harbor chart](https://github.com/goharbor/harbor-helm)**.

Expand Down
2 changes: 2 additions & 0 deletions src/controller/event/handler/webhook/artifact/replication.go
Original file line number Diff line number Diff line change
Expand Up @@ -163,6 +163,8 @@ func constructReplicationPayload(ctx context.Context, event *event.ReplicationEv
OverrideMode: rpPolicy.Override,
TriggerType: string(execution.Trigger),
ExecutionTimestamp: execution.StartTime.Unix(),
ExecutionID: execution.ID,
TaskID: task.ID,
},
},
}
Expand Down
2 changes: 2 additions & 0 deletions src/controller/event/model/event.go
Original file line number Diff line number Diff line change
Expand Up @@ -36,6 +36,8 @@ type Replication struct {
DestResource *ReplicationResource `json:"dest_resource,omitempty"`
SuccessfulArtifact []*ArtifactInfo `json:"successful_artifact,omitempty"`
FailedArtifact []*ArtifactInfo `json:"failed_artifact,omitempty"`
ExecutionID int64 `json:"execution_id,omitempty"`
TaskID int64 `json:"task_id,omitempty"`
}

// ArtifactInfo describe info of artifact
Expand Down
10 changes: 5 additions & 5 deletions src/go.mod
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ require (
github.com/Masterminds/semver v1.5.0
github.com/aliyun/alibaba-cloud-sdk-go v1.63.84
github.com/asaskevich/govalidator v0.0.0-20230301143203-a9d515a09cc2
github.com/aws/aws-sdk-go v1.55.5
github.com/aws/aws-sdk-go v1.55.6
github.com/beego/beego/v2 v2.3.4
github.com/beego/i18n v0.0.0-20140604031826-e87155e8f0c0
github.com/bmatcuk/doublestar v1.3.4
Expand All @@ -19,14 +19,14 @@ require (
github.com/docker/distribution v2.8.3+incompatible
github.com/docker/libtrust v0.0.0-20160708172513-aabc10ec26b7
github.com/go-asn1-ber/asn1-ber v1.5.7
github.com/go-ldap/ldap/v3 v3.4.6
github.com/go-ldap/ldap/v3 v3.4.10
github.com/go-openapi/errors v0.22.0
github.com/go-openapi/loads v0.22.0
github.com/go-openapi/loads v0.22.0 // indirect
github.com/go-openapi/runtime v0.28.0
github.com/go-openapi/spec v0.21.0
github.com/go-openapi/spec v0.21.0 // indirect
github.com/go-openapi/strfmt v0.23.0
github.com/go-openapi/swag v0.23.0
github.com/go-openapi/validate v0.24.0
github.com/go-openapi/validate v0.24.0 // indirect
github.com/go-redis/redis/v8 v8.11.4
github.com/gocarina/gocsv v0.0.0-20210516172204-ca9e8a8ddea8
github.com/gocraft/work v0.5.1
Expand Down
55 changes: 47 additions & 8 deletions src/go.sum

Large diffs are not rendered by default.

8 changes: 6 additions & 2 deletions src/pkg/ldap/ldap.go
Original file line number Diff line number Diff line change
Expand Up @@ -209,14 +209,18 @@ func (s *Session) Open() error {

switch protocol {
case "ldap":
ldap, err := goldap.Dial("tcp", hostport)
ldap, err := goldap.DialURL(ldapURL)
if err != nil {
return err
}
s.ldapConn = ldap
case "ldaps":
log.Debug("Start to dial ldaps")
ldap, err := goldap.DialTLS("tcp", hostport, &tls.Config{ServerName: host, InsecureSkipVerify: !s.basicCfg.VerifyCert})
tc := &tls.Config{
ServerName: host,
InsecureSkipVerify: !s.basicCfg.VerifyCert,
}
ldap, err := goldap.DialURL(ldapURL, goldap.DialWithTLSConfig(tc))
if err != nil {
return err
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -21,4 +21,4 @@ export const NO: string = 'TAG_RETENTION.NO';

export const REFRESH_STATUS_TIME_DIFFERENCE: number = 5000;

export const WORKER_OPTIONS: number[] = [1, 2, 3, 4, 5];
export const WORKER_OPTIONS: number[] = [1, 2, 3, 4, 5, 6, 7, 8, 9, 10];
6 changes: 3 additions & 3 deletions src/server/v2.0/handler/gc.go
Original file line number Diff line number Diff line change
Expand Up @@ -106,7 +106,7 @@ func (g *gcAPI) kick(ctx context.Context, scheType string, cron string, paramete
return 0, errors.BadRequestError(fmt.Errorf("workers should be integer format"))
}
if !validateWorkers(int(wInt)) {
return 0, errors.New(nil).WithCode(errors.BadRequestCode).WithMessagef("Error: Invalid number of workers:%s. Workers must be greater than 0 and less than or equal to 5.", workers)
return 0, errors.New(nil).WithCode(errors.BadRequestCode).WithMessagef("Error: Invalid number of workers:%s. Workers must be greater than 0 and less than or equal to 10.", workers)
}
policy.Workers = int(wInt)
}
Expand All @@ -130,7 +130,7 @@ func (g *gcAPI) kick(ctx context.Context, scheType string, cron string, paramete
return 0, errors.BadRequestError(fmt.Errorf("workers should be integer format"))
}
if !validateWorkers(int(wInt)) {
return 0, errors.New(nil).WithCode(errors.BadRequestCode).WithMessagef("Error: Invalid number of workers:%s. Workers must be greater than 0 and less than or equal to 5.", workers)
return 0, errors.New(nil).WithCode(errors.BadRequestCode).WithMessagef("Error: Invalid number of workers:%s. Workers must be greater than 0 and less than or equal to 10.", workers)
}
policy.Workers = int(wInt)
}
Expand Down Expand Up @@ -284,7 +284,7 @@ func (g *gcAPI) StopGC(ctx context.Context, params operation.StopGCParams) middl
}

func validateWorkers(workers int) bool {
if workers <= 0 || workers > 5 {
if workers <= 0 || workers > 10 {
return false
}
return true
Expand Down
2 changes: 1 addition & 1 deletion src/server/v2.0/handler/gc_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ import (

func TestValidateWorkers(t *testing.T) {
assert.False(t, validateWorkers(0))
assert.False(t, validateWorkers(10))
assert.False(t, validateWorkers(15))
assert.False(t, validateWorkers(-1))
assert.True(t, validateWorkers(1))
assert.True(t, validateWorkers(5))
Expand Down

0 comments on commit 14f8c56

Please sign in to comment.