Dragonfly2 icon indicating copy to clipboard operation
Dragonfly2 copied to clipboard

仓库注入为http加ip时生成的cert.d文件名字错误

Open NatureLR opened this issue 2 years ago • 4 comments

类似这种

containerRuntime:
  containerd:
    enable: true
    injectConfigPath: true
    registries:
      - 'https://ghcr.io'
      - 'http://192.168.1.1'

/etc/containerd/certs.d/生成的目录名字为http而不是192.168.1.1

应该是下面的命令未正确的提取http://之后的内容导致

domain=$(echo $registry | sed -e "s,http.://,," | sed "s,:.*,,")

测试

registry=http://192.168.1.1
echo $registry | sed -e "s,http.://,," | sed "s,:.*,," 
  • 修改
echo $registry | awk -F '//' '{printf$2}'
# 或
echo $registry | sed -e "s,http.*://,," | sed "s,:.*,,"

NatureLR avatar Jul 10 '23 06:07 NatureLR

Could you please submit a PR to fix this issue ?

hyy0322 avatar Jul 11 '23 03:07 hyy0322

您能提交 PR 来解决这个问题吗?

ok

NatureLR avatar Jul 11 '23 03:07 NatureLR

@NatureLR Thx

gaius-qi avatar Jul 14 '23 06:07 gaius-qi

Seems the same issue also needs to be fixed in v1? @gaius-qi @hyy0322 code

cheriL avatar Jul 20 '23 08:07 cheriL