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

[WIP] Add generic git task - with alternative auth #309

Closed
wants to merge 1 commit into from

Conversation

jlpettersson
Copy link
Member

@jlpettersson jlpettersson commented May 10, 2020

Changes

The existing git-clone task is very opinionated and custom. This task use a generic git image. The plan is to add tasks for git-add, git-commit and git-push as well.

This commit also shows an alternative way to setup authentication. This authentication is independent of Tekton Pipeline Auth documentation and does not use annotations on Secrets and no need for custom credential initialization process and does not copy or move any sensitive values, but mount them using a projected volume.

Related to tektoncd/pipeline#2343

/kind feature

Submitter Checklist

These are the criteria that every PR should meet, please check them off as you
review them:

See the contribution guide
for more details.

@tekton-robot tekton-robot added do-not-merge/work-in-progress Indicates that a PR should not merge because it is a work in progress. kind/feature Categorizes issue or PR as related to a new feature. labels May 10, 2020
@tekton-robot tekton-robot requested review from bobcatfish and a user May 10, 2020 16:33
@tekton-robot
Copy link

[APPROVALNOTIFIER] This PR is NOT APPROVED

This pull-request has been approved by:
To complete the pull request process, please assign dlorenc
You can assign the PR to them by writing /assign @dlorenc in a comment when ready.

The full list of commands accepted by this bot can be found here.

Needs approval from an approver in each of these files:

Approvers can indicate their approval by writing /approve in a comment
Approvers can cancel approval by writing /approve cancel in a comment

@tekton-robot
Copy link

Hi @jlpettersson. Thanks for your PR.

I'm waiting for a tektoncd member to verify that this patch is reasonable to test. If it is, they should reply with /ok-to-test on its own line. Until that is done, I will not automatically test new commits in this PR, but the usual testing commands by org members will still work. Regular contributors should join the org to skip this step.

Once the patch is verified, the new status will be reflected by the ok-to-test label.

I understand the commands that are listed here.

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.

@tekton-robot tekton-robot added needs-ok-to-test Indicates a PR that requires an org member to verify it is safe to test. size/M Denotes a PR that changes 30-99 lines, ignoring generated files. labels May 10, 2020
@jlpettersson jlpettersson marked this pull request as draft May 10, 2020 18:14
- secret:
name: github-known-hosts
- secret:
name: github-private-key
Copy link
Member Author

@jlpettersson jlpettersson May 10, 2020

Choose a reason for hiding this comment

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

both secret names should be params in a proper implementation.

  params:
  - name: known-hosts-secret
    type: string
    description: secret name of the SSH known_hosts file
  - name: private-key-secret
    type: string
    description: secret name of the SSH private key file

and in use

    projected:
      defaultMode: 0400
      sources:
      - secret:
          name: $(params.known-hosts-secret) 
      - secret:
          name: $(params.private-key-secret)

Copy link

Choose a reason for hiding this comment

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

Is this a limitation of Tekton at the moment - params can't be used as variables in volumes?

Copy link
Member Author

Choose a reason for hiding this comment

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

Yes, it is the Secret Name within a projected volume, were we don't have implemented variable substitution. But as the commit is implemented now, it is working. But for proper support, we should add variable substitution here, so that end-users can name the secrets how they want.

The existing git-clone task is very opinionated and custom. This task use a generic _git image_. The plan is to add tasks for `git-add`, `git-commit` and `git-push` as well.

This commit also shows an alternative way to setup authentication. This authentication is independent of [Tekton Pipeline Auth documentation](https://github.com/tektoncd/pipeline/blob/master/docs/auth.md) and does not use _annotations on Secrets_ and no need for custom _credential initialization process_ and does not copy or move any sensitive values, but mount them using a projected volume.

/kind feature
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
do-not-merge/work-in-progress Indicates that a PR should not merge because it is a work in progress. kind/feature Categorizes issue or PR as related to a new feature. needs-ok-to-test Indicates a PR that requires an org member to verify it is safe to test. size/M Denotes a PR that changes 30-99 lines, ignoring generated files.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants