che-server icon indicating copy to clipboard operation
che-server copied to clipboard

[DO NOT MERGE] feat: Removing dependency on usr, accout, profile db entries

Open ibuziuk opened this issue 2 years ago • 0 comments

NOTE: PR should be merged only once operands like dashboard do not fall back on retrieving any information from db e.g. workspace API dependency https://github.com/eclipse/che/issues/21846

What does this PR do?

  • Removing dependency on usr, accout, profile db entries. Data is not persisted once user first time access Eclipse Che meaning that after the update db is no longer used as the source of valid data
  • Update the way 'profile-secret' is generated (no data for the secret is obtained from the db anymore) NOTE that the secret still contains a dummy email postfixed with @che which is done for backward compatibility with UD that still reads 3 properties from the secret (id / name / email)
  • Removes 'user-preferences' secret that is not relevant in the context of DevWorskpaces anymore

image

kind: Secret
apiVersion: v1
metadata:
  name: user-preferences
  namespace: ibuziuk-dev
  uid: ca6af2f3-ed72-45b9-ade0-c8162f506d2d
  resourceVersion: '1987202263'
  creationTimestamp: '2022-12-06T09:43:59Z'
  labels:
    controller.devfile.io/mount-to-devworkspace: 'true'
  annotations:
    controller.devfile.io/mount-as: file
    controller.devfile.io/mount-path: /config/user/preferences
  managedFields:
    - manager: okhttp
      operation: Update
      apiVersion: v1
      time: '2022-12-06T09:43:59Z'
      fieldsType: FieldsV1
      fieldsV1:
        'f:data':
          .: {}
          'f:codenvy-created': {}
          'f:infrastructureNamespace': {}
          'f:infrastructureNamespaceTemplate': {}
          'f:temporary': {}
        'f:metadata':
          'f:annotations':
            .: {}
            'f:controller.devfile.io/mount-as': {}
            'f:controller.devfile.io/mount-path': {}
          'f:labels':
            .: {}
            'f:controller.devfile.io/mount-to-devworkspace': {}
        'f:type': {}
data:
  codenvy-created: MTY3MDMxOTgzOTQ0Ng==
  infrastructureNamespace: aWJ1eml1ay1kZXY=
  infrastructureNamespaceTemplate: PHVzZXJuYW1lPi1kZXY=
  temporary: ZmFsc2U=
type: Opaque

Issue Refernce

Part of https://github.com/eclipse/che/issues/21374

How to test this PR?

Image - quay.io/ibuziuk/che-server:pr-398

  1. Deploy vanilla Eclipse Che or Dev Spaces on a cluster (RHPDS small 4.10 cluster with 5 pre-created users is recommended)
  2. Log in as regular user (user1 on RHPDS) and start a few workspaces
  3. Update CR to reference the che-server image from PR
spec:
  components:
    cheServer:
      debug: true
      deployment:
        containers:
          - image: 'quay.io/ibuziuk/che-server:pr-398'
            name: che
  1. Log in as a new user (user2 on RHPDS) and start a few workspaces
  2. Logout and log in again as user1 - check that old and new workspaces are started correctly
  3. Check the database, only entries for the first user (user1 on RHPDS) persisted, and no entries for the second user (user2 on RHPDS)

PR Checklist

As the author of this Pull Request I made sure that:

Reviewers

Reviewers, please comment how you tested the PR when approving it.

ibuziuk avatar Dec 06 '22 10:12 ibuziuk