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

ConfigmapRef does not respect optional and default keyword #8262

Closed
2 of 3 tasks
louisnow opened this issue Mar 28, 2022 · 4 comments · Fixed by #8271
Closed
2 of 3 tasks

ConfigmapRef does not respect optional and default keyword #8262

louisnow opened this issue Mar 28, 2022 · 4 comments · Fixed by #8271

Comments

@louisnow
Copy link

Checklist

  • Double-checked my configuration.
  • Tested using the latest version.
  • Used the Emissary executor.

Summary

What happened/what you expected to happen?
Optional and default keywords are not respected when using configMapKeyRef.
Workflow errors while trying to reference a key that does not exist.

What version are you running?
v3.2.9
Emissary Executor

Diagnostics

Paste the smallest workflow that reproduces the bug. We must be able to run the workflow.

apiVersion: v1
kind: ConfigMap
metadata:
  name: retry-sample
  labels:
    workflows.argoproj.io/configmap-type: Parameter
data:
  dummy: "{}"
  dummy1: ""
apiVersion: argoproj.io/v1alpha1
kind: WorkflowTemplate
metadata:
  name: retry-sample
spec:
  entrypoint: main
  templates:
    - name: main
      inputs:
        parameters:
          - name: message
            valueFrom:
              default: "hello"
              configMapKeyRef:
                name: retry-sample
                key: dummy-missing
                optional: true
      container:
        image: docker/whalesay
        command: [cowsay]
        args: ["{{inputs.parameters.message}}"]
# Logs from the workflow controller:
kubectl logs -n argo deploy/workflow-controller | grep ${workflow} 

# If the workflow's pods have not been created, you can skip the rest of the diagnostics.

# The workflow's pods that are problematic:
kubectl get pod -o yaml -l workflows.argoproj.io/workflow=${workflow},workflow.argoproj.io/phase!=Succeeded

# Logs from in your workflow's wait container, something like:
kubectl logs -c wait -l workflows.argoproj.io/workflow=${workflow},workflow.argoproj.io/phase!=Succeeded

Message from the maintainers:

Impacted by this bug? Give it a 👍. We prioritise the issues with the most 👍.

@github-actions
Copy link
Contributor

@louisnow: There are no area labels on this issue. Adding a label will help expedite your issue. If you are unsure what to do, make your best guess. We can change it later

  • /area api
  • /area artifacts
  • /area build
  • /area cli
  • /area controller
  • /area cron-workflows
  • /area daemon-steps
  • /area docs
  • /area executor
  • /area exit-handler
  • /area hooks
  • /area looping
  • /area manifests
  • /area memoization
  • /area metrics
  • /area multi-cluster
  • /area mutex-semaphore
  • /area plugins
  • /area sdks
  • /area spec
  • /area sso-rbac
  • /area suspend-resume
  • /area templates/container
  • /area templates/container-set
  • /area templates/dag
  • /area templates/data
  • /area templates/http
  • /area templates/resource
  • /area templates/script
  • /area templates/steps
Details

I am a bot created to help the argoproj developers manage community feedback and contributions. You can check out my manifest file to understand my behavior and what I can do. If you want to use this for your project, you can check out the DeFiCh/oss-governance-bot repository.

@louisnow
Copy link
Author

/area templates/resource

@alexec
Copy link
Contributor

alexec commented Mar 28, 2022

The bug is here:

cmValue, err := GetConfigMapValue(configMapInformer, namespace, cmName, cmKey)

It's clear the code does not take this into account.

I think that @terrytangyuan might be busy. @louisnow would you like to submit a PR?

@terrytangyuan
Copy link
Member

This should be fixed in #8271.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
3 participants