apiVersion: workspace.devfile.io/v1alpha2
kind: DevWorkspace
metadata:
  annotations:
    che.eclipse.org/che-editor: eclipse/che-theia/latest
    che.eclipse.org/devfile-source: |
      factory:
        params: >-
          devWorkspace=https://devspaces.apps.ocp410-dnochev.crw-qe.com/devfile-registry/devfiles/00_java11-maven-microprofile-xp3/devworkspace-che-theia-latest.yaml&storageType=per-user&url=https://github.com/devspaces-samples/microprofile-quickstart/tree/devspaces-3.2-rhel-8
    che.eclipse.org/last-updated-timestamp: '2022-12-13T18:03:40.352Z'
  resourceVersion: '57222060'
  name: microprofile-quickstart
  uid: 083a7f87-6e78-4c0e-831d-f28d504f9dde
  creationTimestamp: '2022-12-12T22:47:53Z'
  generation: 8
  managedFields:
    - apiVersion: workspace.devfile.io/v1alpha2
      fieldsType: FieldsV1
      fieldsV1:
        'f:metadata':
          'f:annotations':
            .: {}
            'f:che.eclipse.org/che-editor': {}
            'f:che.eclipse.org/devfile-source': {}
            'f:che.eclipse.org/last-updated-timestamp': {}
        'f:spec':
          .: {}
          'f:routingClass': {}
          'f:template':
            .: {}
            'f:attributes':
              .: {}
              'f:controller.devfile.io/devworkspace-config':
                .: {}
                'f:name': {}
                'f:namespace': {}
              'f:controller.devfile.io/storage-type': {}
            'f:commands': {}
            'f:components': {}
            'f:projects': {}
      manager: unknown
      operation: Update
      time: '2022-12-13T18:03:24Z'
    - apiVersion: workspace.devfile.io/v1alpha2
      fieldsType: FieldsV1
      fieldsV1:
        'f:status':
          'f:conditions': {}
          'f:phase': {}
      manager: devworkspace-controller
      operation: Update
      time: '2022-12-13T18:03:25Z'
  namespace: admin-devspaces
  finalizers:
    - storage.controller.devfile.io
  labels:
    controller.devfile.io/creator: fb1f58a2-529f-4964-83b8-2d66430e5cd0
