Skip to content

[feat] Provision user and email credentials to gitconfig - #708

Closed
JPinkney wants to merge 7 commits into
mainfrom
provision-user-and-email
Closed

[feat] Provision user and email credentials to gitconfig#708
JPinkney wants to merge 7 commits into
mainfrom
provision-user-and-email

Conversation

@JPinkney

@JPinkneyJPinkney commented Dec 10, 2021

Copy link
Copy Markdown
Contributor

Signed-off-by: Josh Pinkney joshpinkney@gmail.com

What does this PR do?

This PR automatically provisions user and email credentials to the gitconfig whenever the label: controller.devfile.io/git-user-credential is true.

If you want to provision git credentials to your gitconfig you can use:

apiVersion: v1
kind: ConfigMap
metadata:
name: sample-user-credentials
namespace: devworkspace-controller
labels:
controller.devfile.io/git-user-credential: "true"
controller.devfile.io/watch-configmap: "true"
data:
name: sampleName
email: sampleName@sampleName.com

What issues does this PR fix or reference?

#694

Is it tested? How?

Tested manually using the above configmap, but also added unit tests

PR Checklist

  • E2E tests pass (when PR is ready, comment /test v8-devworkspace-operator-e2e, v8-che-happy-path to trigger)
    • v8-devworkspace-operator-e2e: DevWorkspace e2e test
    • v8-che-happy-path: Happy path for verification integration with Che

Signed-off-by: Josh Pinkney <joshpinkney@gmail.com>
@openshift-ci

Copy link
Copy Markdown

Skipping CI for Draft Pull Request.
If you want CI signal for your change, please convert it to an actual PR.
You can still manually trigger a test run with /test all

@openshift-ci

Copy link
Copy Markdown

[APPROVALNOTIFIER] This PR is APPROVED

This pull-request has been approved by: JPinkney

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

The pull request process is described here

Details 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

Signed-off-by: Josh Pinkney <joshpinkney@gmail.com>
Signed-off-by: Josh Pinkney <joshpinkney@gmail.com>
Signed-off-by: Josh Pinkney <joshpinkney@gmail.com>
@JPinkney
JPinkneyforce-pushed the provision-user-and-email branch from 939da04 to 1644718CompareDecember 13, 2021 14:47
Signed-off-by: Josh Pinkney <joshpinkney@gmail.com>
@JPinkney
JPinkney marked this pull request as ready for review December 13, 2021 14:49
@JPinkneyJPinkney changed the title Provision user and email credentials to gitconfig[feat] Provision user and email credentials to gitconfigDec 13, 2021
Signed-off-by: Josh Pinkney <joshpinkney@gmail.com>
Signed-off-by: Josh Pinkney <joshpinkney@gmail.com>
@JPinkney

Copy link
Copy Markdown
ContributorAuthor

/test v8-devworkspace-operator-e2e

@l0rdl0rd mentioned this pull request Dec 13, 2021
5 tasks
@l0rd

l0rd commented Dec 13, 2021

Copy link
Copy Markdown
Collaborator

This is good as first implementation. But rather than a specialized ConfigMap for git config username and email we may want to support a new annotation controller.devfile.io/sub-path for generic ConfigMaps labelled with controller.devfile.io/mount-to-devworkspace: "true".

That would allow to mount a complete gitconfig (not only user name and email) and to mount any file in an existing folder:. For example:

kind: ConfigMapapiVersion: v1metadata:
name: git-config-cmannotations:
controller.devfile.io/mount-path: /etc/gitconfigcontroller.devfile.io/sub-path: gitconfiglabels:
controller.devfile.io/mount-to-devworkspace: "true"data:
gitconfig: | [user] email = jojo@gmail.com name = Jojo [core] editor = vim [alias] ...

@amisevsk

Copy link
Copy Markdown
Collaborator

But rather than a specialized ConfigMap for git config username and email we may want to support a new annotation controller.devfile.io/sub-path for generic ConfigMaps labelled with controller.devfile.io/mount-to-devworkspace: "true".

I beat you to the punch by about an hour :D #710

@l0rd

l0rd commented Dec 14, 2021

Copy link
Copy Markdown
Collaborator

I beat you to the punch by about an hour :D #710

I saw that earlier today! I was probably still thinking at the right way to inject a gitconfig when you submitted that PR. And you addressed the problem in a simpler way too. That's magic 🧙 🪄 Unfortunately I noticed it too late and I've lost one hour yesterday 😄

@openshift-ci

Copy link
Copy Markdown

@JPinkney: PR needs rebase.

Details

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.

@ibuziuk

Copy link
Copy Markdown
Contributor

@amisevsk I believe we can close this one, right?

@amisevsk

Copy link
Copy Markdown
Collaborator

I think so, I'll leave the branch in place in case it's needed later as this was initially requested by the Che server IIRC.

Sign up for freeto join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants

@JPinkney@l0rd@amisevsk@ibuziuk