b57c1a2d15
Client interface currently has only one Init method. Also add a constructor for the Client which is based on resource defined in clusterctl/api package and a filesystem root to construct bundle for repository interface. Root is expected to be derived from the airshipctl settings document manifest.target-path Factory functions allow to insert custom repository interface into clusterctl client Relates-To: #170 Change-Id: Ib27e73043b4776001f405d2d4e96016735c6f46e
39 lines
1.1 KiB
Go
39 lines
1.1 KiB
Go
/*
|
|
Licensed under the Apache License, Version 2.0 (the "License");
|
|
you may not use this file except in compliance with the License.
|
|
You may obtain a copy of the License at
|
|
|
|
https://www.apache.org/licenses/LICENSE-2.0
|
|
|
|
Unless required by applicable law or agreed to in writing, software
|
|
distributed under the License is distributed on an "AS IS" BASIS,
|
|
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
See the License for the specific language governing permissions and
|
|
limitations under the License.
|
|
*/
|
|
|
|
package client
|
|
|
|
import (
|
|
"fmt"
|
|
)
|
|
|
|
// ErrProviderNotDefined is returned when wrong AuthType is provided
|
|
type ErrProviderNotDefined struct {
|
|
ProviderName string
|
|
}
|
|
|
|
func (e ErrProviderNotDefined) Error() string {
|
|
return fmt.Sprintf("provider %s is not defined in Clusterctl document", e.ProviderName)
|
|
}
|
|
|
|
// ErrProviderRepoNotFound is returned when wrong AuthType is provided
|
|
type ErrProviderRepoNotFound struct {
|
|
ProviderName string
|
|
ProviderType string
|
|
}
|
|
|
|
func (e ErrProviderRepoNotFound) Error() string {
|
|
return fmt.Sprintf("failed to find repository for provider %s of type %s", e.ProviderName, e.ProviderType)
|
|
}
|