spec:
  routingClass: che
  started: false
  template:
    attributes:
      controller.devfile.io/devworkspace-config:
        name: devworkspace-config
        namespace: openshift-devspaces
      controller.devfile.io/storage-type: per-user
    commands:
      - exec:
          commandLine: mvn clean install
          component: tools
          group:
            kind: build
          workingDir: >-
            ${PROJECTS_ROOT}/microprofile-quickstart/microprofile-fault-tolerance
        id: 1-build
      - exec:
          commandLine: >-
            mvn package wildfly:deploy && echo 'The application was deployed,
            click on the endpoint from Workspace view to test it'
          component: eap-xp
          group:
            kind: run
          workingDir: >-
            ${PROJECTS_ROOT}/microprofile-quickstart/microprofile-fault-tolerance
        id: 2-deploy
      - exec:
          commandLine: >-
            mvn clean install && sleep 2 && cp target/*.war
            /opt/eap/standalone/deployments/ROOT.war
          component: eap-xp
          group:
            kind: run
          workingDir: >-
            ${PROJECTS_ROOT}/microprofile-quickstart/microprofile-fault-tolerance
        id: 3-update-existing-deployment
    components:
      - attributes:
          app.kubernetes.io/name: tools
          che-theia.eclipse.org/vscode-extensions:
            - >-
              relative:extension/resources/github_com/redhat-developer/devspaces-vscode-extensions/releases/download/7_44-che-assets/java-0.82.0-369.vsix
            - >-
              relative:extension/resources/github_com/redhat-developer/devspaces-vscode-extensions/releases/download/7_44-che-assets/vscode-java-debug-0.26.0.vsix
            - >-
              relative:extension/resources/open-vsx_org/api/vscjava/vscode-java-test/0_28_1/file/vscjava.vscode-java-test-0.28.1.vsix
            - >-
              relative:extension/resources/github_com/fabric8-analytics/fabric8-analytics-vscode-extension/releases/download/0_3_6/fabric8-analytics-0.3.6.vsix
          che-theia.eclipse.org/vscode-preferences:
            java.server.launchMode: Standard
        container:
          args:
            - sh
            - '-c'
            - '${PLUGIN_REMOTE_ENDPOINT_EXECUTABLE}'
          env:
            - name: PLUGIN_REMOTE_ENDPOINT_EXECUTABLE
              value: /remote-endpoint/plugin-remote-endpoint
            - name: THEIA_PLUGINS
              value: 'local-dir:///plugins/sidecars/tools'
            - name: CHE_DASHBOARD_URL
              value: 'https://devspaces.apps.ocp410-dnochev.crw-qe.com'
            - name: CHE_PLUGIN_REGISTRY_URL
              value: >-
                https://devspaces.apps.ocp410-dnochev.crw-qe.com/plugin-registry/v3
            - name: CHE_PLUGIN_REGISTRY_INTERNAL_URL
              value: 'http://plugin-registry.openshift-devspaces.svc:8080/v3'
          image: >-
            registry.redhat.io/devspaces/udi-rhel8@sha256:b6d9371d7178cd9215afb61cd14861701735019b4699448be0bbfdd1f7e8115b
          memoryLimit: 3Gi
          sourceMapping: /projects
          volumeMounts:
            - name: m2
              path: /home/user/.m2
            - name: remote-endpoint
              path: /remote-endpoint
            - name: plugins
              path: /plugins
        name: tools
      - container:
          endpoints:
            - exposure: public
              name: coffee
              path: /microprofile-fault-tolerance/coffee
              protocol: http
              targetPort: 8080
            - exposure: public
              name: coffee-availability
              path: /microprofile-fault-tolerance/coffee/2/availability
              protocol: http
              targetPort: 8080
          env:
            - name: JAVA_OPTS_APPEND
              value: >-
                -Xrunjdwp:transport=dt_socket,address=8000,server=y,suspend=n
                -Dsun.util.logging.disableCallerCheck=true
            - name: CHE_DASHBOARD_URL
              value: 'https://devspaces.apps.ocp410-dnochev.crw-qe.com'
            - name: CHE_PLUGIN_REGISTRY_URL
              value: >-
                https://devspaces.apps.ocp410-dnochev.crw-qe.com/plugin-registry/v3
            - name: CHE_PLUGIN_REGISTRY_INTERNAL_URL
              value: 'http://plugin-registry.openshift-devspaces.svc:8080/v3'
          image: >-
            registry.redhat.io/jboss-eap-7/eap-xp3-openjdk11-openshift-rhel8@sha256:ede8f51e311a129c877a227841ececd63a1b0c4d04fb4ec01f9e81d491737287
          memoryLimit: 1Gi
          sourceMapping: /projects
          volumeMounts:
            - name: m2
              path: /home/jboss/.m2
        name: eap-xp
      - name: m2
        volume:
          size: 1G
      - name: theia-microprofile-quickstart
        plugin:
          kubernetes:
            name: theia-microprofile-quickstart
    projects:
      - name: microprofile-quickstart
        zip:
          location: >-
            http://devfile-registry.openshift-devspaces.svc:8080/resources/v2/microprofile-quickstart.zip
status:
  conditions:
    - lastTransitionTime: '2022-12-13T18:03:25Z'
      message: >-
        Detected unrecoverable deployment condition: FailedCreate pods
        "workspace083a7f876e784c0e-9dbdcf9bd-" is forbidden: unable to validate
        against any security context constraint: [provider "anyuid": Forbidden:
        not usable by user or serviceaccount, provider restricted:
        .spec.securityContext.fsGroup: Invalid value: []int64{1234}: 1234 is not
        an allowed group, spec.initContainers[0].securityContext.runAsUser:
        Invalid value: 1234: must be in the ranges: [1000680000, 1000689999],
        spec.initContainers[1].securityContext.runAsUser: Invalid value: 1234:
        must be in the ranges: [1000680000, 1000689999],
        spec.containers[0].securityContext.runAsUser: Invalid value: 1234: must
        be in the ranges: [1000680000, 1000689999],
        spec.containers[1].securityContext.runAsUser: Invalid value: 1234: must
        be in the ranges: [1000680000, 1000689999],
        spec.containers[2].securityContext.runAsUser: Invalid value: 1234: must
        be in the ranges: [1000680000, 1000689999],
        spec.containers[3].securityContext.runAsUser: Invalid value: 1234: must
        be in the ranges: [1000680000, 1000689999],
        spec.containers[4].securityContext.runAsUser: Invalid value: 1234: must
        be in the ranges: [1000680000, 1000689999], provider "nonroot":
        Forbidden: not usable by user or serviceaccount, provider
        "hostmount-anyuid": Forbidden: not usable by user or serviceaccount,
        provider "machine-api-termination-handler": Forbidden: not usable by
        user or serviceaccount, provider "hostnetwork": Forbidden: not usable by
        user or serviceaccount, provider "hostaccess": Forbidden: not usable by
        user or serviceaccount, provider "node-exporter": Forbidden: not usable
        by user or serviceaccount, provider "privileged": Forbidden: not usable
        by user or serviceaccount]
      reason: Unknown
      status: 'True'
      type: FailedStart
    - lastTransitionTime: '2022-12-13T18:03:25Z'
      message: Workspace stopped due to error
      status: 'False'
      type: Started
    - lastTransitionTime: '2022-12-13T18:03:25Z'
      status: Unknown
      type: DevWorkspaceResolved
    - lastTransitionTime: '2022-12-13T18:03:25Z'
      status: Unknown
      type: StorageReady
    - lastTransitionTime: '2022-12-13T18:03:25Z'
      status: Unknown
      type: RoutingReady
    - lastTransitionTime: '2022-12-13T18:03:25Z'
      status: Unknown
      type: ServiceAccountReady
    - lastTransitionTime: '2022-12-13T18:03:25Z'
      status: Unknown
      type: PullSecretsReady
    - lastTransitionTime: '2022-12-13T18:03:25Z'
      status: Unknown
      type: DeploymentReady
  devworkspaceId: workspace083a7f876e784c0e
  mainUrl: >-
    https://devspaces.apps.ocp410-dnochev.crw-qe.com/workspace083a7f876e784c0e/theia-ide/3100/
  message: >-
    Detected unrecoverable deployment condition: FailedCreate pods
    "workspace083a7f876e784c0e-9dbdcf9bd-" is forbidden: unable to validate
    against any security context constraint: [provider "anyuid": Forbidden: not
    usable by user or serviceaccount, provider restricted:
    .spec.securityContext.fsGroup: Invalid value: []int64{1234}: 1234 is not an
    allowed group, spec.initContainers[0].securityContext.runAsUser: Invalid
    value: 1234: must be in the ranges: [1000680000, 1000689999],
    spec.initContainers[1].securityContext.runAsUser: Invalid value: 1234: must
    be in the ranges: [1000680000, 1000689999],
    spec.containers[0].securityContext.runAsUser: Invalid value: 1234: must be
    in the ranges: [1000680000, 1000689999],
    spec.containers[1].securityContext.runAsUser: Invalid value: 1234: must be
    in the ranges: [1000680000, 1000689999],
    spec.containers[2].securityContext.runAsUser: Invalid value: 1234: must be
    in the ranges: [1000680000, 1000689999],
    spec.containers[3].securityContext.runAsUser: Invalid value: 1234: must be
    in the ranges: [1000680000, 1000689999],
    spec.containers[4].securityContext.runAsUser: Invalid value: 1234: must be
    in the ranges: [1000680000, 1000689999], provider "nonroot": Forbidden: not
    usable by user or serviceaccount, provider "hostmount-anyuid": Forbidden:
    not usable by user or serviceaccount, provider
    "machine-api-termination-handler": Forbidden: not usable by user or
    serviceaccount, provider "hostnetwork": Forbidden: not usable by user or
    serviceaccount, provider "hostaccess": Forbidden: not usable by user or
    serviceaccount, provider "node-exporter": Forbidden: not usable by user or
    serviceaccount, provider "privileged": Forbidden: not usable by user or
    serviceaccount]
  phase: Failed
