1.4.8.5. Git(Git)仓库频道
以下示例频道定义显示了 Git 仓库的频道示例。在以下示例中,secretRef 是指用于访问 pathname 中指定的 Git 仓库的用户身份。如果您有一个公共存储库,则不需要 secretRef 标签和值:
apiVersion: apps.open-cluster-management.io/v1
kind: Channel
metadata:
name: hive-cluster-gitrepo
namespace: gitops-cluster-lifecycle
spec:
type: Git
pathname: https://github.com/open-cluster-management/gitops-clusters.git
secretRef:
name: github-gitops-clusters
---
apiVersion: v1
kind: Secret
metadata:
name: github-gitops-clusters
namespace: gitops-cluster-lifecycle
data:
user: dXNlcgo= # Value of user and accessToken is Base 64 coded.
accessToken: cGFzc3dvcmQ