Skip to content
This repository has been archived by the owner on Apr 27, 2020. It is now read-only.

Support for writing stdin to a parameter. #66

Open
jmdots opened this issue Feb 26, 2019 · 3 comments
Open

Support for writing stdin to a parameter. #66

jmdots opened this issue Feb 26, 2019 · 3 comments

Comments

@jmdots
Copy link

jmdots commented Feb 26, 2019

Is this a BUG REPORT or FEATURE REQUEST?:

  • feature

What happened: Having a hard time specifying JSON on the command line. And I don't wish to read from a file in git/etc in every case. Need a clean way to code stdin for kubectl into the job.

What you expected to happen: A stdin param would make this easy.

How to reproduce it (as minimally and precisely as possible): Try bash here docs or bash here strings with apply operations that idempotently create namespaces. Quoting and carriage returns make these hacks untenable.

Anything else we need to know?: I generate my pipelines from jsonnet. It renders to json/yaml all the same.

Environment: docker-compose file from main repo.

Here's a concept sketch of what I'm looking for. Perhaps there is already something like this that I missed.

jobs:
- name: kubectl.create_namespace(docker-for-desktop, common)
  plan:
  - params:
      kubectl: apply -f -
      stdin: |
        apiVersion: v1
        kind: Namespace
        metadata:
          labels:
            name: common
          name: common
    put: kubectl.profile(docker-for-desktop)
@jmdots
Copy link
Author

jmdots commented Feb 26, 2019

@superbrothers
Copy link
Contributor

You can use the following way for creating namespace:

  plan:
  - put: cluster
    params:
      kubectl: create namespace common

Therefore, do you have other usecases except creating namespace?

@jmdots
Copy link
Author

jmdots commented Mar 18, 2019

@superbrothers Is that method idempotent or convergent? Trying to create the namespace more than once using that kubectl syntax would usually throw a non-zero error code, in my experience. Yes, other use cases exist but I'll try sorting through it in the current framework until I can state them concretely.

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants