Fix for Lint warnings
* Adding comments for missing exported functions Change-Id: I40c5861a5c076b654e5a3fc660c3c9c6d7b80c8f Relates-To: #148
This commit is contained in:
parent
fd3118af19
commit
07f8a5e311
@ -387,29 +387,43 @@ func (c *Config) String() string {
|
|||||||
return string(yamlData)
|
return string(yamlData)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// ToYaml returns a YAML document
|
||||||
|
// It serializes the given Config object to a valid YAML document
|
||||||
func (c *Config) ToYaml() ([]byte, error) {
|
func (c *Config) ToYaml() ([]byte, error) {
|
||||||
return yaml.Marshal(&c)
|
return yaml.Marshal(&c)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// LoadedConfigPath returns the file path of airship config
|
||||||
|
// from where the current Config object is created
|
||||||
func (c *Config) LoadedConfigPath() string {
|
func (c *Config) LoadedConfigPath() string {
|
||||||
return c.loadedConfigPath
|
return c.loadedConfigPath
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// SetLoadedConfigPath updates the file path of airship config
|
||||||
|
// in the Config object
|
||||||
func (c *Config) SetLoadedConfigPath(lcp string) {
|
func (c *Config) SetLoadedConfigPath(lcp string) {
|
||||||
c.loadedConfigPath = lcp
|
c.loadedConfigPath = lcp
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// KubeConfigPath returns the file path of the kube config
|
||||||
|
// from Config object
|
||||||
func (c *Config) KubeConfigPath() string {
|
func (c *Config) KubeConfigPath() string {
|
||||||
return c.kubeConfigPath
|
return c.kubeConfigPath
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// SetKubeConfigPath updates the file path of the kubeconfig
|
||||||
|
// in Config object
|
||||||
func (c *Config) SetKubeConfigPath(kubeConfigPath string) {
|
func (c *Config) SetKubeConfigPath(kubeConfigPath string) {
|
||||||
c.kubeConfigPath = kubeConfigPath
|
c.kubeConfigPath = kubeConfigPath
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// KubeConfig returns kube config object from the
|
||||||
|
// context of current Config object
|
||||||
func (c *Config) KubeConfig() *clientcmdapi.Config {
|
func (c *Config) KubeConfig() *clientcmdapi.Config {
|
||||||
return c.kubeConfig
|
return c.kubeConfig
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// SetKubeConfig updates kube config in Config object
|
||||||
func (c *Config) SetKubeConfig(kubeConfig *clientcmdapi.Config) {
|
func (c *Config) SetKubeConfig(kubeConfig *clientcmdapi.Config) {
|
||||||
c.kubeConfig = kubeConfig
|
c.kubeConfig = kubeConfig
|
||||||
}
|
}
|
||||||
@ -428,6 +442,8 @@ func (c *Config) GetCluster(cName, cType string) (*Cluster, error) {
|
|||||||
return cluster, nil
|
return cluster, nil
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// AddCluster creates a new cluster and returns the
|
||||||
|
// newly created cluster object
|
||||||
func (c *Config) AddCluster(theCluster *ClusterOptions) (*Cluster, error) {
|
func (c *Config) AddCluster(theCluster *ClusterOptions) (*Cluster, error) {
|
||||||
// Need to create new cluster placeholder
|
// Need to create new cluster placeholder
|
||||||
// Get list of ClusterPurposes that match the theCluster.name
|
// Get list of ClusterPurposes that match the theCluster.name
|
||||||
@ -452,6 +468,7 @@ func (c *Config) AddCluster(theCluster *ClusterOptions) (*Cluster, error) {
|
|||||||
return c.ModifyCluster(nCluster, theCluster)
|
return c.ModifyCluster(nCluster, theCluster)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// ModifyCluster updates cluster object with given cluster options
|
||||||
func (c *Config) ModifyCluster(cluster *Cluster, theCluster *ClusterOptions) (*Cluster, error) {
|
func (c *Config) ModifyCluster(cluster *Cluster, theCluster *ClusterOptions) (*Cluster, error) {
|
||||||
kcluster := cluster.KubeCluster()
|
kcluster := cluster.KubeCluster()
|
||||||
if kcluster == nil {
|
if kcluster == nil {
|
||||||
@ -542,6 +559,8 @@ func (c *Config) GetContexts() []*Context {
|
|||||||
return contexts
|
return contexts
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// AddContext creates a new context and returns the instance of
|
||||||
|
// newly created context
|
||||||
func (c *Config) AddContext(theContext *ContextOptions) *Context {
|
func (c *Config) AddContext(theContext *ContextOptions) *Context {
|
||||||
// Create the new Airship config context
|
// Create the new Airship config context
|
||||||
nContext := NewContext()
|
nContext := NewContext()
|
||||||
@ -559,6 +578,7 @@ func (c *Config) AddContext(theContext *ContextOptions) *Context {
|
|||||||
return nContext
|
return nContext
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// ModifyContext updates Context object with given given context options
|
||||||
func (c *Config) ModifyContext(context *Context, theContext *ContextOptions) {
|
func (c *Config) ModifyContext(context *Context, theContext *ContextOptions) {
|
||||||
kubeContext := context.KubeContext()
|
kubeContext := context.KubeContext()
|
||||||
if kubeContext == nil {
|
if kubeContext == nil {
|
||||||
@ -596,6 +616,8 @@ func (c *Config) GetCurrentContext() (*Context, error) {
|
|||||||
}
|
}
|
||||||
return currentContext, nil
|
return currentContext, nil
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// CurrentContextCluster returns the Cluster for the current context
|
||||||
func (c *Config) CurrentContextCluster() (*Cluster, error) {
|
func (c *Config) CurrentContextCluster() (*Cluster, error) {
|
||||||
currentContext, err := c.GetCurrentContext()
|
currentContext, err := c.GetCurrentContext()
|
||||||
if err != nil {
|
if err != nil {
|
||||||
@ -606,6 +628,7 @@ func (c *Config) CurrentContextCluster() (*Cluster, error) {
|
|||||||
return c.Clusters[clusterName.Name].ClusterTypes[currentContext.ClusterType()], nil
|
return c.Clusters[clusterName.Name].ClusterTypes[currentContext.ClusterType()], nil
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// CurrentContextAuthInfo returns the AuthInfo for the current context
|
||||||
func (c *Config) CurrentContextAuthInfo() (*AuthInfo, error) {
|
func (c *Config) CurrentContextAuthInfo() (*AuthInfo, error) {
|
||||||
currentContext, err := c.GetCurrentContext()
|
currentContext, err := c.GetCurrentContext()
|
||||||
if err != nil {
|
if err != nil {
|
||||||
@ -614,6 +637,8 @@ func (c *Config) CurrentContextAuthInfo() (*AuthInfo, error) {
|
|||||||
|
|
||||||
return c.AuthInfos[currentContext.KubeContext().AuthInfo], nil
|
return c.AuthInfos[currentContext.KubeContext().AuthInfo], nil
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// CurrentContextManifest returns the manifest for the current context
|
||||||
func (c *Config) CurrentContextManifest() (*Manifest, error) {
|
func (c *Config) CurrentContextManifest() (*Manifest, error) {
|
||||||
currentContext, err := c.GetCurrentContext()
|
currentContext, err := c.GetCurrentContext()
|
||||||
if err != nil {
|
if err != nil {
|
||||||
@ -687,6 +712,8 @@ func (c *Config) GetAuthInfos() []*AuthInfo {
|
|||||||
return authInfos
|
return authInfos
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// AddAuthInfo creates new AuthInfo with context details updated
|
||||||
|
// in the airship config and kube config
|
||||||
func (c *Config) AddAuthInfo(theAuthInfo *AuthInfoOptions) *AuthInfo {
|
func (c *Config) AddAuthInfo(theAuthInfo *AuthInfoOptions) *AuthInfo {
|
||||||
// Create the new Airship config context
|
// Create the new Airship config context
|
||||||
nAuthInfo := NewAuthInfo()
|
nAuthInfo := NewAuthInfo()
|
||||||
@ -700,6 +727,7 @@ func (c *Config) AddAuthInfo(theAuthInfo *AuthInfoOptions) *AuthInfo {
|
|||||||
return nAuthInfo
|
return nAuthInfo
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// ModifyAuthInfo updates the AuthInfo in the Config object
|
||||||
func (c *Config) ModifyAuthInfo(authinfo *AuthInfo, theAuthInfo *AuthInfoOptions) {
|
func (c *Config) ModifyAuthInfo(authinfo *AuthInfo, theAuthInfo *AuthInfoOptions) {
|
||||||
kubeAuthInfo := authinfo.KubeAuthInfo()
|
kubeAuthInfo := authinfo.KubeAuthInfo()
|
||||||
if kubeAuthInfo == nil {
|
if kubeAuthInfo == nil {
|
||||||
@ -768,7 +796,6 @@ func (c *Config) Purge() error {
|
|||||||
return os.Remove(c.loadedConfigPath)
|
return os.Remove(c.loadedConfigPath)
|
||||||
}
|
}
|
||||||
|
|
||||||
// Context functions
|
|
||||||
func (c *Context) String() string {
|
func (c *Context) String() string {
|
||||||
cyaml, err := yaml.Marshal(&c)
|
cyaml, err := yaml.Marshal(&c)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
@ -782,19 +809,24 @@ func (c *Context) String() string {
|
|||||||
return fmt.Sprintf("%s\n%s", string(cyaml), string(kyaml))
|
return fmt.Sprintf("%s\n%s", string(cyaml), string(kyaml))
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// PrettyString returns cluster name in a formatted string
|
||||||
func (c *Context) PrettyString() string {
|
func (c *Context) PrettyString() string {
|
||||||
clusterName := NewClusterComplexNameFromKubeClusterName(c.NameInKubeconf)
|
clusterName := NewClusterComplexNameFromKubeClusterName(c.NameInKubeconf)
|
||||||
return fmt.Sprintf("Context: %s\n%s\n", clusterName.Name, c)
|
return fmt.Sprintf("Context: %s\n%s\n", clusterName.Name, c)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// KubeContext returns kube context object
|
||||||
func (c *Context) KubeContext() *clientcmdapi.Context {
|
func (c *Context) KubeContext() *clientcmdapi.Context {
|
||||||
return c.context
|
return c.context
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// SetKubeContext updates kube contect with given context details
|
||||||
func (c *Context) SetKubeContext(kc *clientcmdapi.Context) {
|
func (c *Context) SetKubeContext(kc *clientcmdapi.Context) {
|
||||||
c.context = kc
|
c.context = kc
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// ClusterType returns cluster type by extracting the type portion from
|
||||||
|
// the complex cluster name
|
||||||
func (c *Context) ClusterType() string {
|
func (c *Context) ClusterType() string {
|
||||||
return NewClusterComplexNameFromKubeClusterName(c.NameInKubeconf).Type
|
return NewClusterComplexNameFromKubeClusterName(c.NameInKubeconf).Type
|
||||||
}
|
}
|
||||||
@ -803,7 +835,6 @@ func (c *Context) ClusterName() string {
|
|||||||
return NewClusterComplexNameFromKubeClusterName(c.NameInKubeconf).Name
|
return NewClusterComplexNameFromKubeClusterName(c.NameInKubeconf).Name
|
||||||
}
|
}
|
||||||
|
|
||||||
// Manifest functions
|
|
||||||
func (m *Manifest) String() string {
|
func (m *Manifest) String() string {
|
||||||
yamlData, err := yaml.Marshal(&m)
|
yamlData, err := yaml.Marshal(&m)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
@ -830,7 +861,7 @@ func (m *ManagementConfiguration) String() string {
|
|||||||
return string(yamlData)
|
return string(yamlData)
|
||||||
}
|
}
|
||||||
|
|
||||||
// Container functions
|
// String returns Container object in a serialized string format
|
||||||
func (c *Container) String() string {
|
func (c *Container) String() string {
|
||||||
yamlData, err := yaml.Marshal(&c)
|
yamlData, err := yaml.Marshal(&c)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
@ -839,7 +870,7 @@ func (c *Container) String() string {
|
|||||||
return string(yamlData)
|
return string(yamlData)
|
||||||
}
|
}
|
||||||
|
|
||||||
// Builder functions
|
// String returns Builder object in a serialized string format
|
||||||
func (b *Builder) String() string {
|
func (b *Builder) String() string {
|
||||||
yamlData, err := yaml.Marshal(&b)
|
yamlData, err := yaml.Marshal(&b)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
|
@ -24,6 +24,8 @@ import (
|
|||||||
"os"
|
"os"
|
||||||
)
|
)
|
||||||
|
|
||||||
|
// AuthInfoOptions holds all configurable options for
|
||||||
|
// authentication information or credential
|
||||||
type AuthInfoOptions struct {
|
type AuthInfoOptions struct {
|
||||||
Name string
|
Name string
|
||||||
ClientCertificate string
|
ClientCertificate string
|
||||||
@ -34,6 +36,7 @@ type AuthInfoOptions struct {
|
|||||||
EmbedCertData bool
|
EmbedCertData bool
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// ContextOptions holds all configurable options for context
|
||||||
type ContextOptions struct {
|
type ContextOptions struct {
|
||||||
Name string
|
Name string
|
||||||
ClusterType string
|
ClusterType string
|
||||||
@ -45,6 +48,7 @@ type ContextOptions struct {
|
|||||||
Current bool
|
Current bool
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// ClusterOptions holds all configurable options for cluster configuration
|
||||||
type ClusterOptions struct {
|
type ClusterOptions struct {
|
||||||
Name string
|
Name string
|
||||||
ClusterType string
|
ClusterType string
|
||||||
@ -54,6 +58,9 @@ type ClusterOptions struct {
|
|||||||
EmbedCAData bool
|
EmbedCAData bool
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// Validate checks for the possible authentication values and returns
|
||||||
|
// Error when invalid value or incompatible choice of values given
|
||||||
|
|
||||||
// TODO(howell): The following functions are tightly coupled with flags passed
|
// TODO(howell): The following functions are tightly coupled with flags passed
|
||||||
// on the command line. We should find a way to remove this coupling, since it
|
// on the command line. We should find a way to remove this coupling, since it
|
||||||
// is possible to create (and validate) these objects without using the command
|
// is possible to create (and validate) these objects without using the command
|
||||||
@ -87,6 +94,8 @@ func (o *AuthInfoOptions) Validate() error {
|
|||||||
return nil
|
return nil
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// Validate checks for the possible context option values and returns
|
||||||
|
// Error when invalid value or incompatible choice of values given
|
||||||
func (o *ContextOptions) Validate() error {
|
func (o *ContextOptions) Validate() error {
|
||||||
if !o.Current && o.Name == "" {
|
if !o.Current && o.Name == "" {
|
||||||
return errors.New("you must specify a non-empty context name")
|
return errors.New("you must specify a non-empty context name")
|
||||||
@ -112,6 +121,8 @@ func (o *ContextOptions) Validate() error {
|
|||||||
return nil
|
return nil
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// Validate checks for the possible cluster option values and returns
|
||||||
|
// Error when invalid value or incompatible choice of values given
|
||||||
func (o *ClusterOptions) Validate() error {
|
func (o *ClusterOptions) Validate() error {
|
||||||
if o.Name == "" {
|
if o.Name == "" {
|
||||||
return errors.New("you must specify a non-empty cluster name")
|
return errors.New("you must specify a non-empty cluster name")
|
||||||
|
@ -27,6 +27,7 @@ import (
|
|||||||
"opendev.org/airship/airshipctl/pkg/errors"
|
"opendev.org/airship/airshipctl/pkg/errors"
|
||||||
)
|
)
|
||||||
|
|
||||||
|
// Constants for possible repo authentication types
|
||||||
const (
|
const (
|
||||||
SSHAuth = "ssh-key"
|
SSHAuth = "ssh-key"
|
||||||
SSHPass = "ssh-pass"
|
SSHPass = "ssh-pass"
|
||||||
@ -43,6 +44,9 @@ func (c *RepoCheckout) String() string {
|
|||||||
return string(yaml)
|
return string(yaml)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// Validate checks for possible values for
|
||||||
|
// repository checkout and returns Error for incorrect values
|
||||||
|
// returns nil when there are no errors
|
||||||
func (c *RepoCheckout) Validate() error {
|
func (c *RepoCheckout) Validate() error {
|
||||||
possibleValues := []string{c.CommitHash, c.Branch, c.Tag, c.RemoteRef}
|
possibleValues := []string{c.CommitHash, c.Branch, c.Tag, c.RemoteRef}
|
||||||
var count int
|
var count int
|
||||||
@ -65,6 +69,7 @@ var (
|
|||||||
AllowedAuthTypes = []string{SSHAuth, SSHPass, HTTPBasic}
|
AllowedAuthTypes = []string{SSHAuth, SSHPass, HTTPBasic}
|
||||||
)
|
)
|
||||||
|
|
||||||
|
// String returns repository authentication details in string format
|
||||||
func (auth *RepoAuth) String() string {
|
func (auth *RepoAuth) String() string {
|
||||||
yaml, err := yaml.Marshal(&auth)
|
yaml, err := yaml.Marshal(&auth)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
@ -73,6 +78,9 @@ func (auth *RepoAuth) String() string {
|
|||||||
return string(yaml)
|
return string(yaml)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// Validate checks for possible values for
|
||||||
|
// repository authentication and returns Error for incorrect values
|
||||||
|
// returns nil when there are no errors
|
||||||
func (auth *RepoAuth) Validate() error {
|
func (auth *RepoAuth) Validate() error {
|
||||||
if !stringInSlice(auth.Type, AllowedAuthTypes) {
|
if !stringInSlice(auth.Type, AllowedAuthTypes) {
|
||||||
return ErrAuthTypeNotSupported{}
|
return ErrAuthTypeNotSupported{}
|
||||||
@ -104,8 +112,7 @@ func stringInSlice(a string, list []string) bool {
|
|||||||
return false
|
return false
|
||||||
}
|
}
|
||||||
|
|
||||||
// Repository functions
|
// String returns repository details in a string format
|
||||||
|
|
||||||
func (repo *Repository) String() string {
|
func (repo *Repository) String() string {
|
||||||
yaml, err := yaml.Marshal(&repo)
|
yaml, err := yaml.Marshal(&repo)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
@ -114,6 +121,9 @@ func (repo *Repository) String() string {
|
|||||||
return string(yaml)
|
return string(yaml)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// Validate check possible values for repository and
|
||||||
|
// returns Error when incorrect value is given
|
||||||
|
// retruns nill when there are no errors
|
||||||
func (repo *Repository) Validate() error {
|
func (repo *Repository) Validate() error {
|
||||||
if repo.URLString == "" {
|
if repo.URLString == "" {
|
||||||
return ErrRepoSpecRequiresURL{}
|
return ErrRepoSpecRequiresURL{}
|
||||||
@ -136,6 +146,8 @@ func (repo *Repository) Validate() error {
|
|||||||
return nil
|
return nil
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// ToAuth returns an implementation of transport.AuthMethod for
|
||||||
|
// the given auth type to establish an ssh connection
|
||||||
func (repo *Repository) ToAuth() (transport.AuthMethod, error) {
|
func (repo *Repository) ToAuth() (transport.AuthMethod, error) {
|
||||||
if repo.Auth == nil {
|
if repo.Auth == nil {
|
||||||
return nil, nil
|
return nil, nil
|
||||||
@ -152,6 +164,9 @@ func (repo *Repository) ToAuth() (transport.AuthMethod, error) {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// ToCheckoutOptions returns an instance of git.CheckoutOptions with
|
||||||
|
// respective values(Branch/Tag/Hash) in checkout options initialized
|
||||||
|
// CheckoutOptions describes how a checkout operation should be performed
|
||||||
func (repo *Repository) ToCheckoutOptions(force bool) *git.CheckoutOptions {
|
func (repo *Repository) ToCheckoutOptions(force bool) *git.CheckoutOptions {
|
||||||
co := &git.CheckoutOptions{
|
co := &git.CheckoutOptions{
|
||||||
Force: force,
|
Force: force,
|
||||||
@ -168,6 +183,9 @@ func (repo *Repository) ToCheckoutOptions(force bool) *git.CheckoutOptions {
|
|||||||
return co
|
return co
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// ToCloneOptions returns an instance of git.CloneOptions with
|
||||||
|
// authentication and URL set
|
||||||
|
// CloneOptions describes how a clone should be performed
|
||||||
func (repo *Repository) ToCloneOptions(auth transport.AuthMethod) *git.CloneOptions {
|
func (repo *Repository) ToCloneOptions(auth transport.AuthMethod) *git.CloneOptions {
|
||||||
return &git.CloneOptions{
|
return &git.CloneOptions{
|
||||||
Auth: auth,
|
Auth: auth,
|
||||||
@ -175,10 +193,13 @@ func (repo *Repository) ToCloneOptions(auth transport.AuthMethod) *git.CloneOpti
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// ToFetchOptions returns an instance of git.FetchOptions for given authentication
|
||||||
|
// FetchOptions describes how a fetch should be performed
|
||||||
func (repo *Repository) ToFetchOptions(auth transport.AuthMethod) *git.FetchOptions {
|
func (repo *Repository) ToFetchOptions(auth transport.AuthMethod) *git.FetchOptions {
|
||||||
return &git.FetchOptions{Auth: auth}
|
return &git.FetchOptions{Auth: auth}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// URL returns the repository URL in a string format
|
||||||
func (repo *Repository) URL() string {
|
func (repo *Repository) URL() string {
|
||||||
return repo.URLString
|
return repo.URLString
|
||||||
}
|
}
|
||||||
|
@ -21,6 +21,7 @@ import (
|
|||||||
)
|
)
|
||||||
|
|
||||||
const (
|
const (
|
||||||
|
// DefaultTestPrimaryRepo holds default repo name
|
||||||
DefaultTestPrimaryRepo = "primary"
|
DefaultTestPrimaryRepo = "primary"
|
||||||
)
|
)
|
||||||
|
|
||||||
@ -100,10 +101,12 @@ func NewManifest() *Manifest {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// NewRepository is a convenience function that returns a new Repository
|
||||||
func NewRepository() *Repository {
|
func NewRepository() *Repository {
|
||||||
return &Repository{}
|
return &Repository{}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// NewAuthInfo is a convenience function that returns a new AuthInfo
|
||||||
func NewAuthInfo() *AuthInfo {
|
func NewAuthInfo() *AuthInfo {
|
||||||
return &AuthInfo{}
|
return &AuthInfo{}
|
||||||
}
|
}
|
||||||
|
@ -206,6 +206,7 @@ func (c *DockerContainer) getImageID(url string) (string, error) {
|
|||||||
return img[0].ID, nil
|
return img[0].ID, nil
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// GetID returns ID of the container
|
||||||
func (c *DockerContainer) GetID() string {
|
func (c *DockerContainer) GetID() string {
|
||||||
return c.id
|
return c.id
|
||||||
}
|
}
|
||||||
|
@ -19,10 +19,13 @@ import (
|
|||||||
"opendev.org/airship/airshipctl/pkg/environment"
|
"opendev.org/airship/airshipctl/pkg/environment"
|
||||||
)
|
)
|
||||||
|
|
||||||
|
// Settings is a reference to environment.AirshipCTLSettings
|
||||||
|
// AirshipCTLSettings is a container for all of the settings needed by airshipctl
|
||||||
type Settings struct {
|
type Settings struct {
|
||||||
*environment.AirshipCTLSettings
|
*environment.AirshipCTLSettings
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// Pull clones repositories
|
||||||
func (s *Settings) Pull() error {
|
func (s *Settings) Pull() error {
|
||||||
err := s.cloneRepositories()
|
err := s.cloneRepositories()
|
||||||
if err != nil {
|
if err != nil {
|
||||||
|
Loading…
x
Reference in New Issue
Block a user