Documentation ¶
Index ¶
- func NewInClusterClientSet(logger *zap.SugaredLogger) (kubernetes.Interface, error)
- func ResolveNamespace(resource *unstructured.Unstructured, namespace string) string
- func ToUnstructured(manifest []byte, async bool) ([]*unstructured.Unstructured, error)
- type Client
- type Config
- type DefaultUpdateStrategyResolver
- type Resource
- type ResourceCacheList
- func (r *ResourceCacheList) Add(u *unstructured.Unstructured)
- func (r *ResourceCacheList) Get(kind, name, namespace string) *unstructured.Unstructured
- func (r *ResourceCacheList) GetByKind(kind string) []*unstructured.Unstructured
- func (r *ResourceCacheList) Len() int
- func (r *ResourceCacheList) Remove(u *unstructured.Unstructured)
- func (r *ResourceCacheList) Replace(u *unstructured.Unstructured)
- func (r *ResourceCacheList) Visit(callback func(u *unstructured.Unstructured) error) error
- func (r *ResourceCacheList) VisitByKind(kind string, callback func(u *unstructured.Unstructured) error) error
- func (r *ResourceCacheList) VisitByKindAndAPIVersion(kind string, apiversion string, ...) error
- type ResourceInterceptor
- type SimpleRESTClientGetter
- func (c *SimpleRESTClientGetter) ToDiscoveryClient() (discovery.CachedDiscoveryInterface, error)
- func (c *SimpleRESTClientGetter) ToRESTConfig() (*rest.Config, error)
- func (c *SimpleRESTClientGetter) ToRESTMapper() (meta.RESTMapper, error)
- func (c *SimpleRESTClientGetter) ToRawKubeConfigLoader() clientcmd.ClientConfig
- type UpdateStrategy
- type UpdateStrategyResolver
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func NewInClusterClientSet ¶
func NewInClusterClientSet(logger *zap.SugaredLogger) (kubernetes.Interface, error)
func ResolveNamespace ¶
func ResolveNamespace(resource *unstructured.Unstructured, namespace string) string
func ToUnstructured ¶
func ToUnstructured(manifest []byte, async bool) ([]*unstructured.Unstructured, error)
ToUnstructured Unmarshalls given manifest in YAML format into k8s.io Unstructured data type.
Types ¶
type Client ¶
type Client interface { Kubeconfig() string DeleteResource(ctx context.Context, kind, name, namespace string) (*Resource, error) Deploy(ctx context.Context, manifestTarget, namespace string, interceptors ...ResourceInterceptor) ([]*Resource, error) DeployByCompareWithOriginal(ctx context.Context, manifestOriginal, manifestTarget, namespace string, interceptors ...ResourceInterceptor) ([]*Resource, error) Delete(ctx context.Context, manifest, namespace string) ([]*Resource, error) PatchUsingStrategy(ctx context.Context, kind, name, namespace string, p []byte, strategy types.PatchType) error Clientset() (kubernetes.Interface, error) Get(kind, name, namespace string) (*unstructured.Unstructured, error) GetDeployment(ctx context.Context, name, namespace string) (*v1apps.Deployment, error) GetStatefulSet(ctx context.Context, name, namespace string) (*v1apps.StatefulSet, error) GetSecret(ctx context.Context, name, namespace string) (*v1.Secret, error) GetService(ctx context.Context, name, namespace string) (*v1.Service, error) GetPod(ctx context.Context, name, namespace string) (*v1.Pod, error) GetJob(ctx context.Context, name, namespace string) (*batchv1.Job, error) GetPersistentVolumeClaim(ctx context.Context, name, namespace string) (*v1.PersistentVolumeClaim, error) ListResource(ctx context.Context, resource string, lo metav1.ListOptions) (*unstructured.UnstructuredList, error) ListGroupVersionResource(ctx context.Context, group string, version string, resource string, lo metav1.ListOptions) (*unstructured.UnstructuredList, error) GetHost() string }
func NewKubernetesClient ¶
type DefaultUpdateStrategyResolver ¶
type DefaultUpdateStrategyResolver struct {
// contains filtered or unexported fields
}
func (*DefaultUpdateStrategyResolver) Resolve ¶
func (d *DefaultUpdateStrategyResolver) Resolve(resourceInfo *resource.Info) (UpdateStrategy, error)
type ResourceCacheList ¶
type ResourceCacheList struct {
// contains filtered or unexported fields
}
func NewResourceList ¶
func NewResourceList(unstructs []*unstructured.Unstructured) *ResourceCacheList
func (*ResourceCacheList) Add ¶
func (r *ResourceCacheList) Add(u *unstructured.Unstructured)
func (*ResourceCacheList) Get ¶
func (r *ResourceCacheList) Get(kind, name, namespace string) *unstructured.Unstructured
func (*ResourceCacheList) GetByKind ¶
func (r *ResourceCacheList) GetByKind(kind string) []*unstructured.Unstructured
func (*ResourceCacheList) Len ¶
func (r *ResourceCacheList) Len() int
func (*ResourceCacheList) Remove ¶
func (r *ResourceCacheList) Remove(u *unstructured.Unstructured)
func (*ResourceCacheList) Replace ¶
func (r *ResourceCacheList) Replace(u *unstructured.Unstructured)
func (*ResourceCacheList) Visit ¶
func (r *ResourceCacheList) Visit(callback func(u *unstructured.Unstructured) error) error
func (*ResourceCacheList) VisitByKind ¶
func (r *ResourceCacheList) VisitByKind(kind string, callback func(u *unstructured.Unstructured) error) error
func (*ResourceCacheList) VisitByKindAndAPIVersion ¶
func (r *ResourceCacheList) VisitByKindAndAPIVersion(kind string, apiversion string, callback func(u *unstructured.Unstructured) error) error
type ResourceInterceptor ¶
type ResourceInterceptor interface {
Intercept(resources *ResourceCacheList, namespace string) error
}
type SimpleRESTClientGetter ¶
type SimpleRESTClientGetter struct {
// contains filtered or unexported fields
}
func NewRESTClientGetter ¶
func NewRESTClientGetter(config *rest.Config) *SimpleRESTClientGetter
func (*SimpleRESTClientGetter) ToDiscoveryClient ¶
func (c *SimpleRESTClientGetter) ToDiscoveryClient() (discovery.CachedDiscoveryInterface, error)
func (*SimpleRESTClientGetter) ToRESTConfig ¶
func (c *SimpleRESTClientGetter) ToRESTConfig() (*rest.Config, error)
func (*SimpleRESTClientGetter) ToRESTMapper ¶
func (c *SimpleRESTClientGetter) ToRESTMapper() (meta.RESTMapper, error)
func (*SimpleRESTClientGetter) ToRawKubeConfigLoader ¶
func (c *SimpleRESTClientGetter) ToRawKubeConfigLoader() clientcmd.ClientConfig
type UpdateStrategy ¶
type UpdateStrategy string
const ( PatchUpdateStrategy UpdateStrategy = "PATCH" ReplaceUpdateStrategy UpdateStrategy = "REPLACE" SkipUpdateStrategy UpdateStrategy = "SKIP" )
type UpdateStrategyResolver ¶
type UpdateStrategyResolver interface {
Resolve(resource *resource.Info) (UpdateStrategy, error)
}
Source Files ¶
Click to show internal directories.
Click to hide internal directories.