Documentation
¶
Index ¶
- func OptsAll(deploymentID string, overwriteOps ...opts.ExtraOpts) *opts.Opts
- func OptsNoGenerator(deploymentID string, overwriteOps ...opts.ExtraOpts) *opts.Opts
- func OptsOnlyClient(zone *configModels.Zone) *opts.Opts
- type Client
- func (c *Client) Client(zone *configModels.Zone) (*k8s.Client, error)
- func (c *Client) Create(id string, params *model.DeploymentCreateParams) error
- func (c *Client) Delete(id string, overwriteUserID ...string) error
- func (c *Client) EnsureOwner(id string, oldOwnerID string) error
- func (c *Client) Generator(deployment *model.Deployment, client *k8s.Client, zone *configModels.Zone) generators.K8sGenerator
- func (c *Client) Get(opts *opts.Opts) (*model.Deployment, *k8s.Client, generators.K8sGenerator, error)
- func (c *Client) ListDeploymentStatus(zone *configModels.Zone) ([]model.DeploymentStatus, error)
- func (c *Client) PodExists(zone *configModels.Zone, podName string) (bool, error)
- func (c *Client) Pods(zone *configModels.Zone) ([]k8sModels.PodPublic, error)
- func (c *Client) Repair(id string) error
- func (c *Client) Restart(id string) error
- func (c *Client) SetupPodLogStream(ctx context.Context, zone *configModels.Zone, podName string, from time.Time, ...) error
- func (c *Client) SetupPodWatcher(ctx context.Context, zone *configModels.Zone, ...) error
- func (c *Client) SetupStatusWatcher(ctx context.Context, zone *configModels.Zone, resourceType string, ...) error
- func (c *Client) Update(id string, params *model.DeploymentUpdateParams) error
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func OptsNoGenerator ¶
func OptsOnlyClient ¶
func OptsOnlyClient(zone *configModels.Zone) *opts.Opts
Types ¶
type Client ¶
type Client struct { client.BaseClient[Client] }
Client is the client for the Harbor service. It contains a BaseClient, which is used to lazy-load and cache data.
func New ¶
New creates a new Client and injects the cache. If a cache is not supplied it will create a new one.
func (*Client) Create ¶
func (c *Client) Create(id string, params *model.DeploymentCreateParams) error
Create sets up K8s for the deployment.
It creates all necessary resources in K8s, such as namespaces, deployments, services, etc.
func (*Client) Delete ¶
Delete deletes all K8s resources for the deployment.
It deletes all K8s resources, such as namespaces, deployments, services, etc.
func (*Client) EnsureOwner ¶
EnsureOwner ensures the owner of the K8s setup, by deleting and then trigger a call to Repair.
func (*Client) Generator ¶
func (c *Client) Generator(deployment *model.Deployment, client *k8s.Client, zone *configModels.Zone) generators.K8sGenerator
Generator returns the K8s generator.
func (*Client) Get ¶
func (c *Client) Get(opts *opts.Opts) (*model.Deployment, *k8s.Client, generators.K8sGenerator, error)
Get returns the deployment, client, and generator.
Depending on the options specified, some return values may be nil. This is useful when you don't always need all the resources.
func (*Client) ListDeploymentStatus ¶
func (c *Client) ListDeploymentStatus(zone *configModels.Zone) ([]model.DeploymentStatus, error)
ListDeploymentStatus lists the status of all deployments in the cluster.
func (*Client) Repair ¶
Repair repairs the deployment.
It repairs all K8s resources for the deployment.
func (*Client) SetupPodLogStream ¶
func (c *Client) SetupPodLogStream(ctx context.Context, zone *configModels.Zone, podName string, from time.Time, onLog func(deploymentName string, lines []model.Log)) error
SetupPodLogStream sets up a log stream for a pod.
func (*Client) SetupPodWatcher ¶
func (c *Client) SetupPodWatcher(ctx context.Context, zone *configModels.Zone, callback func(podName, event string)) error
SetupPodWatcher sets up a pod watcher for the deployment. For every pod change, it triggers the callback.
func (*Client) SetupStatusWatcher ¶
func (c *Client) SetupStatusWatcher(ctx context.Context, zone *configModels.Zone, resourceType string, callback func(name string, status interface{})) error
SetupStatusWatcher sets up a status watcher for a zone. For every status change, it triggers the callback.