Adds support for exec command for odo deploy
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:
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...Use your smartphone camera to open QR code link. |
To edit notification comments on pull requests, go to your Netlify site settings.
[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.
Approvers can indicate their approval by writing /approve in a comment
Approvers can cancel approval by writing /approve cancel in a comment
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"
Validate Tests on commit ad9104d27f54b05ebca8ea0ba7a3064f91c1c063 finished with errors. View logs: TXT HTML
Unit Tests on commit ad9104d27f54b05ebca8ea0ba7a3064f91c1c063 finished successfully. View logs: TXT HTML
OpenShift Tests on commit ad9104d27f54b05ebca8ea0ba7a3064f91c1c063 finished successfully. View logs: TXT HTML
Kubernetes Tests on commit ad9104d27f54b05ebca8ea0ba7a3064f91c1c063 finished with errors. View logs: TXT HTML
@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.
Kudos, SonarCloud Quality Gate passed! 
0 Bugs
0 Vulnerabilities
0 Security Hotspots
0 Code Smells
No Coverage information
0.0% Duplication
Windows Tests (OCP) on commit ad9104d27f54b05ebca8ea0ba7a3064f91c1c063 finished with errors. View logs: TXT HTML
@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.