Создание задания и сборка с помощью Jenkins API, который развертывается с помощью диаграммы Helm. - PullRequest
0 голосов
/ 09 июля 2020

Я занимаюсь автоматизацией развертывания Jenkins и создаю рабочие места. Я развернул контейнер Jenkins с помощью диаграммы Helm в кластере IKS. Затем я попытался создать задания с помощью Jenkins API, но это закончилось с ошибкой ниже.

Я использую команду ниже для создания задания:

curl -d @authindex.xml -H 'Content-Type: text/xml' 'http://jenkins-qa-str.str-np-cluster-130016-d49ed5d9acfe3ceefe5258366bb16b0a-0000.us-east.containers.appdomain.cloud/createItem?name=new'

Он возвращает ошибку ниже :

<html>
<head>
<meta http-equiv="Content-Type" content="text/html;charset=utf-8"/>
<title>Error 403 No valid crumb was included in the request</title>
</head>
<body><h2>HTTP ERROR 403 No valid crumb was included in the request</h2>
<table>
<tr><th>URI:</th><td>/createItem</td></tr>
<tr><th>STATUS:</th><td>403</td></tr>
<tr><th>MESSAGE:</th><td>No valid crumb was included in the request</td></tr>
<tr><th>SERVLET:</th><td>Stapler</td></tr>
</table>
<hr><a href="http://eclipse.org/jetty">Powered by Jetty:// 9.4.27.v20200227</a><hr/>

</body>
</html>

Если я попытаюсь получить крошку с помощью приведенной ниже команды, я получу следующую ошибку:

CRUMB=$(curl http://jenkins-dev-str.str-np-cluster-130016-d49ed5d9acfe3ceefe5258366bb16b0a-0000.us- 
    east.containers.appdomain.cloud/crumbIssuer/api/xml?xpath=concat\ 
    (//crumbRequestField,%22:%22,//crumb\) -c cookies.txt --user 'username:password')

Ошибка:

Трассировка стека hudson.security.AccessDeniedException2: у анонимного пользователя отсутствует разрешение Общее / Чтение в hudson.security.ACL.checkPermission (ACL. java: 78) в hudson.security.AccessControlled.checkPermissio

...