jonua
jonua

Reputation: 2035

bitbucket pipelines atlassian/kubectl-run unable to recognize "path/to/configuration.yaml": unknown

I have the next pipeline

image: maven:3-amazoncorretto-21

definitions:
  services:
    docker:
      memory: 2048

pipelines:
  branches:
    'mybranch':
      - step:
          name: run job
          deployment: test
          services:
            - docker
          caches:
            - docker
          script:
            - pipe: atlassian/kubectl-run:3.11.0
              variables:
                KUBE_CONFIG: $KUBE_CONFIG_DEV
                KUBECTL_COMMAND: 'create -f path/to/configuration.yaml'
                KUBECTL_ARGS:
                  - '-n mynamespace'
                  - '--validate=false'
                PRE_EXECUTION_SCRIPT: 'pre-execution.sh' # Optional.
                DISABLE_VALIDATION: 'true'
                DEBUG: 'true'

the pre-execution.sh file:

#!/bin/sh
ls path/to -alh

result is:

drwxrwxrwx 3 nobody nogroup 4.0K Nov 27 09:23 .

drwxrwxrwx 5 nobody nogroup 4.0K Nov 27 09:23 ..

-rw-rw-rw- 1 nobody nogroup    9 Nov 27 09:23 .gitignore

-rw-rw-rw- 1 nobody nogroup 3.3K Nov 27 09:23 configuration.yaml


E1127 09:24:32.367492      11 memcache.go:265] couldn't get current server API group list: unknown

error: unable to recognize "path/to/configuration.yaml": unknown

✖ kubectl create -f path/to/configuration.yaml failed.

What I'm doing wrong?

Upvotes: 0

Views: 48

Answers (0)

Related Questions