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

Invalid Workflow spec results in panic #77

Open
kevdowney opened this issue May 18, 2021 · 0 comments
Open

Invalid Workflow spec results in panic #77

kevdowney opened this issue May 18, 2021 · 0 comments
Labels
bug Something isn't working

Comments

@kevdowney
Copy link
Collaborator

kevdowney commented May 18, 2021

Is this a BUG REPORT or FEATURE REQUEST?:
BUG
What happened:

{"level":"dpanic","ts":1621359024.5573485,"logger":"controllers.Addon","msg":"odd number of arguments passed as key-value pairs for logging","addon":"addon-manager-system/efs-csi","ignored key":"interface conversion: interface {} is nil, not []interface {}","stacktrace":"github.com/go-logr/zapr.handleFields\n\t/Users/kdowney/go/pkg/mod/github.com/go-logr/[email protected]/zapr.go:100\ngithub.com/go-logr/zapr.(*zapLogger).Info\n\t/Users/kdowney/go/pkg/mod/github.com/go-logr/[email protected]/zapr.go:127\ngithub.com/keikoproj/addon-manager/controllers.(*AddonReconciler).execAddon.func1\n\t/Users/kdowney/go/src/github.com/keikoproj/addon-manager/controllers/addon_controller.go:128\nruntime.gopanic\n\t/usr/local/Cellar/go/1.15.2/libexec/src/runtime/panic.go:969\nruntime.panicdottypeE\n\t/usr/local/Cellar/go/1.15.2/libexec/src/runtime/iface.go:261\ngithub.com/keikoproj/addon-manager/pkg/workflows.(*workflowLifecycle).configureWorkflowArtifacts\n\t/Users/kdowney/go/src/github.com/keikoproj/addon-manager/pkg/workflows/workflow.go:331\ngithub.com/keikoproj/addon-manager/pkg/workflows.(*workflowLifecycle).Install\n\t/Users/kdowney/go/src/github.com/keikoproj/addon-manager/pkg/workflows/workflow.go:84\ngithub.com/keikoproj/addon-manager/controllers.(*AddonReconciler).runWorkflow\n\t/Users/kdowney/go/src/github.com/keikoproj/addon-manager/controllers/addon_controller.go:425\ngithub.com/keikoproj/addon-manager/controllers.(*AddonReconciler).processAddon\n\t/Users/kdowney/go/src/github.com/keikoproj/addon-manager/controllers/addon_controller.go:325\ngithub.com/keikoproj/addon-manager/controllers.(*AddonReconciler).execAddon\n\t/Users/kdowney/go/src/github.com/keikoproj/addon-manager/controllers/addon_controller.go:132\ngithub.com/keikoproj/addon-manager/controllers.(*AddonReconciler).Reconcile\n\t/Users/kdowney/go/src/github.com/keikoproj/addon-manager/controllers/addon_controller.go:122\nsigs.k8s.io/controller-runtime/pkg/internal/controller.(*Controller).reconcileHandler\n\t/Users/kdowney/go/pkg/mod/sigs.k8s.io/[email protected]/pkg/internal/controller/controller.go:244\nsigs.k8s.io/controller-runtime/pkg/internal/controller.(*Controller).processNextWorkItem\n\t/Users/kdowney/go/pkg/mod/sigs.k8s.io/[email protected]/pkg/internal/controller/controller.go:218\nsigs.k8s.io/controller-runtime/pkg/internal/controller.(*Controller).worker\n\t/Users/kdowney/go/pkg/mod/sigs.k8s.io/[email protected]/pkg/internal/controller/controller.go:197\nk8s.io/apimachinery/pkg/util/wait.BackoffUntil.func1\n\t/Users/kdowney/go/pkg/mod/k8s.io/[email protected]/pkg/util/wait/wait.go:155\nk8s.io/apimachinery/pkg/util/wait.BackoffUntil\n\t/Users/kdowney/go/pkg/mod/k8s.io/[email protected]/pkg/util/wait/wait.go:156\nk8s.io/apimachinery/pkg/util/wait.JitterUntil\n\t/Users/kdowney/go/pkg/mod/k8s.io/[email protected]/pkg/util/wait/wait.go:133\nk8s.io/apimachinery/pkg/util/wait.Until\n\t/Users/kdowney/go/pkg/mod/k8s.io/[email protected]/pkg/util/wait/wait.go:90"}
{"level":"info","ts":1621359024.5573442,"logger":"controllers.Addon","msg":"Error: Panic occurred during execAdd %s/%s due to %s","addon":"addon-manager-system/efs-csi","addon-manager-system":"efs-csi"}

Addon:

apiVersion: addonmgr.keikoproj.io/v1alpha1
kind: Addon
metadata:
  name: test-addon
  namespace: addon-manager-system
spec:
  pkgName: test-addon
  pkgVersion: v0.1.0
  pkgType: composite
  pkgDescription: "efs-csi addon"
  params:
    namespace: addon-test-ns
    context:
      clusterName: my-test-cluster-k8s
      clusterRegion: us-west-2
  lifecycle:
    prereqs:
      template: |
        apiVersion: argoproj.io/v1alpha1
        kind: Workflow
        metadata:
          labels:
          workflows.argoproj.io/controller-instanceid: addon-manager-workflow-controller
        spec:
          activeDeadlineSeconds: 600
          entrypoint: prereqs-wf
          serviceAccountName: addon-manager-workflow-installer-sa

        templates:
          - name: prereqs-wf
            steps:
              - - name: efs-privatelink
                   template: efs-privatelink
                   arguments:
                     artifacts:
                     - name: doc
                        path: /tmp/efs-privatlink.yaml
                        raw:
                        data: |
                          AWSTemplateFormatVersion: '2010-09-09'
                          Description: 'EFS PrivateLink'

          - name: efs-privatelink
            inputs:
              artifacts:
                - name: doc
                  path: /tmp/efs-privatelink.yaml
            container:
              image: docker/whalesay:latest
              command: [cowsay]
              args: ["hello world"]

The specific invalidness of this template is .spec.lifecycle.prereqs.template.templates is at wrong indentation, it should be .spec.lifecycle.prereqs.template.spec.templates.

What you expected to happen:

How to reproduce it (as minimally and precisely as possible):

Anything else we need to know?:

Environment:

  • Addon Manager version
  • Kubernetes version :
$ kubectl version -o yaml

Other debugging information (if applicable):

  • Addon status:
$ kubectl describe addon <addon-name>
  • controller logs:
$ kubectl logs <addon-manager-pod>
@kevdowney kevdowney added the bug Something isn't working label May 18, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

1 participant