Skip to content
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

RHDEVDOCS-4233| Documented guidance on authentication strategies for pipelines #57140

Closed
wants to merge 1 commit into from

Conversation

gtrivedi88
Copy link
Contributor

@gtrivedi88 gtrivedi88 commented Mar 14, 2023

@openshift-ci openshift-ci bot added the size/L Denotes a PR that changes 100-499 lines, ignoring generated files. label Mar 14, 2023
@ocpdocs-previewbot
Copy link

ocpdocs-previewbot commented Mar 14, 2023

🤖 Updated build preview is available at:
https://57140--docspreview.netlify.app

Build log: https://circleci.com/gh/ocpdocs-previewbot/openshift-docs/13649

@gtrivedi88
Copy link
Contributor Author

@ppitonak @VeereshAradhya This PR is ready for QE review.
Thank you for your help!

Copy link

@ppitonak ppitonak left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

  1. I would reorder sections so that all related to git are following each other and section about docker is either first or last
  2. The doc talks about binding secret to workspace but it doesn't show how.


. Create a Task called `git-clone` that clones a git repository using SSH authentication.

. Define workspaces, describe the process to create a secret, and bind it to the workspace. For example:

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

  1. I don't understand this part describe the process to create a secret
  2. I split this point into two - one would only talk about how to create a secret, another one would talk about workspace declaration in task and binding.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Noted,
Resolved

+
[NOTE]
====
To create the above secret, run `$ kubectl create secret generic my-github-ssh-credentials \

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We usually use oc instead of kubectl

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

resolved


== git-clone Task

This approach involves creating a task called `git-clone`, which clones a git repository using SSH authentication. The following are the steps to use Secrets and Workspace in Tekton Pipelines:

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We already ship git-clone clustertask, can't we just show how it looks like and describe how to use secrets with it?

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Hello @vdemeester , can we use the already existing git-clone clustertask in this case?

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@ppitonak , according to tekton documentation, clustertasks are deprecated. As Red Hat, are we still shipping them downstream? (CC @mramendi )

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yes, we still ship them

--param url=git@github.com:<username>/buildkit-tekton \
--workspace name=output,emptyDir="" \
--workspace name=ssh-directory,secret=my-github-ssh-credentials \
--use-param-defaults --showlog`

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This command is rendered on a single line, in that case backslashes are not necessary

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Noted,
Addressed


Following are the steps involved in using a Docker configuration file inside a Tekton pipeline task.

. Define a Tekton Task in your Kubernetes cluster with a reference to Skopeo image that copies a docker image to a specified repository.

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Kubernetes cluster -> OpenShift cluster

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

addressed.

mountPath: /optional-workspace
----

.Example: A modified git clone task to incorporate the optional Workspace feature.

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Why do we have 2 examples here? 🤔

cp "$(workspaces.basic_auth.path)/.gitconfig" "${HOME}/.gitconfig"
chmod 400 "${HOME}/.git-credentials"
chmod 400 "${HOME}/.gitconfig"
fi

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is basically a code from our own task but I miss the context here.


* kubernetes.io/basic-auth : basic authentications

* kubernetes.io/dockercfg : serialized ~/.dockercfg file kubernetes.io/dockerconfigjson : serialized ~/.docker/config.json file

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

kubernetes.io/dockerconfigjson should be a new bullet point

----
# For a TaskRun

apiVersion: tekton.dev/v1beta1

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

update to v1

metadata:
name: build-with-basic-auth
spec:
serviceAccountName: build-bot

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@openshift-bot
Copy link

Issues go stale after 90d of inactivity.

Mark the issue as fresh by commenting /remove-lifecycle stale.
Stale issues rot after an additional 30d of inactivity and eventually close.
Exclude this issue from closing by commenting /lifecycle frozen.

If this issue is safe to close now please do so with /close.

/lifecycle stale

@openshift-ci openshift-ci bot added the lifecycle/stale Denotes an issue or PR has remained open with no activity and has become stale. label Sep 19, 2023
@masauso-lungu
Copy link
Contributor

/remove-lifecycle stale

@openshift-ci openshift-ci bot removed the lifecycle/stale Denotes an issue or PR has remained open with no activity and has become stale. label Oct 4, 2023
@openshift-merge-robot openshift-merge-robot added the needs-rebase Indicates a PR cannot be merged because it has merge conflicts with HEAD. label Oct 4, 2023
@openshift-merge-robot
Copy link

PR needs rebase.

Instructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the kubernetes/test-infra repository.

@masauso-lungu
Copy link
Contributor

masauso-lungu commented Oct 10, 2023

This PR is now being tracked with this PR-66069

@openshift-bot
Copy link

Issues go stale after 90d of inactivity.

Mark the issue as fresh by commenting /remove-lifecycle stale.
Stale issues rot after an additional 30d of inactivity and eventually close.
Exclude this issue from closing by commenting /lifecycle frozen.

If this issue is safe to close now please do so with /close.

/lifecycle stale

@openshift-ci openshift-ci bot added the lifecycle/stale Denotes an issue or PR has remained open with no activity and has become stale. label Jan 9, 2024
@openshift-bot
Copy link

Stale issues rot after 30d of inactivity.

Mark the issue as fresh by commenting /remove-lifecycle rotten.
Rotten issues close after an additional 30d of inactivity.
Exclude this issue from closing by commenting /lifecycle frozen.

If this issue is safe to close now please do so with /close.

/lifecycle rotten
/remove-lifecycle stale

@openshift-ci openshift-ci bot added lifecycle/rotten Denotes an issue or PR that has aged beyond stale and will be auto-closed. and removed lifecycle/stale Denotes an issue or PR has remained open with no activity and has become stale. labels Feb 8, 2024
@mramendi
Copy link
Contributor

mramendi commented Feb 8, 2024

/remove-lifecycle rotten

@openshift-ci openshift-ci bot removed the lifecycle/rotten Denotes an issue or PR that has aged beyond stale and will be auto-closed. label Feb 8, 2024
@mramendi
Copy link
Contributor

mramendi commented Feb 8, 2024

@gtrivedi88 I mistakenly removed the rotten lifecycle. Could you please close this PR? Teh up-to-date PR on this issue is #70384

@gtrivedi88 gtrivedi88 closed this Feb 9, 2024
@gtrivedi88
Copy link
Contributor Author

@mramendi As you suggested. I've closed this PR.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
needs-rebase Indicates a PR cannot be merged because it has merge conflicts with HEAD. size/L Denotes a PR that changes 100-499 lines, ignoring generated files.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

8 participants