question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Kubernetes Containers Command args ignored in v1.5

See original GitHub issue

Jenkins version: 2.121.3 Plugin version: 1.5 OS: RHEL

I am using K8’s to provision slaves for Jenkins and I define my slaves in JCasC. An example config is below:

 - kubernetes:
      addMasterProxyEnvVars: true
      containerCapStr: "100"
      ...
      templates:
      - containers:
        - alwaysPullImage: true
          args: "${computer.jnlpmac} ${computer.name}"
          command: ""

I set command to be an empty String because otherwise it is defaulted to something like /bin/sh cat and that results in my agents dying.

In version 1.4, the above config works perfectly fine but when I upgrade to 1.5, the empty string for command is ignored and /bin/sh is set and thus my agents all fail.

Issue Analytics

  • State:closed
  • Created 5 years ago
  • Comments:8 (4 by maintainers)

github_iconTop GitHub Comments

2reactions
jetersencommented, Mar 20, 2019

Yes, this should work if you just change the string from args: "${computer.jnlpmac} ${computer.name}" to args: "^${computer.jnlpmac} ^${computer.name}" if what you want is the literal value for the kubernetes plugin to expand when it spins up agents.

This args: "^${computer.jnlpmac} ^${computer.name}" will evalute to the literal args: "${computer.jnlpmac} ${computer.name}" inside JCasC.

Whereas without the ^ it will properly evaluate to args: " " inside JCasC

0reactions
bkruger99commented, Mar 20, 2019
Read more comments on GitHub >

github_iconTop Results From Across the Web

Kubernetes command arguments being ignored
During the Initialization values process, during the container start, those properties seem to have they default values e.g. db_name: "ads". At ...
Read more >
Define a Command and Arguments for a Container - Kubernetes
This page shows how to define commands and arguments when you run a container in a Pod. Before you begin You need to...
Read more >
Troubleshooting Applications | Kubernetes
This page shows how to investigate problems related to the execution of Init Containers. The example command lines below refer to the Pod...
Read more >
Handling retriable and non-retriable pod failures with Pod ...
Using Pod failure policy to ignore Pod disruptions ; Run this command to check the nodeName the Pod is scheduled to: nodeName ;...
Read more >
Init Containers | Kubernetes
Here are some ideas for how to use init containers: Wait for a Service to be created, using a shell one-line command like:...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found