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

Adds support for exec command for odo deploy #6047

Closed
wants to merge 1 commit into from
Closed

Adds support for exec command for odo deploy #6047

wants to merge 1 commit into from

Conversation

dharmit
Copy link
Member

@dharmit dharmit commented Aug 23, 2022

Signed-off-by: Dharmit Shah shahdharmit@gmail.com

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 dharmit added the do-not-merge/work-in-progress Indicates that a PR should not merge because it is a work in progress. Required by Prow. label Aug 23, 2022
@openshift-ci openshift-ci bot removed the do-not-merge/work-in-progress Indicates that a PR should not merge because it is a work in progress. Required by Prow. label Aug 23, 2022
@netlify
Copy link

netlify bot commented Aug 23, 2022

Deploy Preview for odo-docusaurus-preview ready!

Name Link
🔨 Latest commit 8db5459
🔍 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.

@openshift-ci openshift-ci bot added the kind/feature Categorizes issue as a feature request. For PRs, that means that the PR is the implementation label Aug 23, 2022
@openshift-ci openshift-ci bot requested review from cdrage and feloy August 23, 2022 14:04
@openshift-ci
Copy link

openshift-ci bot commented Aug 23, 2022

[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

@dharmit
Copy link
Member Author

dharmit commented Aug 23, 2022

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 dharmit marked this pull request as draft August 23, 2022 14:08
@openshift-ci openshift-ci bot added the do-not-merge/work-in-progress Indicates that a PR should not merge because it is a work in progress. Required by Prow. label Aug 23, 2022
@odo-robot
Copy link

odo-robot bot commented Aug 23, 2022

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

@odo-robot
Copy link

odo-robot bot commented Aug 23, 2022

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

@odo-robot
Copy link

odo-robot bot commented Aug 23, 2022

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

@odo-robot
Copy link

odo-robot bot commented Aug 23, 2022

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

@openshift-merge-robot openshift-merge-robot added the needs-rebase Indicates a PR cannot be merged because it has merge conflicts with HEAD. Required by Prow. label Sep 3, 2022
@openshift-ci
Copy link

openshift-ci bot commented Sep 15, 2022

@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 c7219b9 link true /test v4.11-integration-e2e
ci/prow/v4.9-images c7219b9 link true /test v4.9-images
ci/prow/v4.10-images c7219b9 link true /test v4.10-images
ci/prow/v4.11-images c7219b9 link true /test v4.11-images
ci/prow/v4.12-images c7219b9 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.

Signed-off-by: Dharmit Shah <shahdharmit@gmail.com>
@openshift-merge-robot openshift-merge-robot removed the needs-rebase Indicates a PR cannot be merged because it has merge conflicts with HEAD. Required by Prow. label Sep 16, 2022
@sonarcloud
Copy link

sonarcloud bot commented Sep 16, 2022

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

@odo-robot
Copy link

odo-robot bot commented Sep 16, 2022

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

@openshift-merge-robot openshift-merge-robot added the needs-rebase Indicates a PR cannot be merged because it has merge conflicts with HEAD. Required by Prow. label Nov 2, 2022
@openshift-merge-robot
Copy link
Collaborator

@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.

@dharmit dharmit closed this by deleting the head repository Nov 22, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
do-not-merge/work-in-progress Indicates that a PR should not merge because it is a work in progress. Required by Prow. kind/feature Categorizes issue as a feature request. For PRs, that means that the PR is the implementation needs-rebase Indicates a PR cannot be merged because it has merge conflicts with HEAD. Required by Prow.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Support exec command for deploy
2 participants