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

chore: Update devfile/api dependency to upstream commit a6c32fc #1184

Closed

Conversation

AObuchow
Copy link
Collaborator

@AObuchow AObuchow commented Oct 5, 2023

What does this PR do?

Updates the devfile/api dependency to the upstream commit devfile/api@a6c32fc. This is required for #1179, as the devfile validation library was previously preventing a deworkspace from having a container component and openshift/kubernetes component from using the same target port on an endpoint.

devfile/api@a6c32fc was chosen as it is the same commit used by the devfile library, and all commits past a6c32fc were non-function-changing commits: devfile/api@a6c32fc...e05a235

I also added a controller env test to test the case from #1179, but this might be redundant as this functionality should already be tested in the devfile API repo.

What issues does this PR fix or reference?

#1179

Is it tested? How?

Install DWO with the changes from this PR, and create a devworkspace with a container component and kubernetes (or openshift) component that uses the same endpoint target port, such as the following:

kind: DevWorkspace
apiVersion: workspace.devfile.io/v1alpha2
metadata:
  name: plain-devworkspace
spec:
  started: true
  routingClass: 'basic'
  template:
    components:
      - name: kubernetes-deploy
        kubernetes:
          deployByDefault: true
          endpoints:
            - name: http-8080
              path: /
              targetPort: 8080
          inlined: |
            apiVersion: v1
            kind: Pod
            metadata:
              name: webserver-dwo-deployed
              namespace: devworkspace-controller
            spec:
              containers:
                - name: webserver
                  image: nginx:latest
                  ports:
                    - containerPort: 8080
      - name: web-terminal
        container:
          image: quay.io/wto/web-terminal-tooling:next
          memoryRequest: 256Mi
          memoryLimit: 512Mi
          mountSources: true
          command:
           - "tail"
           - "-f"
           - "/dev/null"
          endpoints:
            - name: 'http'
              protocol: http
              targetPort: 8080
              exposure: public

Ensure the workspace starts up as expected. You should see a pod get deployed to the devworkspace-controller namespace called webserver-dwo-deployed. The main thing to ensure is the workspace does not fail to startup with the following reason: * devfile contains multiple containers with same endpoint targetPort: 8080

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: Andrew Obuchowicz [email protected]

@AObuchow AObuchow requested review from amisevsk and l0rd as code owners October 5, 2023 19:17
…er and kubernetes component

Signed-off-by: Andrew Obuchowicz <[email protected]>
@AObuchow AObuchow force-pushed the update-devfile-api-v2.2.1-alpha branch from 42d718c to 1871cc1 Compare October 5, 2023 20:01
Copy link
Collaborator

@amisevsk amisevsk left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I don't love depending on a non-released version of devfile API, but it seems we have no choice until v2.2.1 is released.

controllers/workspace/suite_test.go Show resolved Hide resolved
@openshift-ci
Copy link

openshift-ci bot commented Oct 6, 2023

[APPROVALNOTIFIER] This PR is APPROVED

This pull-request has been approved by: amisevsk, AObuchow

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

The pull request process is described here

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

@openshift-ci openshift-ci bot added the approved label Oct 6, 2023
@AObuchow
Copy link
Collaborator Author

AObuchow commented Oct 6, 2023

I don't love depending on a non-released version of devfile API, but it seems we have no choice until v2.2.1 is released.

@amisevsk agreed. We could delay merging this if 2.2.1 is expected to be released soon enough.

@AObuchow
Copy link
Collaborator Author

/retest

@amisevsk
Copy link
Collaborator

Devfile v2.2.1 is now released: https://github.com/devfile/api/releases/tag/v2.2.1

Just took some asking questions :)

@codecov
Copy link

codecov bot commented Oct 11, 2023

Codecov Report

All modified lines are covered by tests ✅

Comparison is base (58ada48) 52.66% compared to head (1871cc1) 52.79%.
Report is 7 commits behind head on main.

Additional details and impacted files
@@            Coverage Diff             @@
##             main    #1184      +/-   ##
==========================================
+ Coverage   52.66%   52.79%   +0.13%     
==========================================
  Files          82       82              
  Lines        7497     7495       -2     
==========================================
+ Hits         3948     3957       +9     
+ Misses       3268     3259       -9     
+ Partials      281      279       -2     

see 4 files with indirect coverage changes

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

@AObuchow
Copy link
Collaborator Author

@amisevsk awesome 🥳 I will rework this PR to update to the latest release

@AObuchow
Copy link
Collaborator Author

Closing in favour of #1186

@AObuchow AObuchow closed this Oct 11, 2023
Sign up for free to 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.

2 participants