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

Fix pod-overrides for container level #162

Merged
merged 1 commit into from
Feb 14, 2023

Conversation

valaparthvi
Copy link
Contributor

Signed-off-by: Parthvi Vala pvala@redhat.com

What does this PR do?:

This PR fixes a faulty behavior when pod-overrides is defined at container level.

Which issue(s) this PR fixes:

PR acceptance criteria:

Testing and documentation do not need to be complete in order for this PR to be approved. We just need to ensure tracking issues are opened.

  • Open new test/doc issues under the devfile/api repo
  • Check each criteria if:
  • There is a separate tracking issue. Add the issue link under the criteria
    or
  • test/doc updates are made as part of this PR
  • If unchecked, explain why it's not needed

How to test changes / Special notes to the reviewer:

1. Use the following Devfile:
commands:
  - exec:
      commandLine: npm install
      component: runtime
      group:
        isDefault: true
        kind: build
      workingDir: ${PROJECT_SOURCE}
    id: install
  - exec:
      commandLine: npm start
      component: runtime
      group:
        isDefault: true
        kind: run
      workingDir: ${PROJECT_SOURCE}
    id: run
  - exec:
      commandLine: npm run debug
      component: runtime
      group:
        isDefault: true
        kind: debug
      workingDir: ${PROJECT_SOURCE}
    id: debug
  - exec:
      commandLine: npm test
      component: runtime
      group:
        isDefault: true
        kind: test
      workingDir: ${PROJECT_SOURCE}
    id: test
components:
  - container:
      args:
        - tail
        - -f
        - /dev/null
      endpoints:
        - name: http-node
          targetPort: 3000
        - exposure: none
          name: debug
          targetPort: 5858
      env:
        - name: DEBUG_PORT
          value: "5858"
      image: registry.access.redhat.com/ubi8/nodejs-16:latest
      memoryLimit: 1024Mi
      mountSources: true
    attributes:
      pod-overrides:
        spec:
          serviceAccountName: new-service-account
    name: runtime
  - kubernetes:
      inlined: |
        apiVersion: v1
        kind: ServiceAccount
        metadata:
          name: new-service-account
    name: service-account
metadata:
  description: Stack with Node.js 16
  displayName: Node.js Runtime
  icon: https://nodejs.org/static/images/logos/nodejs-new-pantone-black.svg
  language: JavaScript
  name: my-node-app
  projectType: Node.js
  tags:
    - Node.js
    - Express
    - ubi8
  version: 2.1.1
schemaVersion: 2.2.0
starterProjects:
  - git:
      remotes:
        origin: https://github.com/odo-devfiles/nodejs-ex.git
    name: nodejs-starter
  1. odo dev
  2. kubectl get po my-node-app-xxx -ojsonpath='{.spec.serviceAccountName}'; it should be new-service-account.

@openshift-ci
Copy link

openshift-ci bot commented Feb 13, 2023

[APPROVALNOTIFIER] This PR is APPROVED

This pull-request has been approved by: kim-tsao, valaparthvi

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

Signed-off-by: Parthvi Vala <pvala@redhat.com>
@openshift-ci
Copy link

openshift-ci bot commented Feb 14, 2023

New changes are detected. LGTM label has been removed.

@valaparthvi
Copy link
Contributor Author

@kim-tsao I had to rebase my branch onto main to fix the Build action for the PR. Can you re-lgtm?

@codecov
Copy link

codecov bot commented Feb 14, 2023

Codecov Report

Base: 59.55% // Head: 59.67% // Increases project coverage by +0.11% 🎉

Coverage data is based on head (0e18623) compared to base (0d04f79).
Patch coverage: 100.00% of modified lines in pull request are covered.

Additional details and impacted files
@@            Coverage Diff             @@
##             main     #162      +/-   ##
==========================================
+ Coverage   59.55%   59.67%   +0.11%     
==========================================
  Files          36       36              
  Lines        4226     4226              
==========================================
+ Hits         2517     2522       +5     
+ Misses       1562     1557       -5     
  Partials      147      147              
Impacted Files Coverage Δ
pkg/devfile/generator/utils.go 90.62% <100.00%> (+0.82%) ⬆️

Help us with your feedback. Take ten seconds to tell us how you rate us. Have a feature suggestion? Share it here.

☔ View full report at Codecov.
📢 Do you have feedback about the report comment? Let us know in this issue.

@kim-tsao kim-tsao merged commit 4f0ff68 into devfile:main Feb 14, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
2 participants