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

generator.GetContainers output should not include initContainers #532

Closed
kadel opened this issue Jul 9, 2021 · 1 comment · Fixed by devfile/library#108
Closed

generator.GetContainers output should not include initContainers #532

kadel opened this issue Jul 9, 2021 · 1 comment · Fixed by devfile/library#108
Assignees
Labels
area/library Common devfile library for interacting with devfiles kind/bug Something isn't working

Comments

@kadel
Copy link
Member

kadel commented Jul 9, 2021

/kind bug

Which area this bug is related to?

/area library

Bug Summary

Describe the bug:

given the devfile like this

schemaVersion: 2.1.0
metadata:
  name: test

commands:
- id: build
  exec:
    commandLine: "true"
    component: cmp
    group:
      isDefault: true
      kind: build
- id: run
  exec:
    commandLine: "sleep infinity"
    component: cmp
    group:
      isDefault: true
      kind: run
- id: test-apply
  apply:
    component: cmp-apply

components:
- name: cmp-apply
  container:
    image: quay.io/prometheus/busybox:latest
    command:
      - "echo 'preStart'"
- name: cmp
  container:
    image: quay.io/prometheus/busybox:latest

events:
  preStart:
    - test-apply

generator.GetContainers return only cmp and cmp-apply container.

Expected behavior

generator.GetContainers should return only cmp container.

Devfile spec says:

when an apply command is bound to a preStart event, and references a container component, it will start the container as a K8S initContainer, unless the component has its dedicatedPod field set to true.

When no apply command exist for a given component, it is assumed the component will be applied at devworkspace start by default.

It is impossible to filter out initContainers from GetContainers output because when calling GetInitContainers containers have autogenerated names that don't match containers from GetInitContainers

@openshift-ci openshift-ci bot added the kind/bug Something isn't working label Jul 9, 2021
@kadel kadel added the area/library Common devfile library for interacting with devfiles label Jul 9, 2021
@elsony
Copy link
Contributor

elsony commented Jul 13, 2021

Cabal discussion:
We'll fix this issue by taking out the init containers from the returning list of containers when calling GetContainers.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
area/library Common devfile library for interacting with devfiles kind/bug Something isn't working
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants