mirror of
https://github.com/goharbor/harbor.git
synced 2024-11-26 12:15:20 +01:00
Merge pull request #8530 from danfengliu/get-ca-from-harbor-api
After helm cli test was added to nightly, ca was get by reading from …
This commit is contained in:
commit
4f7e225e69
@ -6,31 +6,6 @@ import base
|
||||
import swagger_client
|
||||
|
||||
class Replication(base.Base):
|
||||
def create_replication_rule(self,
|
||||
projectIDList, targetIDList, name=None, desc="",
|
||||
filters=[], trigger=swagger_client.RepTrigger(kind="Manual"),
|
||||
replicate_deletion=True,
|
||||
replicate_existing_image_now=False,
|
||||
expect_status_code = 201,
|
||||
**kwargs):
|
||||
if name is None:
|
||||
name = base._random_name("rule")
|
||||
projects = []
|
||||
for projectID in projectIDList:
|
||||
projects.append(swagger_client.Project(project_id=int(projectID)))
|
||||
targets = []
|
||||
for targetID in targetIDList:
|
||||
targets.append(swagger_client.RepTarget(id=int(targetID)))
|
||||
for filter in filters:
|
||||
filter["value"] = int(filter["value"])
|
||||
client = self._get_client(**kwargs)
|
||||
policy = swagger_client.RepPolicy(name=name, description=desc,
|
||||
projects=projects, targets=targets, filters=filters,
|
||||
trigger=trigger, replicate_deletion=replicate_deletion,
|
||||
replicate_existing_image_now=replicate_existing_image_now)
|
||||
_, status_code, header = client.policies_replication_post_with_http_info(policy)
|
||||
base._assert_status_code(expect_status_code, status_code)
|
||||
return base._get_id_from_header(header), name
|
||||
|
||||
def get_replication_rule(self, param = None, rule_id = None, expect_status_code = 200, **kwargs):
|
||||
client = self._get_client(**kwargs)
|
||||
|
@ -18,6 +18,9 @@ Library OperatingSystem
|
||||
Library Process
|
||||
|
||||
*** Keywords ***
|
||||
Prepare Helm Cert
|
||||
Wait Unitl Command Success cp harbor_ca.crt /helm_ca/server.crt
|
||||
|
||||
Helm Repo Add
|
||||
[Arguments] ${harbor_url} ${user} ${pwd} ${project_name}=library ${helm_repo_name}=myrepo
|
||||
${rc} ${output}= Run And Return Rc And Output helm repo remove ${project_name}
|
||||
|
@ -32,6 +32,7 @@ CA Setup
|
||||
Run mv ${cert} harbor_ca.crt
|
||||
Generate Certificate Authority For Chrome ${HARBOR_PASSWORD}
|
||||
Prepare Docker Cert ${ip}
|
||||
Prepare Helm Cert
|
||||
|
||||
Collect Nightly Logs
|
||||
[Arguments] ${ip} ${SSH_PWD} ${ip1}==${EMPTY}
|
||||
|
Loading…
Reference in New Issue
Block a user