From cb6d774aa8f05e2caa4a9ba49d8fc5bc19f46b6f Mon Sep 17 00:00:00 2001 From: Nan Yu Date: Mon, 20 Nov 2023 22:07:10 +0000 Subject: [PATCH] Clarify the revision's default value in the API (#1051) --- manifests/reposync-crd.yaml | 10 ++++++++-- manifests/rootsync-crd.yaml | 10 ++++++++-- pkg/api/configsync/v1alpha1/gitconfig.go | 5 ++++- pkg/api/configsync/v1beta1/gitconfig.go | 5 ++++- 4 files changed, 24 insertions(+), 6 deletions(-) diff --git a/manifests/reposync-crd.yaml b/manifests/reposync-crd.yaml index eff993e41d..51c997997b 100644 --- a/manifests/reposync-crd.yaml +++ b/manifests/reposync-crd.yaml @@ -147,7 +147,10 @@ spec: type: string revision: description: revision is the git revision (branch, tag, ref or - commit) to fetch. Revision defaults to 'branch'. + commit) to fetch. If 'revision' is not specified, it defaults + to the HEAD of the branch that is specified in the 'branch' + field. If neither 'revision' nor 'branch' is specified, it defaults + to the HEAD of the 'master' branch. type: string secretRef: description: secretRef is the secret used to connect to the Git @@ -1191,7 +1194,10 @@ spec: type: string revision: description: revision is the git revision (branch, tag, ref or - commit) to fetch. Revision defaults to 'branch'. + commit) to fetch. If 'revision' is not specified, it defaults + to the HEAD of the branch that is specified in the 'branch' + field. If neither 'revision' nor 'branch' is specified, it defaults + to the HEAD of the 'master' branch. type: string secretRef: description: secretRef is the secret used to connect to the Git diff --git a/manifests/rootsync-crd.yaml b/manifests/rootsync-crd.yaml index 3b7cfb28d6..078bac99cb 100644 --- a/manifests/rootsync-crd.yaml +++ b/manifests/rootsync-crd.yaml @@ -147,7 +147,10 @@ spec: type: string revision: description: revision is the git revision (branch, tag, ref or - commit) to fetch. Revision defaults to 'branch'. + commit) to fetch. If 'revision' is not specified, it defaults + to the HEAD of the branch that is specified in the 'branch' + field. If neither 'revision' nor 'branch' is specified, it defaults + to the HEAD of the 'master' branch. type: string secretRef: description: secretRef is the secret used to connect to the Git @@ -1246,7 +1249,10 @@ spec: type: string revision: description: revision is the git revision (branch, tag, ref or - commit) to fetch. Revision defaults to 'branch'. + commit) to fetch. If 'revision' is not specified, it defaults + to the HEAD of the branch that is specified in the 'branch' + field. If neither 'revision' nor 'branch' is specified, it defaults + to the HEAD of the 'master' branch. type: string secretRef: description: secretRef is the secret used to connect to the Git diff --git a/pkg/api/configsync/v1alpha1/gitconfig.go b/pkg/api/configsync/v1alpha1/gitconfig.go index 6924b66229..947c0a3984 100644 --- a/pkg/api/configsync/v1alpha1/gitconfig.go +++ b/pkg/api/configsync/v1alpha1/gitconfig.go @@ -32,7 +32,10 @@ type Git struct { Branch string `json:"branch,omitempty"` // revision is the git revision (branch, tag, ref or commit) to fetch. - // Revision defaults to 'branch'. + // If 'revision' is not specified, it defaults to the HEAD of the branch that + // is specified in the 'branch' field. + // If neither 'revision' nor 'branch' is specified, it defaults to the HEAD of + // the 'master' branch. // +optional Revision string `json:"revision,omitempty"` diff --git a/pkg/api/configsync/v1beta1/gitconfig.go b/pkg/api/configsync/v1beta1/gitconfig.go index 7e0a40b701..1a0e57af37 100644 --- a/pkg/api/configsync/v1beta1/gitconfig.go +++ b/pkg/api/configsync/v1beta1/gitconfig.go @@ -32,7 +32,10 @@ type Git struct { Branch string `json:"branch,omitempty"` // revision is the git revision (branch, tag, ref or commit) to fetch. - // Revision defaults to 'branch'. + // If 'revision' is not specified, it defaults to the HEAD of the branch that + // is specified in the 'branch' field. + // If neither 'revision' nor 'branch' is specified, it defaults to the HEAD of + // the 'master' branch. // +optional Revision string `json:"revision,omitempty"`