eclipse-che / che

Kubernetes based Cloud Development Environments for Enterprise Teams
http://eclipse.org/che
Eclipse Public License 2.0
6.93k stars 1.19k forks source link

Allow an admin to specify default commands and default events in CheCluster CR #22580

Open l0rd opened 9 months ago

l0rd commented 9 months ago

Is your enhancement related to a problem? Please describe

Today it's possible to specify ..defaultComponents in CheCluster CR but not default commands, events or parent. It's not possible for instance adding a default preStart event.

Describe the solution you'd like

The CheCluster devEnvironment should support these new properties:

spec:
  devEnvironments:
+    defaultCommands:
+        ...
    defaultComponents:
      ...
+    defaultEvents:
+      ...
+    defaultParent:
+      ...

Describe alternatives you've considered

No response

Additional context

https://github.com/devfile/developer-images/pull/115#issuecomment-1747245613

AObuchow commented 9 months ago

I don't think this will be used to resolve this issue, but I figured it's worth mentioning: The DevWorkspaceOperatorConfig supports a default devworkspace template spec, that allows configuring components, commands, events, etc.

The problem with leveraging this DWOC field is that it operates at the DevWorkspace level rather than devfile level - no default devfile would be created if this was used. Additionally, there's already existing code in Che-Operator and the UD for the default components field in the Che Cluster CR.

l0rd commented 9 months ago

no default devfile would be created if this was used

Well no devfile is created anyway. When there is no devfile in a git repository the dashboard generates a DW and doesn't expose a devfile to the user. Your suggestion should be a good workaround. But DWOC is kind of non-documented feature.

che-bot commented 3 months ago

Issues go stale after 180 days of inactivity. lifecycle/stale issues rot after an additional 7 days of inactivity and eventually close.

Mark the issue as fresh with /remove-lifecycle stale in a new comment.

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

Moderators: Add lifecycle/frozen label to avoid stale mode.