神秘的yum相对路径不起作用

0 yum artifactory

我将https://packages.cloud.google.com/yum配置为Artifactory中的远程仓库.

我在Centos 7.3上的repo文件如下所示:

    [kubernetes]
    name=kubernetes
    baseurl=https://artifactory.company.com/artifactory/packages.cloud.google.com-yum/repos/kubernetes-el7-x86_64/
    enabled=1
    gpgcheck=1
Run Code Online (Sandbox Code Playgroud)

当我运行yum install -y kubelet它时会输出以下错误:

    e7a4403227dd24036f3b0615663a37 FAILED
    https://artifactory.company.com/artifactory/packages.cloud.google.com-yum/repos/kubernetes-el7-x86_64/../../pool/e7a4403227dd24036f3b0615663a371c4e07a95be5fee53505e647fd8ae58aa6-kubernetes-cni-0.5.1-0.x86_64.rpm: [Errno 14] HTTPS Error 500 - Internal Server Error
    Trying other mirror.
Run Code Online (Sandbox Code Playgroud)

我很确定问题是URL中的相对路径: kubernetes-el7-x86_64/../../pool

如果我忘记了URL,它工作正常,因为wget在发送HTTP请求之前解析了相对路径,但是yum没有这样做,当你给它一个url时,Artifactory返回500 ../.有谁知道如何在Artifactory中启用相对URL?或者如何在发送请求之前让yum解析URL?

我正在运行这些版本:

  • Artifactory 5.2.0
  • 百胜3.4.3-150

更新:这是来自神器的HTTP响应主体:

    {
      "errors" : [ {
        "status" : 500,
        "message" : "Could not process download request: Path element cannot end with a dot: packages.cloud.google.com-yum-cache/repos/kubernetes-el7-x86_64/../"
      } ]
    }
Run Code Online (Sandbox Code Playgroud)

小智 7

应在Artifactory https://packages.cloud.google.com/yum/中使用以下URL设置远程存储库

yum客户端上的baseurl应该指向repodata文件夹,其中包含以下内容:baseurl = http://artifactory.company.com/artifactory/yum-remote/repos/kubernetes-el7-x86_64/ (远程存储库的名称是'yum remote')

这应该在Artifactory方面没有任何进一步配置的情况下工作.

您提到的错误在相对路径'kubernetes-el7-x86_64 /../../ pool'中发生在工件的缓存期间.Artifactory无法缓存到包含".."模式的路径,因此请求失败.它可以通过用户插件从Artifactory端解决.如果路径包含'..'模式,那么插件将修改工件将缓存的路径,因此它不会包含此模式.现在这是多余的,因为注册表检索其中不包含".."的路径.