diff --git a/pkg/config/context.go b/pkg/config/context.go index cd31a655e..2d916e0dd 100644 --- a/pkg/config/context.go +++ b/pkg/config/context.go @@ -26,7 +26,7 @@ import ( // Context is a tuple of references to a cluster (how do I communicate with a kubernetes context), // a user (how do I identify myself), and a namespace (what subset of resources do I want to work with) type Context struct { - // Context name in kubeconf + // NameInKubeconf is the Context name in kubeconf NameInKubeconf string `json:"contextKubeconf"` // Manifest is the default manifest to be use with this context diff --git a/pkg/config/manifest.go b/pkg/config/manifest.go index d9370cf1b..2ada983b5 100644 --- a/pkg/config/manifest.go +++ b/pkg/config/manifest.go @@ -39,53 +39,6 @@ type Manifest struct { MetadataPath string `json:"metadataPath"` } -// Repository is a tuple that holds the information for the remote sources of manifest yaml documents. -// Information such as location, authentication info, -// as well as details of what to get such as branch, tag, commit it, etc. -type Repository struct { - // URLString for Repository - URLString string `json:"url"` - // Auth holds authentication options against remote - Auth *RepoAuth `json:"auth,omitempty"` - // CheckoutOptions holds options to checkout repository - CheckoutOptions *RepoCheckout `json:"checkout,omitempty"` -} - -// RepoAuth struct describes method of authentication against given repository -type RepoAuth struct { - // Type of authentication method to be used with given repository - // supported types are "ssh-key", "ssh-pass", "http-basic" - Type string `json:"type,omitempty"` - //KeyPassword is a password decrypt ssh private key (used with ssh-key auth type) - KeyPassword string `json:"keyPass,omitempty"` - // KeyPath is path to private ssh key on disk (used with ssh-key auth type) - KeyPath string `json:"sshKey,omitempty"` - //HTTPPassword is password for basic http authentication (used with http-basic auth type) - HTTPPassword string `json:"httpPass,omitempty"` - // SSHPassword is password for ssh password authentication (used with ssh-pass) - SSHPassword string `json:"sshPass,omitempty"` - // Username to authenticate against git remote (used with any type) - Username string `json:"username,omitempty"` -} - -// RepoCheckout container holds information how to checkout repository -// 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"` - // Branch is the branch name to checkout - Branch string `json:"branch"` - // Tag is the tag name to checkout - Tag string `json:"tag"` - // RemoteRef is not supported currently TODO - // 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,omitempty"` - // ForceCheckout is a boolean to indicate whether to use the `--force` option when checking out - ForceCheckout bool `json:"force"` -} - // Metadata holds entrypoints for phases, inventory and clusterctl type Metadata struct { Inventory *InventoryMeta `json:"inventory,omitempty"` diff --git a/pkg/config/repo.go b/pkg/config/repo.go index 35415f2e9..5bc9ec9d9 100644 --- a/pkg/config/repo.go +++ b/pkg/config/repo.go @@ -35,6 +35,53 @@ const ( HTTPBasic = "http-basic" ) +// Repository struct holds the information for the remote sources of manifest yaml documents. +// Information such as location, authentication info, +// as well as details of what to get such as branch, tag, commit it, etc. +type Repository struct { + // URLString for Repository + URLString string `json:"url"` + // Auth holds authentication options against remote + Auth *RepoAuth `json:"auth,omitempty"` + // CheckoutOptions holds options to checkout repository + CheckoutOptions *RepoCheckout `json:"checkout,omitempty"` +} + +// RepoAuth struct describes method of authentication against given repository +type RepoAuth struct { + // Type of authentication method to be used with given repository + // supported types are "ssh-key", "ssh-pass", "http-basic" + Type string `json:"type,omitempty"` + //KeyPassword is a password decrypt ssh private key (used with ssh-key auth type) + KeyPassword string `json:"keyPass,omitempty"` + // KeyPath is path to private ssh key on disk (used with ssh-key auth type) + KeyPath string `json:"sshKey,omitempty"` + //HTTPPassword is password for basic http authentication (used with http-basic auth type) + HTTPPassword string `json:"httpPass,omitempty"` + // SSHPassword is password for ssh password authentication (used with ssh-pass) + SSHPassword string `json:"sshPass,omitempty"` + // Username to authenticate against git remote (used with any type) + Username string `json:"username,omitempty"` +} + +// RepoCheckout container holds information how to checkout repository +// 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"` + // Branch is the branch name to checkout + Branch string `json:"branch"` + // Tag is the tag name to checkout + Tag string `json:"tag"` + // RemoteRef is not supported currently TODO + // 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,omitempty"` + // ForceCheckout is a boolean to indicate whether to use the `--force` option when checking out + ForceCheckout bool `json:"force"` +} + // RepoCheckout methods func (c *RepoCheckout) String() string { diff --git a/pkg/document/plugin/replacement/v1alpha1/errors.go b/pkg/document/plugin/replacement/v1alpha1/errors.go index 5e433d4fe..eda3cf641 100644 --- a/pkg/document/plugin/replacement/v1alpha1/errors.go +++ b/pkg/document/plugin/replacement/v1alpha1/errors.go @@ -26,6 +26,7 @@ import ( // is raised if JSON path element points to a wrong data structure e.g. // JSON path 'a.b[x=y]c' considers that there is a list of maps under key 'b' // therefore ErrTypeMismatch will be returned for following structure +// // a: // b: // - 'some string'