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

Allow to configure git services in Che configuration #21577

Closed
Tracked by #20583 ...
l0rd opened this issue Jul 22, 2022 · 7 comments
Closed
Tracked by #20583 ...

Allow to configure git services in Che configuration #21577

l0rd opened this issue Jul 22, 2022 · 7 comments
Labels
area/che-operator Issues and PRs related to Eclipse Che Kubernetes Operator kind/enhancement A feature request - must adhere to the feature request template. new&noteworthy For new and/or noteworthy issues that deserve a blog post, new docs, or emphasis in release notes severity/P1 Has a major impact to usage or development of the system.
Milestone

Comments

@l0rd
Copy link
Contributor

l0rd commented Jul 22, 2022

Is your enhancement related to a problem? Please describe

We want to make it simpler for admin to configure Git services in Che (GitHub, Gitlab, BitBucket): it should not be necessary to look at Eclipse Che documentation.

This first issue is about the CheCluster CR update. There will be another issue dedicated to some new chectl parameters to configure git services.

Describe the solution you'd like

spec:
   components
   containerRegistry
+  gitServices:
+    github:
+      - secretName: github-oauth-config
+    gitlab:
+      - secretName: gitlab-oauth-config
+        endpoint: https://gitlab.com
+    bitbucket:
+      - secretName: bitbucket-oauth-config
+        endpoint: https://bitbucket.org
   devEnvironments
   networking

The oAuth App id/secret/private.key etc... should not be directly in the CR (no clear text passwords in the CR). The secret field of an oauthApp is the name of an existing Kubernetes Secret that includes the base64 encoded id and secret. That should be documented clearly in the CRD field to avoid that admins need to read Eclipse Che documentation.

Release Notes Text

Configuring Git services OAuth will be more straightforward for administrators as it's possible to reference Git servies secrets from CheCluster CRs. On OpenShift those new configuration will be available from the OpenShift Console UI.

@l0rd l0rd added the kind/enhancement A feature request - must adhere to the feature request template. label Jul 22, 2022
@che-bot che-bot added the status/need-triage An issue that needs to be prioritized by the curator responsible for the triage. See https://github. label Jul 22, 2022
@l0rd l0rd added severity/P1 Has a major impact to usage or development of the system. area/che-operator Issues and PRs related to Eclipse Che Kubernetes Operator and removed status/need-triage An issue that needs to be prioritized by the curator responsible for the triage. See https://github. labels Jul 22, 2022
@tolusha
Copy link
Contributor

tolusha commented Jul 24, 2022

We can implement Validating Webhook to check the CheCluster CR fields.
I propose the following structure:

spec:
  gitServices:
    disabled: <bool>
    github: <GitHub>
    gitlab: <Gitlab>

Where GitHub and Gitlab are dedicated structures.

I see the several problems:

  1. Having disabled=false by default means that it would not be possible to deploy Eclipse Che via chectl without providing --che-operator-cr-patch-yaml flag to set disalbed=true if user doesn't have any git integration.
  2. We have to be backward compatible and respect already existed git integration secrets on the cluster.
  3. Since we still support CheCluster API v1 (see Deprecate CheCluster API v1 #21579), we need to add the similar fields there.

@l0rd
Copy link
Contributor Author

l0rd commented Jul 24, 2022

Ok @tolusha let's do that (git services are not required by default) but then we don't need the disabled: <bool> field anymore.

@l0rd
Copy link
Contributor Author

l0rd commented Jul 25, 2022

With your proposal, if the admin wants to configure both gitlab.com and gitlab on prem can he do something like this:

spec:
  gitServices:
    gitlab:
      endpoint: gitlab.mycompany.com
      secret: gitlabinternal-oauth-config
    gitlab:
      endpoint: gitlab.com
      secret: gitlabdotcom-oauth-config

@tolusha
Copy link
Contributor

tolusha commented Jul 25, 2022

That won't be possible. I thought the only one configuration of gitlab service is possible on the cluster.

@tolusha
Copy link
Contributor

tolusha commented Jul 25, 2022

But anyway, we can move to arrays:

spec:
  gitServices:
    github: [<GitHub>]
    gitlab: [<Gitlab>]
    bitbucker: [<BitBucket>]

@l0rd
Copy link
Contributor Author

l0rd commented Jul 25, 2022

Ok. Yes we need to consider that use case as well so it's better to use lists.

@tolusha tolusha mentioned this issue Aug 6, 2022
67 tasks
@tolusha tolusha mentioned this issue Aug 25, 2022
82 tasks
@tolusha tolusha added this to the 7.54 milestone Sep 8, 2022
@tolusha tolusha closed this as completed Sep 8, 2022
@l0rd l0rd changed the title Add new fields in CheCluster CR to configure Git Services Allow to configure git services in Che configuration Sep 15, 2022
@l0rd l0rd added new&noteworthy For new and/or noteworthy issues that deserve a blog post, new docs, or emphasis in release notes status/release-notes-review-needed Issues that needs to be reviewed by the doc team for the Release Notes wording labels Sep 15, 2022
@max-cx max-cx removed the status/release-notes-review-needed Issues that needs to be reviewed by the doc team for the Release Notes wording label Jan 12, 2023
@devstudio-release
Copy link

sync'd to Red Hat JIRA https://issues.redhat.com/browse/CRW-3351

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
area/che-operator Issues and PRs related to Eclipse Che Kubernetes Operator kind/enhancement A feature request - must adhere to the feature request template. new&noteworthy For new and/or noteworthy issues that deserve a blog post, new docs, or emphasis in release notes severity/P1 Has a major impact to usage or development of the system.
Projects
None yet
Development

No branches or pull requests

5 participants