Fix default checkout options in Airshipctl config
`airshipctl config init` command, generates default Airshipctl config with mutually exclusive checkout options. This CR fixing config generation by setting the only branch. The `commitHash` and `tag` remain empty as an example in config file.. Change-Id: I12ec9b713e8f6769ddbd5301e000ab0242ea8ff4 Closes: #233
This commit is contained in:
parent
0d7dc4de24
commit
aab8325af5
@ -70,7 +70,7 @@ type RepoAuth struct {
|
||||
// Each field is mutually exclusive
|
||||
type RepoCheckout struct {
|
||||
// CommitHash is full hash of the commit that will be used to checkout
|
||||
CommitHash string `json:"commitHash,omitempty"`
|
||||
CommitHash string `json:"commitHash"`
|
||||
// Branch is the branch name to checkout
|
||||
Branch string `json:"branch"`
|
||||
// Tag is the tag name to checkout
|
||||
@ -79,7 +79,7 @@ type RepoCheckout struct {
|
||||
// RemoteRef is used for remote checkouts such as gerrit change requests/github pull request
|
||||
// for example refs/changes/04/691202/5
|
||||
// TODO Add support for fetching remote refs
|
||||
RemoteRef string `json:"remoteRef"`
|
||||
RemoteRef string `json:"remoteRef,omitempty"`
|
||||
// ForceCheckout is a boolean to indicate whether to use the `--force` option when checking out
|
||||
ForceCheckout bool `json:"force"`
|
||||
}
|
||||
|
2
pkg/config/testdata/config-string.yaml
vendored
2
pkg/config/testdata/config-string.yaml
vendored
@ -40,8 +40,8 @@ manifests:
|
||||
type: ssh-key
|
||||
checkout:
|
||||
branch: ""
|
||||
commitHash: ""
|
||||
force: false
|
||||
remoteRef: ""
|
||||
tag: v1.0.1
|
||||
url: http://dummy.url.com/manifests.git
|
||||
subPath: manifests/site/test-site
|
||||
|
2
pkg/config/testdata/manifest-string.yaml
vendored
2
pkg/config/testdata/manifest-string.yaml
vendored
@ -6,8 +6,8 @@ repositories:
|
||||
type: ssh-key
|
||||
checkout:
|
||||
branch: ""
|
||||
commitHash: ""
|
||||
force: false
|
||||
remoteRef: ""
|
||||
tag: v1.0.1
|
||||
url: http://dummy.url.com/manifests.git
|
||||
subPath: manifests/site/test-site
|
||||
|
@ -1,4 +1,4 @@
|
||||
branch: ""
|
||||
commitHash: ""
|
||||
force: false
|
||||
remoteRef: ""
|
||||
tag: v1.0.1
|
||||
|
2
pkg/config/testdata/repository-string.yaml
vendored
2
pkg/config/testdata/repository-string.yaml
vendored
@ -3,7 +3,7 @@ auth:
|
||||
type: ssh-key
|
||||
checkout:
|
||||
branch: ""
|
||||
commitHash: ""
|
||||
force: false
|
||||
remoteRef: ""
|
||||
tag: v1.0.1
|
||||
url: http://dummy.url.com/manifests.git
|
||||
|
@ -72,9 +72,7 @@ func NewConfig() *Config {
|
||||
DefaultTestPrimaryRepo: {
|
||||
URLString: AirshipDefaultManifestRepoLocation,
|
||||
CheckoutOptions: &RepoCheckout{
|
||||
CommitHash: "master",
|
||||
Branch: "master",
|
||||
RemoteRef: "master",
|
||||
Branch: "master",
|
||||
},
|
||||
},
|
||||
},
|
||||
|
Loading…
x
Reference in New Issue
Block a user