Documentation ¶
Index ¶
- Constants
- Variables
- func KubeappsSecretNameForRepo(repoName, namespace string) string
- func NewClusterConfig(inClusterConfig *rest.Config, token string, cluster string, ...) (*rest.Config, error)
- type AdditionalClusterConfig
- type AdditionalClustersConfig
- type AuthHandler
- type FakeHandler
- func (c *FakeHandler) AsSVC() handler
- func (c *FakeHandler) AsUser(token, cluster string) (handler, error)
- func (c *FakeHandler) CreateAppRepository(appRepoBody io.ReadCloser, requestNamespace string) (*v1alpha1.AppRepository, error)
- func (c *FakeHandler) DeleteAppRepository(name, namespace string) error
- func (c *FakeHandler) GetAppRepository(name, namespace string) (*v1alpha1.AppRepository, error)
- func (c *FakeHandler) GetNamespaces() ([]corev1.Namespace, error)
- func (c *FakeHandler) GetOperatorLogo(namespace, name string) ([]byte, error)
- func (c *FakeHandler) GetSecret(name, namespace string) (*corev1.Secret, error)
- func (c *FakeHandler) ListAppRepositories(requestNamespace string) (*v1alpha1.AppRepositoryList, error)
- func (c *FakeHandler) UpdateAppRepository(appRepoBody io.ReadCloser, requestNamespace string) (*v1alpha1.AppRepository, error)
- func (c *FakeHandler) ValidateAppRepository(appRepoBody io.ReadCloser, requestNamespace string) (*ValidationResponse, error)
- type HTTPClient
- type ValidationResponse
Constants ¶
const (
// DefaultClusterName is the string used to identify the internal cluster.
DefaultClusterName = "default"
)
Variables ¶
var ErrGlobalRepositoryWithSecrets = fmt.Errorf("docker registry secrets cannot be set for app repositories available in all namespaces")
ErrGlobalRepositoryWithSecrets defines the error returned when an attempt is made to create registry secrets for a global repo.
Functions ¶
func KubeappsSecretNameForRepo ¶
KubeappsSecretNameForRepo returns a name suitable for recording a copy of a per-namespace repository secret in the kubeapps namespace.
func NewClusterConfig ¶ added in v1.10.2
func NewClusterConfig(inClusterConfig *rest.Config, token string, cluster string, additionalClusters AdditionalClustersConfig) (*rest.Config, error)
NewClusterConfig returns a copy of an in-cluster config with a custom token and/or custom cluster host
Types ¶
type AdditionalClusterConfig ¶ added in v1.10.2
type AdditionalClusterConfig struct { Name string `json:"name"` APIServiceURL string `json:"apiServiceURL"` CertificateAuthorityData string `json:"certificateAuthorityData,omitempty"` // The genericclioptions.ConfigFlags struct includes only a CAFile field, not // a CAData field. // https://github.com/kubernetes/cli-runtime/issues/8 // Embedding genericclioptions.ConfigFlags in a struct which includes the actual rest.Config // and returning that for ToRESTConfig() isn't enough, so we each configured cert out and // include a CAFile field in the config. CAFile string // ServiceToken can be configured so that the Kubeapps application itself // has access to get all namespaces on additional clusters, for example. It // should *not* be for reading secrets or similar, but limited to the // required functionality. ServiceToken string Insecure bool `json:"insecure"` }
AdditionalClusterConfig contains required info to talk to additional clusters.
type AdditionalClustersConfig ¶ added in v1.10.2
type AdditionalClustersConfig map[string]AdditionalClusterConfig
AdditionalClustersConfig is an alias for a map of additional cluster configs.
type AuthHandler ¶
AuthHandler exposes Handler functionality as a user or the current serviceaccount
func NewHandler ¶
func NewHandler(kubeappsNamespace string, additionalClusters AdditionalClustersConfig) (AuthHandler, error)
NewHandler returns a handler configured with a service account client set and a config with a blank token to be copied when creating user client sets with specific tokens.
type FakeHandler ¶
type FakeHandler struct { AppRepos []*v1alpha1.AppRepository CreatedRepo *v1alpha1.AppRepository UpdatedRepo *v1alpha1.AppRepository Namespaces []corev1.Namespace Secrets []*corev1.Secret ValRes *ValidationResponse Err error }
FakeHandler represents a fake Handler for testing purposes
func (*FakeHandler) AsSVC ¶
func (c *FakeHandler) AsSVC() handler
AsSVC fakes using current svcaccount
func (*FakeHandler) AsUser ¶
func (c *FakeHandler) AsUser(token, cluster string) (handler, error)
AsUser fakes user auth
func (*FakeHandler) CreateAppRepository ¶
func (c *FakeHandler) CreateAppRepository(appRepoBody io.ReadCloser, requestNamespace string) (*v1alpha1.AppRepository, error)
CreateAppRepository fake
func (*FakeHandler) DeleteAppRepository ¶
func (c *FakeHandler) DeleteAppRepository(name, namespace string) error
DeleteAppRepository fake
func (*FakeHandler) GetAppRepository ¶
func (c *FakeHandler) GetAppRepository(name, namespace string) (*v1alpha1.AppRepository, error)
GetAppRepository fake
func (*FakeHandler) GetNamespaces ¶
func (c *FakeHandler) GetNamespaces() ([]corev1.Namespace, error)
GetNamespaces fake
func (*FakeHandler) GetOperatorLogo ¶ added in v1.9.0
func (c *FakeHandler) GetOperatorLogo(namespace, name string) ([]byte, error)
GetOperatorLogo fake
func (*FakeHandler) GetSecret ¶
func (c *FakeHandler) GetSecret(name, namespace string) (*corev1.Secret, error)
GetSecret fake
func (*FakeHandler) ListAppRepositories ¶ added in v1.11.2
func (c *FakeHandler) ListAppRepositories(requestNamespace string) (*v1alpha1.AppRepositoryList, error)
ListAppRepositories fake
func (*FakeHandler) UpdateAppRepository ¶ added in v1.10.1
func (c *FakeHandler) UpdateAppRepository(appRepoBody io.ReadCloser, requestNamespace string) (*v1alpha1.AppRepository, error)
UpdateAppRepository fake
func (*FakeHandler) ValidateAppRepository ¶ added in v1.9.0
func (c *FakeHandler) ValidateAppRepository(appRepoBody io.ReadCloser, requestNamespace string) (*ValidationResponse, error)
ValidateAppRepository fake
type HTTPClient ¶ added in v1.9.0
HTTPClient Interface to perform HTTP requests
func InitNetClient ¶ added in v1.9.0
func InitNetClient(appRepo *v1alpha1.AppRepository, caCertSecret, authSecret *corev1.Secret, defaultHeaders http.Header) (HTTPClient, error)
InitNetClient returns an HTTP client based on the chart details loading a custom CA if provided (as a secret)
type ValidationResponse ¶ added in v1.10.1
ValidationResponse represents the response after validating a repo