为什么克隆失败?找不到远程参考 "refs/heads/origin/master"

Why clone failed? couldn't find remote ref "refs/heads/origin/master"

我在本地克隆了podinfo(用于Flux实践)

* master
  remotes/origin/HEAD -> origin/master
  remotes/origin/gh-pages
  remotes/origin/master
  remotes/origin/v0.x
  remotes/origin/v1.x
  remotes/origin/v3.x
  remotes/origin/v5.x

随便

flux get sources git

显示

podinfo                     False       False   failed to checkout and determine revision: unable to clone 'https://github.com/dexterposh/podinfo': couldn't find remote ref "refs/heads/origin/master" 

我的podinfo.yaml

apiVersion: source.toolkit.fluxcd.io/v1beta1
kind: GitRepository
metadata:
 name: podinfo
 namespace: flux-system
spec:
 interval: 30s
 ref:
  branch: origin/master
 url: https://github.com/dexterposh/podinfo

为什么结帐失败?

您不需要将 origin 添加到分支参考。只需 branch: master 即可:

apiVersion: source.toolkit.fluxcd.io/v1beta1
kind: GitRepository
metadata:
 name: podinfo
 namespace: flux-system
spec:
 interval: 30s
 ref:
  branch: master
 url: https://github.com/dexterposh/podinfo