odo icon indicating copy to clipboard operation
odo copied to clipboard

Adds support for exec command for odo deploy

Open dharmit opened this issue 3 years ago • 10 comments

Signed-off-by: Dharmit Shah [email protected]

What type of PR is this: /kind feature

What does this PR do / why we need it:

Which issue(s) this PR fixes: Fixes #5701

PR acceptance criteria:

  • [ ] Unit test

  • [ ] Integration test

  • [ ] Documentation

How to test changes / Special notes to the reviewer:

dharmit avatar Aug 23 '22 14:08 dharmit

Deploy Preview for odo-docusaurus-preview ready!

Name Link
Latest commit 8db5459544fd6c1ce8d9f502bca90e44e8b587b0
Latest deploy log https://app.netlify.com/sites/odo-docusaurus-preview/deploys/63246000a0e6b00009e4b1cc
Deploy Preview https://deploy-preview-6047--odo-docusaurus-preview.netlify.app
Preview on mobile
Toggle QR Code...

QR Code

Use your smartphone camera to open QR code link.

To edit notification comments on pull requests, go to your Netlify site settings.

netlify[bot] avatar Aug 23 '22 14:08 netlify[bot]

[APPROVALNOTIFIER] This PR is NOT APPROVED

This pull-request has been approved by: Once this PR has been reviewed and has the lgtm label, please ask for approval from dharmit by writing /assign @dharmit in a comment. For more information see:The Kubernetes Code Review Process.

The full list of commands accepted by this bot can be found 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[bot] avatar Aug 23 '22 14:08 openshift-ci[bot]

The problem I am facing with the code in this PR is that if you do below, it adds a helm repo and also creates a helm release:

$ kubectl run helm --image quay.io/dharmit/fedora:helm --command -- helm repo add bitnami https://charts.bitnami.com/bitnami && helm install my-db bitnami/postgresql

But when using following devfile, and doing odo deploy, it doesn't do the second part.

devfile.yaml
schemaVersion: 2.2.0
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-nodejs-app
  projectType: nodejs
  tags:
  - NodeJS
  - Express
  - ubi8
  version: 2.0.0
components:
- container:
    endpoints:
    - name: port-8080-tcp
      protocol: tcp
      targetPort: 8080
    image: registry.access.redhat.com/ubi8/nodejs-16:latest
    memoryLimit: 1024Mi
    mountSources: true
  name: runtime
- container:
    image: quay.io/quay/busybox
  name: funtime
- container:
    image: quay.io/dharmit/fedora:helm
  name: tools
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: ls -la
    component: funtime
  id: mycmdone
- exec:
    commandLine: echo "Sleeping 5 seconds"; sleep 5
    component: funtime
  id: mycmdtwo
- exec:
    commandLine: helm repo add bitnami https://charts.bitnami.com/bitnami && helm install my-db bitnami/postgresql
    component: tools
  id: deploy-db
- composite:
    commands:
      - mycmdone
      - mycmdtwo
      - deploy-db
    group:
      kind: deploy
      isDefault: true
  id: mydeploy

Here's the error I see from the Pod created for the Job:

$ kubectl logs toolsgk5d7-5g5pt 
"bitnami" has been added to your repositories
Error: template: postgresql/templates/secrets.yaml:17:24: executing "postgresql/templates/secrets.yaml" at <include "common.secrets.passwords.manage" (dict "secret" (include "common.names.fullname" .) "key" "postgres-password" "providedValues" (list "global.postgresql.auth.postgresPassword" "auth.postgresPassword") "context" $)>: error calling include: template: postgresql/charts/common/templates/_secrets.tpl:93:20: executing "common.secrets.passwords.manage" at <lookup "v1" "Secret" $.context.Release.Namespace .secret>: error calling lookup: secrets "my-db-postgresql" is forbidden: User "system:serviceaccount:myproject:default" cannot get resource "secrets" in API group "" in the namespace "myproject"

dharmit avatar Aug 23 '22 14:08 dharmit

Validate Tests on commit ad9104d27f54b05ebca8ea0ba7a3064f91c1c063 finished with errors. View logs: TXT HTML

odo-robot[bot] avatar Aug 23 '22 14:08 odo-robot[bot]

Unit Tests on commit ad9104d27f54b05ebca8ea0ba7a3064f91c1c063 finished successfully. View logs: TXT HTML

odo-robot[bot] avatar Aug 23 '22 14:08 odo-robot[bot]

OpenShift Tests on commit ad9104d27f54b05ebca8ea0ba7a3064f91c1c063 finished successfully. View logs: TXT HTML

odo-robot[bot] avatar Aug 23 '22 14:08 odo-robot[bot]

Kubernetes Tests on commit ad9104d27f54b05ebca8ea0ba7a3064f91c1c063 finished with errors. View logs: TXT HTML

odo-robot[bot] avatar Aug 23 '22 14:08 odo-robot[bot]

@dharmit: The following tests failed, say /retest to rerun all failed tests or /retest-required to rerun all mandatory failed tests:

Test name Commit Details Required Rerun command
ci/prow/v4.11-integration-e2e c7219b9991c2c19bba82a75b41b3dd88ed415709 link true /test v4.11-integration-e2e
ci/prow/v4.9-images c7219b9991c2c19bba82a75b41b3dd88ed415709 link true /test v4.9-images
ci/prow/v4.10-images c7219b9991c2c19bba82a75b41b3dd88ed415709 link true /test v4.10-images
ci/prow/v4.11-images c7219b9991c2c19bba82a75b41b3dd88ed415709 link true /test v4.11-images
ci/prow/v4.12-images c7219b9991c2c19bba82a75b41b3dd88ed415709 link true /test v4.12-images

Full PR test history. Your PR dashboard.

Instructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the kubernetes/test-infra repository. I understand the commands that are listed here.

openshift-ci[bot] avatar Sep 15 '22 07:09 openshift-ci[bot]

Kudos, SonarCloud Quality Gate passed!    Quality Gate passed

Bug A 0 Bugs
Vulnerability A 0 Vulnerabilities
Security Hotspot A 0 Security Hotspots
Code Smell A 0 Code Smells

No Coverage information No Coverage information
0.0% 0.0% Duplication

sonarqubecloud[bot] avatar Sep 16 '22 11:09 sonarqubecloud[bot]

Windows Tests (OCP) on commit ad9104d27f54b05ebca8ea0ba7a3064f91c1c063 finished with errors. View logs: TXT HTML

odo-robot[bot] avatar Sep 16 '22 11:09 odo-robot[bot]

@dharmit: PR needs rebase.

Instructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the kubernetes/test-infra repository.

openshift-merge-robot avatar Nov 02 '22 08:11 openshift-merge-robot