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

bugfix: fix sudo -E bash -c '$cmd' with cmd that contains single quotations #4427

Merged
merged 1 commit into from
Dec 19, 2023

Conversation

daymade
Copy link
Contributor

@daymade daymade commented Dec 17, 2023

this is a bug fix for #4424 ,

the cmd of metrics-server in cluster's yaml has a signle quotation ' in --set args='{--kubelet-insecure-tls=true,--kubelet-preferred-address-types=InternalIP}', which will cause a problem with the single quotation in sudo -E /bin/bash -c '$cmd'

- cmd:
    - helm upgrade -i metrics-server charts/metrics-server -n kube-system --set args='{--kubelet-insecure-tls=true,--kubelet-preferred-address-types=InternalIP}'
    imageName: registry.cn-shanghai.aliyuncs.com/labring/metrics-server:v0.6.4
    labels:
      io.buildah.version: 1.30.0
    mountPoint: /var/lib/containers/storage/overlay/e080cdaa0e7b16bd43e9635a8079538ee1b891aa2838c5ccf31b0ce191fe2cc0/merged
    name: default-ggcfdsaf
    type: application

if we find a cmd to wrap that contains single quotations, we can replace it with double quotations to avoid problems.

Copy link

cla-assistant bot commented Dec 17, 2023

CLA assistant check
All committers have signed the CLA.

Copy link

cla-assistant bot commented Dec 17, 2023

CLA assistant check
Thank you for your submission! We really appreciate it. Like many open source projects, we ask that you sign our Contributor License Agreement before we can accept your contribution.
You have signed the CLA already but the status is still pending? Let us recheck it.

@sealos-ci-robot
Copy link
Member

🤖 Generated by lychee action

Summary

Status Count
🔍 Total 1146
✅ Successful 388
⏳ Timeouts 0
🔀 Redirected 0
👻 Excluded 757
❓ Unknown 0
🚫 Errors 0

Full action output

Full Github Actions output

Copy link

sweep-ai bot commented Dec 17, 2023

Apply Sweep Rules to your PR?

  • Apply: All new business logic should have corresponding unit tests.
  • Apply: Refactor large functions to be more modular.
  • Apply: Add docstrings to all functions and file headers.

@daymade daymade changed the title bugfix: fix sudo -E '' with an helm cmd has single quotation bugfix: fix sudo -E bash -c '$cmd' with cmd that contains single quotations Dec 17, 2023
Copy link

codecov bot commented Dec 18, 2023

Codecov Report

All modified and coverable lines are covered by tests ✅

Comparison is base (33c7084) 65.45% compared to head (f582ac0) 65.45%.
Report is 7 commits behind head on main.

Additional details and impacted files
@@           Coverage Diff           @@
##             main    #4427   +/-   ##
=======================================
  Coverage   65.45%   65.45%           
=======================================
  Files           8        8           
  Lines         660      660           
=======================================
  Hits          432      432           
  Misses        180      180           
  Partials       48       48           

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

@daymade
Copy link
Contributor Author

daymade commented Dec 18, 2023

@bxy4543 I'm currently addressing the failed end-to-end tests. I've discovered that docker_122 and docker_123 have failed, while containerd_122 and containerd_123 are functioning correctly. The issue appears to be related to an older version of Kubernetes running with the Docker runtime.

I would greatly appreciate any tips or advice for debugging this problem.

E2E_sealos_runtime_version_docker_123_test failed
E2E_sealos_runtime_version_docker_124_test was successfully executed.
E2E_sealos_runtime_version_123_test was successfully executed.

log for E2E_sealos_runtime_version_docker_123_test
https://github.com/labring/sealos/actions/runs/7237990534/job/19736079820?pr=4427

2023-12-18T08:48:46 debug apply apiserver_host_applier on host 10.1.0.12:22
2023-12-18T08:48:46 info domain apiserver.cluster.local:10.1.0.12 append success
2023-12-18T08:48:46 debug apply initializer on host 10.1.0.12:22
current system is ubuntu

gzip: stdin: not in gzip format
tar: Child returned status 1
tar: Error is not recoverable: exiting now
tar: This does not look like a tar archive

gzip: stdin: not in gzip format
tar: Child returned status 1
tar: Error is not recoverable: exiting now
chmod: missing operand after ‘a+x’
Try 'chmod --help' for more information.
Created symlink /etc/systemd/system/multi-user.target.wants/docker.service → /etc/systemd/system/docker.service.
Job for docker.service failed because the control process exited with error code.
See "systemctl status docker.service" and "journalctl -xe" for details.
Job for docker.service failed because the control process exited with error code.
See "systemctl status docker.service" and "journalctl -xe" for details.
 INFO [2023-12-18 08:48:46] >> Health check docker! 
 ERROR [2023-12-18 08:48:46] >> docker status is error 
 ERROR [2023-12-18 08:48:46] >> ====init docker failed!==== 
2023-12-18T08:48:46 error Applied to cluster error: exit status 1

log for E2E_sealos_runtime_version_docker_124_test
https://github.com/labring/sealos/actions/runs/7237990534/job/19736080031?pr=4427

2023-12-18T08:47:39 debug apply apiserver_host_applier on host 10.1.0.24:22
2023-12-18T08:47:39 info domain apiserver.cluster.local:10.1.0.24 append success
2023-12-18T08:47:39 debug apply initializer on host 10.1.0.24:22
current system is ubuntu
docker/docker
docker/docker-init
docker/dockerd
docker/runc
docker/ctr
docker/containerd-shim-runc-v2
docker/containerd
docker/docker-proxy
Created symlink /etc/systemd/system/multi-user.target.wants/docker.service → /etc/systemd/system/docker.service.
 INFO [2023-12-18 08:47:46] >> Health check docker! 
 INFO [2023-12-18 08:47:46] >> docker is running 
 INFO [2023-12-18 08:47:46] >> init docker success 

log for E2E_sealos_runtime_version_123_test
https://github.com/labring/sealos/actions/runs/7237990534/job/19736078510?pr=4427

2023-12-18T08:48:22 debug apply apiserver_host_applier on host 10.1.0.9:22
2023-12-18T08:48:22 info domain apiserver.cluster.local:10.1.0.9 append success
2023-12-18T08:48:22 debug apply initializer on host 10.1.0.9:22
Created symlink /etc/systemd/system/multi-user.target.wants/containerd.service → /etc/systemd/system/containerd.service.
 INFO [2023-12-18 08:48:24] >> Health check containerd! 
 INFO [2023-12-18 08:48:24] >> containerd is running 
 INFO [2023-12-18 08:48:24] >> init containerd success 

@bxy4543
Copy link
Member

bxy4543 commented Dec 19, 2023

@daymade
This has nothing to do with the pr, it is a problem in the image, which has now been fixed.
Thank you for your contribution!

@bxy4543 bxy4543 added this to the v5.0 milestone Dec 19, 2023
@cuisongliu cuisongliu merged commit 48f9c4b into labring:main Dec 19, 2023
83 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants