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

Change Command Argument to multiple arguments #6520

Merged
merged 1 commit into from
Oct 14, 2021

Conversation

tcnt
Copy link
Contributor

@tcnt tcnt commented Oct 8, 2021

Fixes #2569

file.sh(see next lines) shows how arguments are passed to the pod
#!/bin/bash
while :
do
echo arg1 = $1 arg2 = $2
sleep 10
done

In UI create form the following entries are made
Run command: ./file.sh
Run command arguments: argument1 argument2 argument3

Before change:

POD log shows
arg1 = argument1 argument2 argument3 arg2 =

so all 3 arguments are passed as one argument

Deployment yaml shows(only container part)
spec:
containers:
- name: demo-arg-old
image: tcnthomas/arguments
command:
- ./file.sh
args:
- argument1 argument2 argument3

After change

POD log shows
arg1 = argument1 arg2 = argument2
First 2 arguments are shown as expected.
3rd argument is not shown as it is not part of the script

Deployment yaml shows(only container part)
spec:
containers:
- name: demo-arg-new
image: tcnthomas/arguments
command:
- ./file.sh
args:
- argument1
- argument2
- argument3

file.sh(see next lines) shows how arguments are passed to the pod
#!/bin/bash
while :
do
  echo arg1 = $1 arg2 = $2
  sleep 10
done

In UI create form the following entries are made
Run command: ./file.sh
Run command arguments: argument1 argument2 argument3

Before change:
POD log shows
arg1 = argument1 argument2 argument3 arg2 =

so all 3 arguments are passed as one argument

Deployment yaml shows(only container part)
    spec:
      containers:
        - name: demo-arg-old
          image: tcnthomas/arguments
          command:
            - ./file.sh
          args:
            - argument1 argument2 argument3

After change
POD log shows
arg1 = argument1 arg2 = argument2
First 2 arguments are shown as expected.
3rd argument is not shown as it is not part of the script

Deployment yaml shows(only container part)
    spec:
      containers:
        - name: demo-arg-new
          image: tcnthomas/arguments
          command:
            - ./file.sh
          args:
            - argument1
            - argument2
            - argument3
@k8s-ci-robot k8s-ci-robot added cncf-cla: yes Indicates the PR's author has signed the CNCF CLA. size/S Denotes a PR that changes 10-29 lines, ignoring generated files. labels Oct 8, 2021
@codecov
Copy link

codecov bot commented Oct 8, 2021

Codecov Report

Merging #6520 (da71111) into master (f156a92) will not change coverage.
The diff coverage is 100.00%.

@@           Coverage Diff           @@
##           master    #6520   +/-   ##
=======================================
  Coverage   42.53%   42.53%           
=======================================
  Files         217      217           
  Lines       10627    10627           
  Branches      160      160           
=======================================
  Hits         4520     4520           
- Misses       5840     5841    +1     
+ Partials      267      266    -1     

@floreks
Copy link
Member

floreks commented Oct 14, 2021

Small and simple. Thanks!

/lgtm
/approve

@k8s-ci-robot k8s-ci-robot added the lgtm "Looks good to me", indicates that a PR is ready to be merged. label Oct 14, 2021
@k8s-ci-robot
Copy link
Contributor

[APPROVALNOTIFIER] This PR is APPROVED

This pull-request has been approved by: floreks, tcnt

The full list of commands accepted by this bot can be found here.

The pull request process is described here

Needs approval from an approver in each of these files:

Approvers can indicate their approval by writing /approve in a comment
Approvers can cancel approval by writing /approve cancel in a comment

@k8s-ci-robot k8s-ci-robot added the approved Indicates a PR has been approved by an approver from all required OWNERS files. label Oct 14, 2021
@k8s-ci-robot k8s-ci-robot merged commit c65240d into kubernetes:master Oct 14, 2021
@tcnt tcnt deleted the fix-arguments-2569 branch October 15, 2021 10:53
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
approved Indicates a PR has been approved by an approver from all required OWNERS files. cncf-cla: yes Indicates the PR's author has signed the CNCF CLA. lgtm "Looks good to me", indicates that a PR is ready to be merged. size/S Denotes a PR that changes 10-29 lines, ignoring generated files.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Unable to use mutiple command arguments
3 participants