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

some of the containerd_additional_runtimes options should preserve quotes #9913

Closed
andy108369 opened this issue Mar 21, 2023 · 7 comments
Closed
Labels
kind/bug Categorizes issue or PR as related to a bug. lifecycle/rotten Denotes an issue or PR that has aged beyond stale and will be auto-closed.

Comments

@andy108369
Copy link

kubespray v2.21.0

containerd_additional_runtimes:
  - name: nvidia
    type: "io.containerd.runc.v2"
    engine: ""
    root: ""
    options:
      BinaryName: "/usr/bin/nvidia-container-runtime"
RUNNING HANDLER [container-engine/containerd : restart containerd] ***************************************************************************************************
changed: [node1]
Tuesday 21 March 2023  15:33:38 +0000 (0:00:00.201)       0:01:37.018 ********* 

RUNNING HANDLER [container-engine/containerd : Containerd | restart containerd] **************************************************************************************
fatal: [node1]: FAILED! => {"changed": false, "msg": "Unable to restart service containerd: Job for containerd.service failed because the control process exited with error code.\nSee \"systemctl status containerd.service\" and \"journalctl -xeu containerd.service\" for details.\n"}
Tuesday 21 March 2023  15:33:39 +0000 (0:00:00.860)       0:01:37.879 ********* 
# journalctl -xeu containerd.service
...
░░ 
░░ A start job for unit containerd.service has begun execution.
░░ 
░░ The job identifier is 5418.
Mar 21 15:33:49 node1 containerd[20434]: containerd: failed to load TOML: /etc/containerd/config.toml: (41, 26): no value can start with /
Mar 21 15:33:49 node1 systemd[1]: containerd.service: Main process exited, code=exited, status=1/FAILURE
░░ Subject: Unit process exited
░░ Defined-By: systemd

Missing quotes on the line 41:

# cat /etc/containerd/config.toml 
...
...
          [plugins."io.containerd.grpc.v1.cri".containerd.runtimes.nvidia.options]
            BinaryName = /usr/bin/nvidia-container-runtime

Workaround

Wrap "/usr/bin/nvidia-container-runtime" in between single quotes, e.g. '"/usr/bin/nvidia-container-runtime"'

@andy108369 andy108369 added the kind/bug Categorizes issue or PR as related to a bug. label Mar 21, 2023
@yankay
Copy link
Member

yankay commented Mar 22, 2023

Thanks @andy108369

If you like, Would you please submit a PR to fix the issue.

@k8s-triage-robot
Copy link

The Kubernetes project currently lacks enough contributors to adequately respond to all issues.

This bot triages un-triaged issues according to the following rules:

  • After 90d of inactivity, lifecycle/stale is applied
  • After 30d of inactivity since lifecycle/stale was applied, lifecycle/rotten is applied
  • After 30d of inactivity since lifecycle/rotten was applied, the issue is closed

You can:

  • Mark this issue as fresh with /remove-lifecycle stale
  • Close this issue with /close
  • Offer to help out with Issue Triage

Please send feedback to sig-contributor-experience at kubernetes/community.

/lifecycle stale

@k8s-ci-robot k8s-ci-robot added the lifecycle/stale Denotes an issue or PR has remained open with no activity and has become stale. label Jun 20, 2023
@k8s-triage-robot
Copy link

The Kubernetes project currently lacks enough active contributors to adequately respond to all issues.

This bot triages un-triaged issues according to the following rules:

  • After 90d of inactivity, lifecycle/stale is applied
  • After 30d of inactivity since lifecycle/stale was applied, lifecycle/rotten is applied
  • After 30d of inactivity since lifecycle/rotten was applied, the issue is closed

You can:

  • Mark this issue as fresh with /remove-lifecycle rotten
  • Close this issue with /close
  • Offer to help out with Issue Triage

Please send feedback to sig-contributor-experience at kubernetes/community.

/lifecycle rotten

@k8s-ci-robot k8s-ci-robot added lifecycle/rotten Denotes an issue or PR that has aged beyond stale and will be auto-closed. and removed lifecycle/stale Denotes an issue or PR has remained open with no activity and has become stale. labels Jul 20, 2023
@andy108369
Copy link
Author

Thanks @andy108369

If you like, Would you please submit a PR to fix the issue.

Yeah, will do.
Sorry for late response.

