-
Notifications
You must be signed in to change notification settings - Fork 113
fix(tekton/v1): request publisher with auth #4568
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: main
Are you sure you want to change the base?
Changes from 3 commits
28063db
6db0528
a50934f
f8546ef
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -36,6 +36,9 @@ spec: | |
| default: "" | ||
| - name: boskos-server-url | ||
| default: "http://boskos" | ||
| - name: publisher-auth-secret-name | ||
| description: Name of the Secret containing publisher basic auth credentials. | ||
| default: publisher-auth | ||
| - name: publisher-url | ||
| default: "https://publisher.pingcap.net" | ||
| - name: git-instead-of | ||
|
|
@@ -125,6 +128,9 @@ spec: | |
| # - name: cypress-cache | ||
| # persistentVolumeClaim: | ||
| # claimName: cypress-cache | ||
| - name: publisher-auth | ||
| secret: | ||
| secretName: $(tt.params.publisher-auth-secret-name) | ||
|
Comment on lines
+131
to
+133
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. This mapping will cause the |
||
| - apiVersion: tekton.dev/v1 | ||
| kind: PipelineRun | ||
| metadata: | ||
|
|
@@ -205,6 +211,9 @@ spec: | |
| # - name: cypress-cache | ||
| # persistentVolumeClaim: | ||
| # claimName: cypress-cache | ||
| - name: publisher-auth | ||
| secret: | ||
| secretName: $(tt.params.publisher-auth-secret-name) | ||
| - apiVersion: tekton.dev/v1 | ||
| kind: PipelineRun | ||
| metadata: | ||
|
|
@@ -267,6 +276,9 @@ spec: | |
| - name: mac-ssh-credentials | ||
| secret: | ||
| secretName: mac-ssh-credentials | ||
| - name: publisher-auth | ||
| secret: | ||
| secretName: $(tt.params.publisher-auth-secret-name) | ||
| - apiVersion: tekton.dev/v1 | ||
| kind: PipelineRun | ||
| metadata: | ||
|
|
@@ -329,3 +341,6 @@ spec: | |
| - name: mac-ssh-credentials | ||
| secret: | ||
| secretName: mac-ssh-credentials | ||
| - name: publisher-auth | ||
| secret: | ||
| secretName: $(tt.params.publisher-auth-secret-name) | ||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -35,6 +35,9 @@ spec: | |
| default: "" | ||
| - name: boskos-server-url | ||
| default: "http://boskos" | ||
| - name: publisher-auth-secret-name | ||
| description: Name of the Secret containing publisher basic auth credentials. | ||
| default: publisher-auth | ||
| - name: publisher-url | ||
| default: "https://publisher.pingcap.net" | ||
| - name: git-instead-of | ||
|
|
@@ -110,6 +113,9 @@ spec: | |
| - name: mac-ssh-credentials | ||
| secret: | ||
| secretName: mac-ssh-credentials | ||
| - name: publisher-auth | ||
| secret: | ||
| secretName: $(tt.params.publisher-auth-secret-name) | ||
|
Comment on lines
+116
to
+118
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. |
||
| - apiVersion: tekton.dev/v1 | ||
| kind: PipelineRun | ||
| metadata: | ||
|
|
@@ -176,3 +182,6 @@ spec: | |
| - name: mac-ssh-credentials | ||
| secret: | ||
| secretName: mac-ssh-credentials | ||
| - name: publisher-auth | ||
| secret: | ||
| secretName: $(tt.params.publisher-auth-secret-name) | ||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -37,6 +37,9 @@ spec: | |
| - name: force-builder-image | ||
| description: force use the builder image to prepare container to build binaries. | ||
| default: "" | ||
| - name: publisher-auth-secret-name | ||
| description: Name of the Secret containing publisher basic auth credentials. | ||
| default: publisher-auth | ||
| - name: publisher-url | ||
| default: "https://publisher.pingcap.net" | ||
| - name: git-instead-of | ||
|
|
@@ -126,6 +129,9 @@ spec: | |
| # - name: cypress-cache | ||
| # persistentVolumeClaim: | ||
| # claimName: cypress-cache | ||
| - name: publisher-auth | ||
| secret: | ||
| secretName: $(tt.params.publisher-auth-secret-name) | ||
|
Comment on lines
+132
to
+134
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. |
||
| - apiVersion: tekton.dev/v1 | ||
| kind: PipelineRun | ||
| metadata: | ||
|
|
@@ -206,3 +212,6 @@ spec: | |
| # - name: cypress-cache | ||
| # persistentVolumeClaim: | ||
| # claimName: cypress-cache | ||
| - name: publisher-auth | ||
| secret: | ||
| secretName: $(tt.params.publisher-auth-secret-name) | ||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -40,6 +40,9 @@ spec: | |
| default: "" | ||
| - name: boskos-server-url | ||
| default: "http://boskos" | ||
| - name: publisher-auth-secret-name | ||
| description: Name of the Secret containing publisher basic auth credentials. | ||
| default: publisher-auth | ||
| - name: publisher-url | ||
| default: "https://publisher.pingcap.net" | ||
| - name: git-instead-of | ||
|
|
@@ -134,3 +137,6 @@ spec: | |
| - name: mac-ssh-credentials # for darwin platforms | ||
| secret: | ||
| secretName: mac-ssh-credentials | ||
| - name: publisher-auth | ||
| secret: | ||
| secretName: $(tt.params.publisher-auth-secret-name) | ||
|
Comment on lines
+140
to
+142
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. |
||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -38,6 +38,9 @@ spec: | |
| default: "{}" | ||
| - name: force-builder-image | ||
| default: "" | ||
| - name: publisher-auth-secret-name | ||
| description: Name of the Secret containing publisher basic auth credentials. | ||
| default: publisher-auth | ||
| - name: publisher-url | ||
| default: "https://publisher.pingcap.net" | ||
| resourcetemplates: | ||
|
|
@@ -108,3 +111,6 @@ spec: | |
| resources: | ||
| requests: | ||
| storage: $(tt.params.source-ws-size) | ||
| - name: publisher-auth | ||
| secret: | ||
| secretName: $(tt.params.publisher-auth-secret-name) | ||
|
Comment on lines
+114
to
+116
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. |
||
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Using a string variable to store optional command-line arguments like
-u '${user}:${pass}'is fragile. When expanded unquoted in thecurlcommand, the literal single quotes will be passed as part of the credentials tocurl, which will cause authentication to fail. Additionally, unquoted expansion ($auth_opt) will break if the username or password contains spaces. Using a bash array is the standard and safe way to handle optional arguments in scripts. Furthermore, use the hardcoded path/workspace/publisher-authinstead of the$(workspaces.publisher-auth.path)variable for consistency with repository standards.References