odo icon indicating copy to clipboard operation
odo copied to clipboard

As a user, I need guidance on how to add devfiles to existing apps (`odo init --dry-run -o yaml`)

Open ryanj opened this issue 4 years ago • 6 comments

/kind user-story

User Story

As a developer and/or team lead, I want to make it easier for team members to get started with devfiles by adding a valid devfile.yaml to any existing repo.

Acceptance Criteria

  • [ ] Running odo init nodejs frontend --dry-run -o yaml should skip creation of the frontend component, AND print a fresh devfile to standard out
  • [ ] Running odo init nodejs frontend --dry-run -o yaml > devfile.yaml should bypass creation of the frontend component, and write a new devfile.yaml file to disk
  • [ ] The resulting devfile.yaml (when added to my repo folder), should allow me to create a new frontend component by running odo create frontend

Links

  • Feature Request:
  • Related issue:

/kind user-story

ryanj avatar Feb 15 '21 21:02 ryanj

@ryanj thanks for describing the requirements/criteria so clearly.

I think what you're looking for should be addressed to a good extent when #4436 gets merged. That PR is about not requiring cluster access to create a component. What it will do is only create devfile.yaml in your pwd. The creation of a component on the k8s/ocp cluster happens when the user runs odo push.

dharmit avatar Feb 16 '21 12:02 dharmit

Thanks @dharmit

I'll see if I can test the new build

I forgot to mention that kubectl and oc both avoid making any other writes when the --dry-run flag is used. For odo, this flag would likely bypass creation or updates for devfile.yaml, config.yaml, env.yaml, .gitignore, or any files under .odo/.

The flag is designed to provide a repeatable, no-op simulation that only writes to the standard output.

Examples:

  • Add an example deployment yaml to a repo by redirecting standard out to a local file: kubectl create deploy metrics-k8s --image=quay.io/ryanj/metrics-k8s --dry-run -o yaml > deployment.yaml
  • Pipe standard out to standard input, so the "push" of changes is a separate step: kubectl create deploy metrics-k8s --image=quay.io/ryanj/metrics-k8s --dry-run -o yaml | kubectl create -f -

ryanj avatar Feb 17 '21 17:02 ryanj

@kadel can you please share your thoughts on the --dry-run request here from @ryanj?

dharmit avatar Feb 18 '21 05:02 dharmit

I like --dry-run, it makes sense and I can see it being quite useful.

kadel avatar Feb 19 '21 14:02 kadel

Issues go stale after 90d of inactivity.

Mark the issue as fresh by commenting /remove-lifecycle stale. Stale issues rot after an additional 30d of inactivity and eventually close. Exclude this issue from closing by commenting /lifecycle frozen.

If this issue is safe to close now please do so with /close.

/lifecycle stale

openshift-bot avatar May 20 '21 19:05 openshift-bot

/remove-lifecycle stale /lifecycle frozen still valid

On Thu, 20 May 2021 at 21:37, OpenShift Bot @.***> wrote:

Issues go stale after 90d of inactivity.

Mark the issue as fresh by commenting /remove-lifecycle stale. Stale issues rot after an additional 30d of inactivity and eventually close. Exclude this issue from closing by commenting /lifecycle frozen.

If this issue is safe to close now please do so with /close.

/lifecycle stale

— You are receiving this because you were mentioned. Reply to this email directly, view it on GitHub https://github.com/openshift/odo/issues/4435#issuecomment-845420234, or unsubscribe https://github.com/notifications/unsubscribe-auth/AAAN65W6XTV4MIYAMPPQVS3TOVQFRANCNFSM4XVKK3IQ .

kadel avatar May 21 '21 13:05 kadel