arno01 added a commit to arno01/kubespray that referenced this issue Jul 22, 2023
…non-boolean values (kubernetes-sigs#9913)

This commit modifies the Jinja2 template for generating the containerd configuration file to handle a specific requirement: preserving quotes for non-boolean values in `containerd_additional_runtimes.<name>.options`.

The update is necessary due to the mixed data types in the options field:

1. Boolean values (true, false) and their string equivalents ("true", "false") should be rendered without quotes.
2. Non-boolean string values should be rendered with quotes.

The logic implemented checks if a value is a boolean or the string representation of a boolean. If it is, we ensure it's rendered as a lowercase `true` or `false` without quotes.

If the value is not a boolean or a string equivalent of a boolean, we render it with quotes, preserving the original formatting.

While the logic may seem verbose, it's necessary to accommodate the differing requirements for boolean and non-boolean values within the configuration file, ensuring the generated configurations are correctly formatted and functional.
arno01 added a commit to arno01/kubespray that referenced this issue Jul 22, 2023
…non-boolean values (kubernetes-sigs#9913)

This commit modifies the Jinja2 template for generating the containerd configuration file to handle a specific requirement: preserving quotes for non-boolean values in `containerd_additional_runtimes.<name>.options`.

The update is necessary due to the mixed data types in the options field:

1. Boolean values (true, false) and their string equivalents ("true", "false") should be rendered without quotes.
2. Non-boolean string values should be rendered with quotes.

The logic implemented checks if a value is a boolean or the string representation of a boolean. If it is, we ensure it's rendered as a lowercase `true` or `false` without quotes.

If the value is not a boolean or a string equivalent of a boolean, we render it with quotes, preserving the original formatting.

While the logic may seem verbose, it's necessary to accommodate the differing requirements for boolean and non-boolean values within the configuration file, ensuring the generated configurations are correctly formatted and functional.
arno01 added a commit to arno01/kubespray that referenced this issue Jul 22, 2023
…non-boolean values (kubernetes-sigs#9913)

This commit modifies the Jinja2 template for generating the containerd configuration file to handle a specific requirement: preserving quotes for non-boolean values in `containerd_additional_runtimes.<name>.options`.

The update is necessary due to the mixed data types in the options field:

1. Boolean values (true, false) and their string equivalents ("true", "false") should be rendered without quotes.
2. Non-boolean string values should be rendered with quotes.

The logic implemented checks if a value is a boolean or the string representation of a boolean. If it is, we ensure it's rendered as a lowercase `true` or `false` without quotes.

If the value is not a boolean or a string equivalent of a boolean, we render it with quotes, preserving the original formatting.

While the logic may seem verbose, it's necessary to accommodate the differing requirements for boolean and non-boolean values within the configuration file, ensuring the generated configurations are correctly formatted and functional.
@arno01
Copy link
Contributor

arno01 commented Jul 22, 2023

PR #10307

@k8s-triage-robot
Copy link

The Kubernetes project currently lacks enough active contributors to adequately respond to all issues and PRs.

This bot triages issues according to the following rules:

  • After 90d of inactivity, lifecycle/stale is applied
  • After 30d of inactivity since lifecycle/stale was applied, lifecycle/rotten is applied
  • After 30d of inactivity since lifecycle/rotten was applied, the issue is closed

You can:

  • Reopen this issue with /reopen
  • Mark this issue as fresh with /remove-lifecycle rotten
  • Offer to help out with Issue Triage

Please send feedback to sig-contributor-experience at kubernetes/community.

/close not-planned

@k8s-ci-robot
Copy link
Contributor

@k8s-triage-robot: Closing this issue, marking it as "Not Planned".

In response to this:

The Kubernetes project currently lacks enough active contributors to adequately respond to all issues and PRs.

This bot triages issues according to the following rules:

  • After 90d of inactivity, lifecycle/stale is applied
  • After 30d of inactivity since lifecycle/stale was applied, lifecycle/rotten is applied
  • After 30d of inactivity since lifecycle/rotten was applied, the issue is closed

You can:

  • Reopen this issue with /reopen
  • Mark this issue as fresh with /remove-lifecycle rotten
  • Offer to help out with Issue Triage

Please send feedback to sig-contributor-experience at kubernetes/community.

/close not-planned

Instructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the kubernetes/test-infra repository.

@k8s-ci-robot k8s-ci-robot closed this as not planned Won't fix, can't repro, duplicate, stale Jan 20, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
kind/bug Categorizes issue or PR as related to a bug. lifecycle/rotten Denotes an issue or PR that has aged beyond stale and will be auto-closed.
Projects
None yet
Development

No branches or pull requests

5 participants