Documentation ¶
Index ¶
- Constants
- Variables
- func ListEventsForObject(ctx context.Context, client kubernetes.Interface, namespace string, ...) ([]corev1.Event, error)
- type Applier
- type Claim
- type ClaimFn
- type ClusterRole
- func (r *ClusterRole) Apply(ctx context.Context, client kubernetes.Interface) error
- func (r *ClusterRole) Clone() Resource
- func (r *ClusterRole) ComputeStatus(_ context.Context, _ kubernetes.Interface, now time.Time) (string, status.Status, time.Time, error)
- func (r *ClusterRole) Delete(ctx context.Context, client kubernetes.Interface) error
- func (r *ClusterRole) Ensure(ctx context.Context, client kubernetes.Interface, claims ...Claim) ([]func(), error)
- func (r *ClusterRole) Events(ctx context.Context, client kubernetes.Interface) ([]corev1.Event, error)
- func (r *ClusterRole) Get(ctx context.Context, client kubernetes.Interface) error
- func (r *ClusterRole) ID() ID
- func (r *ClusterRole) Update(ctx context.Context, client kubernetes.Interface) error
- type ClusterRoleBinding
- func (rb *ClusterRoleBinding) Apply(ctx context.Context, client kubernetes.Interface) error
- func (rb *ClusterRoleBinding) Clone() Resource
- func (rb *ClusterRoleBinding) ComputeStatus(_ context.Context, _ kubernetes.Interface, now time.Time) (string, status.Status, time.Time, error)
- func (rb *ClusterRoleBinding) Delete(ctx context.Context, client kubernetes.Interface) error
- func (rb *ClusterRoleBinding) Ensure(ctx context.Context, client kubernetes.Interface, claims ...Claim) ([]func(), error)
- func (rb *ClusterRoleBinding) Events(ctx context.Context, client kubernetes.Interface) ([]corev1.Event, error)
- func (rb *ClusterRoleBinding) Get(ctx context.Context, client kubernetes.Interface) error
- func (rb *ClusterRoleBinding) ID() ID
- func (rb *ClusterRoleBinding) Update(ctx context.Context, client kubernetes.Interface) error
- type DaemonSet
- func (ds *DaemonSet) Apply(ctx context.Context, client kubernetes.Interface) error
- func (ds *DaemonSet) Clone() Resource
- func (ds *DaemonSet) ComputeStatus(ctx context.Context, client kubernetes.Interface, now time.Time) (string, status.Status, time.Time, error)
- func (ds *DaemonSet) Delete(ctx context.Context, client kubernetes.Interface) error
- func (ds *DaemonSet) Events(ctx context.Context, client kubernetes.Interface) ([]corev1.Event, error)
- func (ds *DaemonSet) Get(ctx context.Context, client kubernetes.Interface) error
- func (ds *DaemonSet) ID() ID
- type Deployment
- func (d *Deployment) Apply(ctx context.Context, client kubernetes.Interface) error
- func (d *Deployment) Clone() Resource
- func (d *Deployment) ComputeStatus(ctx context.Context, client kubernetes.Interface, now time.Time) (string, status.Status, time.Time, error)
- func (d *Deployment) Delete(ctx context.Context, client kubernetes.Interface) error
- func (d *Deployment) Events(ctx context.Context, client kubernetes.Interface) ([]corev1.Event, error)
- func (d *Deployment) Get(ctx context.Context, client kubernetes.Interface) error
- func (d *Deployment) ID() ID
- type ID
- type PersistentVolume
- func (pv *PersistentVolume) Apply(ctx context.Context, client kubernetes.Interface) error
- func (pv *PersistentVolume) Clone() Resource
- func (pv *PersistentVolume) ComputeStatus(ctx context.Context, client kubernetes.Interface, now time.Time) (string, status.Status, time.Time, error)
- func (pv *PersistentVolume) Delete(ctx context.Context, client kubernetes.Interface) error
- func (pv *PersistentVolume) Events(ctx context.Context, client kubernetes.Interface) ([]corev1.Event, error)
- func (pv *PersistentVolume) Get(ctx context.Context, client kubernetes.Interface) error
- func (pv *PersistentVolume) ID() ID
- type PersistentVolumeClaim
- func (pvc *PersistentVolumeClaim) Apply(ctx context.Context, client kubernetes.Interface) error
- func (pvc *PersistentVolumeClaim) Clone() Resource
- func (pvc *PersistentVolumeClaim) ComputeStatus(ctx context.Context, client kubernetes.Interface, now time.Time) (string, status.Status, time.Time, error)
- func (pvc *PersistentVolumeClaim) Delete(ctx context.Context, client kubernetes.Interface) error
- func (pvc *PersistentVolumeClaim) Events(ctx context.Context, client kubernetes.Interface) ([]corev1.Event, error)
- func (pvc *PersistentVolumeClaim) Get(ctx context.Context, client kubernetes.Interface) error
- func (pvc *PersistentVolumeClaim) ID() ID
- type Pod
- func (p *Pod) Apply(ctx context.Context, client kubernetes.Interface) error
- func (p *Pod) Clone() Resource
- func (p *Pod) ComputeStatus(ctx context.Context, client kubernetes.Interface, now time.Time) (string, status.Status, time.Time, error)
- func (p *Pod) Delete(ctx context.Context, client kubernetes.Interface) error
- func (p *Pod) Events(ctx context.Context, client kubernetes.Interface) ([]corev1.Event, error)
- func (p *Pod) Get(ctx context.Context, client kubernetes.Interface) error
- func (p *Pod) ID() ID
- type Resource
- type Role
- func (r *Role) Apply(ctx context.Context, client kubernetes.Interface) error
- func (r *Role) Clone() Resource
- func (r *Role) ComputeStatus(_ context.Context, _ kubernetes.Interface, now time.Time) (string, status.Status, time.Time, error)
- func (r *Role) Delete(ctx context.Context, client kubernetes.Interface) error
- func (r *Role) Events(ctx context.Context, client kubernetes.Interface) ([]corev1.Event, error)
- func (r *Role) Get(ctx context.Context, client kubernetes.Interface) error
- func (r *Role) ID() ID
- type RoleBinding
- func (rb *RoleBinding) Apply(ctx context.Context, client kubernetes.Interface) error
- func (rb *RoleBinding) Clone() Resource
- func (rb *RoleBinding) ComputeStatus(_ context.Context, _ kubernetes.Interface, now time.Time) (string, status.Status, time.Time, error)
- func (rb *RoleBinding) Delete(ctx context.Context, client kubernetes.Interface) error
- func (rb *RoleBinding) Events(ctx context.Context, client kubernetes.Interface) ([]corev1.Event, error)
- func (rb *RoleBinding) Get(ctx context.Context, client kubernetes.Interface) error
- func (rb *RoleBinding) ID() ID
- type Secret
- func (s *Secret) Apply(ctx context.Context, client kubernetes.Interface) error
- func (s *Secret) Clone() Resource
- func (s *Secret) ComputeStatus(ctx context.Context, client kubernetes.Interface, now time.Time) (string, status.Status, time.Time, error)
- func (s *Secret) Delete(ctx context.Context, client kubernetes.Interface) error
- func (s *Secret) Events(ctx context.Context, client kubernetes.Interface) ([]corev1.Event, error)
- func (s *Secret) Get(ctx context.Context, client kubernetes.Interface) error
- func (s *Secret) ID() ID
- type Service
- func (s *Service) Apply(ctx context.Context, client kubernetes.Interface) error
- func (s *Service) Clone() Resource
- func (s *Service) ComputeStatus(ctx context.Context, client kubernetes.Interface, now time.Time) (string, status.Status, time.Time, error)
- func (s *Service) Delete(ctx context.Context, client kubernetes.Interface) error
- func (s *Service) Events(ctx context.Context, client kubernetes.Interface) ([]corev1.Event, error)
- func (s *Service) Get(ctx context.Context, client kubernetes.Interface) error
- func (s *Service) ID() ID
- type ServiceAccount
- func (sa *ServiceAccount) Apply(ctx context.Context, client kubernetes.Interface) error
- func (sa *ServiceAccount) Clone() Resource
- func (sa *ServiceAccount) ComputeStatus(_ context.Context, _ kubernetes.Interface, now time.Time) (string, status.Status, time.Time, error)
- func (sa *ServiceAccount) Delete(ctx context.Context, client kubernetes.Interface) error
- func (sa *ServiceAccount) Ensure(ctx context.Context, client kubernetes.Interface, claims ...Claim) ([]func(), error)
- func (sa *ServiceAccount) Events(ctx context.Context, client kubernetes.Interface) ([]corev1.Event, error)
- func (sa *ServiceAccount) Get(ctx context.Context, client kubernetes.Interface) error
- func (sa *ServiceAccount) ID() ID
- func (sa *ServiceAccount) Update(ctx context.Context, client kubernetes.Interface) error
- type StatefulSet
- func (ss *StatefulSet) Apply(ctx context.Context, client kubernetes.Interface) error
- func (ss *StatefulSet) Clone() Resource
- func (ss *StatefulSet) ComputeStatus(ctx context.Context, client kubernetes.Interface, now time.Time) (string, status.Status, time.Time, error)
- func (ss *StatefulSet) Delete(ctx context.Context, client kubernetes.Interface) error
- func (ss *StatefulSet) Events(ctx context.Context, client kubernetes.Interface) ([]corev1.Event, error)
- func (ss *StatefulSet) Get(ctx context.Context, client kubernetes.Interface) error
- func (ss *StatefulSet) ID() ID
- type StorageClass
- func (sc *StorageClass) Apply(ctx context.Context, client kubernetes.Interface) error
- func (sc *StorageClass) Clone() Resource
- func (sc *StorageClass) ComputeStatus(ctx context.Context, client kubernetes.Interface, now time.Time) (string, status.Status, time.Time, error)
- func (sc *StorageClass) Delete(ctx context.Context, client kubernetes.Interface) error
- func (sc *StorageClass) Events(ctx context.Context, client kubernetes.Interface) ([]corev1.Event, error)
- func (sc *StorageClass) Get(ctx context.Context, client kubernetes.Interface) error
- func (sc *StorageClass) ID() ID
Constants ¶
const (
// JujuFieldManager marks the resource changes were made by Juju.
JujuFieldManager = "juju"
)
Variables ¶
var ( // ClaimJujuOwnership asserts that the Kubernetes object has labels that // in line with Juju management "ownership". ClaimJujuOwnership = ClaimAggregateOr( ClaimFn(claimIsManagedByJuju), ClaimFn(claimHasJujuLabel), ) )
Functions ¶
Types ¶
type Applier ¶
type Applier interface { // Apply adds apply operations to the applier. Apply(...Resource) // Delete adds delete operations to the applier. Delete(...Resource) // ApplySet deletes Resources in the current slice that don't exist in the // desired slice. All items in the desired slice are applied. ApplySet(current []Resource, desired []Resource) // Run processes the slice of the operations. Run(ctx context.Context, client kubernetes.Interface, noRollback bool) error }
Applier defines methods for processing a slice of resource operations.
type Claim ¶
type Claim interface { // Assert defines the assertion to run. Returns true if a claim is asserted // over the provided object or if an error occurred where a claim can not be // made. Assert(obj interface{}) (bool, error) }
Claim represents an assertion over a generic Kubernetes object to assert ownership. These are used in Juju for cluster scoped resources to assert that that Juju is not going to take ownership of an object that was not created by itself.
func ClaimAggregateOr ¶
ClaimAggregateOr runs multiple claims looking for the first true condition. If no claims are provided or no claim returns true false is returned. The first claim to error stops execution.
type ClusterRole ¶
type ClusterRole struct {
rbacv1.ClusterRole
}
ClusterRole extends the k8s cluster role.
func NewClusterRole ¶
func NewClusterRole(name string, in *rbacv1.ClusterRole) *ClusterRole
NewClusterRole creates a new cluster role resource.
func (*ClusterRole) Apply ¶
func (r *ClusterRole) Apply(ctx context.Context, client kubernetes.Interface) error
Apply patches the resource change.
func (*ClusterRole) Clone ¶
func (r *ClusterRole) Clone() Resource
Clone returns a copy of the resource.
func (*ClusterRole) ComputeStatus ¶
func (r *ClusterRole) ComputeStatus(_ context.Context, _ kubernetes.Interface, now time.Time) (string, status.Status, time.Time, error)
ComputeStatus returns a juju status for the resource.
func (*ClusterRole) Delete ¶
func (r *ClusterRole) Delete(ctx context.Context, client kubernetes.Interface) error
Delete removes the resource.
func (*ClusterRole) Ensure ¶
func (r *ClusterRole) Ensure( ctx context.Context, client kubernetes.Interface, claims ...Claim, ) ([]func(), error)
Ensure ensures this cluster role exists in it's desired form inside the cluster. If the object does not exist it's updated and if the object exists it's updated. The method also takes an optional set of claims to test the exisiting Kubernetes object with to assert ownership before overwriting it.
func (*ClusterRole) Events ¶
func (r *ClusterRole) Events(ctx context.Context, client kubernetes.Interface) ([]corev1.Event, error)
Events emitted by the resource.
func (*ClusterRole) Get ¶
func (r *ClusterRole) Get(ctx context.Context, client kubernetes.Interface) error
Get refreshes the resource.
func (*ClusterRole) Update ¶
func (r *ClusterRole) Update(ctx context.Context, client kubernetes.Interface) error
Update updates the object in the Kubernetes cluster to the new representation
type ClusterRoleBinding ¶
type ClusterRoleBinding struct {
rbacv1.ClusterRoleBinding
}
ClusterRoleBinding extends the k8s cluster role binding.
func NewClusterRoleBinding ¶
func NewClusterRoleBinding(name string, in *rbacv1.ClusterRoleBinding) *ClusterRoleBinding
NewClusterRoleBinding creates a new role resource.
func (*ClusterRoleBinding) Apply ¶
func (rb *ClusterRoleBinding) Apply(ctx context.Context, client kubernetes.Interface) error
Apply patches the resource change.
func (*ClusterRoleBinding) Clone ¶
func (rb *ClusterRoleBinding) Clone() Resource
Clone returns a copy of the resource.
func (*ClusterRoleBinding) ComputeStatus ¶
func (rb *ClusterRoleBinding) ComputeStatus(_ context.Context, _ kubernetes.Interface, now time.Time) (string, status.Status, time.Time, error)
ComputeStatus returns a juju status for the resource.
func (*ClusterRoleBinding) Delete ¶
func (rb *ClusterRoleBinding) Delete(ctx context.Context, client kubernetes.Interface) error
Delete removes the resource.
func (*ClusterRoleBinding) Ensure ¶
func (rb *ClusterRoleBinding) Ensure( ctx context.Context, client kubernetes.Interface, claims ...Claim, ) ([]func(), error)
Ensure ensures this cluster role exists in it's desired form inside the cluster. If the object does not exist it's updated and if the object exists it's updated. The method also takes an optional set of claims to test the existing Kubernetes object with to assert ownership before overwriting it.
func (*ClusterRoleBinding) Events ¶
func (rb *ClusterRoleBinding) Events(ctx context.Context, client kubernetes.Interface) ([]corev1.Event, error)
Events emitted by the resource.
func (*ClusterRoleBinding) Get ¶
func (rb *ClusterRoleBinding) Get(ctx context.Context, client kubernetes.Interface) error
Get refreshes the resource.
func (*ClusterRoleBinding) ID ¶
func (rb *ClusterRoleBinding) ID() ID
ID returns a comparable ID for the Resource
func (*ClusterRoleBinding) Update ¶
func (rb *ClusterRoleBinding) Update(ctx context.Context, client kubernetes.Interface) error
Update updates the object in the Kubernetes cluster to the new representation
type DaemonSet ¶
DaemonSet extends the k8s daemonset.
func NewDaemonSet ¶
NewDaemonSet creates a new daemonSet resource.
func (*DaemonSet) ComputeStatus ¶
func (ds *DaemonSet) ComputeStatus(ctx context.Context, client kubernetes.Interface, now time.Time) (string, status.Status, time.Time, error)
ComputeStatus returns a juju status for the resource.
func (*DaemonSet) Events ¶
func (ds *DaemonSet) Events(ctx context.Context, client kubernetes.Interface) ([]corev1.Event, error)
Events emitted by the resource.
type Deployment ¶
type Deployment struct {
appsv1.Deployment
}
Deployment extends the k8s deployment.
func NewDeployment ¶
func NewDeployment(name string, namespace string, in *appsv1.Deployment) *Deployment
NewDeployment creates a new deployment resource.
func (*Deployment) Apply ¶
func (d *Deployment) Apply(ctx context.Context, client kubernetes.Interface) error
Apply patches the resource change.
func (*Deployment) Clone ¶
func (d *Deployment) Clone() Resource
Clone returns a copy of the resource.
func (*Deployment) ComputeStatus ¶
func (d *Deployment) ComputeStatus(ctx context.Context, client kubernetes.Interface, now time.Time) (string, status.Status, time.Time, error)
ComputeStatus returns a juju status for the resource.
func (*Deployment) Delete ¶
func (d *Deployment) Delete(ctx context.Context, client kubernetes.Interface) error
Delete removes the resource.
func (*Deployment) Events ¶
func (d *Deployment) Events(ctx context.Context, client kubernetes.Interface) ([]corev1.Event, error)
Events emitted by the resource.
func (*Deployment) Get ¶
func (d *Deployment) Get(ctx context.Context, client kubernetes.Interface) error
Get refreshes the resource.
type PersistentVolume ¶
type PersistentVolume struct {
corev1.PersistentVolume
}
PersistentVolume extends the k8s persistentVolume.
func NewPersistentVolume ¶
func NewPersistentVolume(name string, in *corev1.PersistentVolume) *PersistentVolume
NewPersistentVolume creates a new persistent volume resource.
func (*PersistentVolume) Apply ¶
func (pv *PersistentVolume) Apply(ctx context.Context, client kubernetes.Interface) error
Apply patches the resource change.
func (*PersistentVolume) Clone ¶
func (pv *PersistentVolume) Clone() Resource
Clone returns a copy of the resource.
func (*PersistentVolume) ComputeStatus ¶
func (pv *PersistentVolume) ComputeStatus(ctx context.Context, client kubernetes.Interface, now time.Time) (string, status.Status, time.Time, error)
ComputeStatus returns a juju status for the resource.
func (*PersistentVolume) Delete ¶
func (pv *PersistentVolume) Delete(ctx context.Context, client kubernetes.Interface) error
Delete removes the resource.
func (*PersistentVolume) Events ¶
func (pv *PersistentVolume) Events(ctx context.Context, client kubernetes.Interface) ([]corev1.Event, error)
Events emitted by the resource.
func (*PersistentVolume) Get ¶
func (pv *PersistentVolume) Get(ctx context.Context, client kubernetes.Interface) error
Get refreshes the resource.
func (*PersistentVolume) ID ¶
func (pv *PersistentVolume) ID() ID
ID returns a comparable ID for the Resource
type PersistentVolumeClaim ¶
type PersistentVolumeClaim struct {
corev1.PersistentVolumeClaim
}
PersistentVolumeClaim extends the k8s persistentVolumeClaim.
func ListPersistentVolumeClaims ¶
func ListPersistentVolumeClaims(ctx context.Context, client kubernetes.Interface, namespace string, opts metav1.ListOptions) ([]PersistentVolumeClaim, error)
ListPersistentVolumeClaims returns a list of persistent volume claims.
func NewPersistentVolumeClaim ¶
func NewPersistentVolumeClaim(name string, namespace string, in *corev1.PersistentVolumeClaim) *PersistentVolumeClaim
NewPersistentVolumeClaim creates a new persistent volume claim resource.
func (*PersistentVolumeClaim) Apply ¶
func (pvc *PersistentVolumeClaim) Apply(ctx context.Context, client kubernetes.Interface) error
Apply patches the resource change.
func (*PersistentVolumeClaim) Clone ¶
func (pvc *PersistentVolumeClaim) Clone() Resource
Clone returns a copy of the resource.
func (*PersistentVolumeClaim) ComputeStatus ¶
func (pvc *PersistentVolumeClaim) ComputeStatus(ctx context.Context, client kubernetes.Interface, now time.Time) (string, status.Status, time.Time, error)
ComputeStatus returns a juju status for the resource.
func (*PersistentVolumeClaim) Delete ¶
func (pvc *PersistentVolumeClaim) Delete(ctx context.Context, client kubernetes.Interface) error
Delete removes the resource.
func (*PersistentVolumeClaim) Events ¶
func (pvc *PersistentVolumeClaim) Events(ctx context.Context, client kubernetes.Interface) ([]corev1.Event, error)
Events emitted by the resource.
func (*PersistentVolumeClaim) Get ¶
func (pvc *PersistentVolumeClaim) Get(ctx context.Context, client kubernetes.Interface) error
Get refreshes the resource.
func (*PersistentVolumeClaim) ID ¶
func (pvc *PersistentVolumeClaim) ID() ID
ID returns a comparable ID for the Resource
type Pod ¶
Pod extends the k8s service.
func ListPods ¶
func ListPods(ctx context.Context, client kubernetes.Interface, namespace string, opts metav1.ListOptions) ([]Pod, error)
ListPods returns a list of Pods.
func (*Pod) ComputeStatus ¶
func (p *Pod) ComputeStatus(ctx context.Context, client kubernetes.Interface, now time.Time) (string, status.Status, time.Time, error)
ComputeStatus returns a juju status for the resource.
type Resource ¶
type Resource interface { metav1.ObjectMetaAccessor // Clone returns a copy of the resource. Clone() Resource // Apply patches the resource change. Apply(ctx context.Context, client kubernetes.Interface) error // Get refreshes the resource. Get(ctx context.Context, client kubernetes.Interface) error // Delete removes the resource. Delete(ctx context.Context, client kubernetes.Interface) error // String returns a string format containing the name and type of the resource. String() string // ComputeStatus returns a juju status for the resource. ComputeStatus(ctx context.Context, client kubernetes.Interface, now time.Time) (string, status.Status, time.Time, error) // Events emitted by the object. Events(ctx context.Context, client kubernetes.Interface) ([]corev1.Event, error) // ID returns a comparable ID for the Resource ID() ID }
Resource defines methods for manipulating a k8s resource.
type Role ¶
Role extends the k8s role.
func (*Role) ComputeStatus ¶
func (r *Role) ComputeStatus(_ context.Context, _ kubernetes.Interface, now time.Time) (string, status.Status, time.Time, error)
ComputeStatus returns a juju status for the resource.
type RoleBinding ¶
type RoleBinding struct {
rbacv1.RoleBinding
}
RoleBinding extends the k8s role binding.
func NewRoleBinding ¶
func NewRoleBinding(name string, namespace string, in *rbacv1.RoleBinding) *RoleBinding
NewRoleBinding creates a new role resource.
func (*RoleBinding) Apply ¶
func (rb *RoleBinding) Apply(ctx context.Context, client kubernetes.Interface) error
Apply patches the resource change.
func (*RoleBinding) Clone ¶
func (rb *RoleBinding) Clone() Resource
Clone returns a copy of the resource.
func (*RoleBinding) ComputeStatus ¶
func (rb *RoleBinding) ComputeStatus(_ context.Context, _ kubernetes.Interface, now time.Time) (string, status.Status, time.Time, error)
ComputeStatus returns a juju status for the resource.
func (*RoleBinding) Delete ¶
func (rb *RoleBinding) Delete(ctx context.Context, client kubernetes.Interface) error
Delete removes the resource.
func (*RoleBinding) Events ¶
func (rb *RoleBinding) Events(ctx context.Context, client kubernetes.Interface) ([]corev1.Event, error)
Events emitted by the resource.
func (*RoleBinding) Get ¶
func (rb *RoleBinding) Get(ctx context.Context, client kubernetes.Interface) error
Get refreshes the resource.
type Secret ¶
Secret extends the k8s secret.
func ListSecrets ¶
func ListSecrets(ctx context.Context, client kubernetes.Interface, namespace string, opts metav1.ListOptions) ([]Secret, error)
ListSecrets returns a list of Secrets.
func (*Secret) ComputeStatus ¶
func (s *Secret) ComputeStatus(ctx context.Context, client kubernetes.Interface, now time.Time) (string, status.Status, time.Time, error)
ComputeStatus returns a juju status for the resource.
type Service ¶
Service extends the k8s service.
func NewService ¶
NewService creates a new service resource.
func (*Service) ComputeStatus ¶
func (s *Service) ComputeStatus(ctx context.Context, client kubernetes.Interface, now time.Time) (string, status.Status, time.Time, error)
ComputeStatus returns a juju status for the resource.
type ServiceAccount ¶
type ServiceAccount struct {
corev1.ServiceAccount
}
ServiceAccount extends the k8s service account.
func NewServiceAccount ¶
func NewServiceAccount(name string, namespace string, in *corev1.ServiceAccount) *ServiceAccount
NewServiceAccount creates a new service account resource.
func (*ServiceAccount) Apply ¶
func (sa *ServiceAccount) Apply(ctx context.Context, client kubernetes.Interface) error
Apply patches the resource change.
func (*ServiceAccount) Clone ¶
func (sa *ServiceAccount) Clone() Resource
Clone returns a copy of the resource.
func (*ServiceAccount) ComputeStatus ¶
func (sa *ServiceAccount) ComputeStatus(_ context.Context, _ kubernetes.Interface, now time.Time) (string, status.Status, time.Time, error)
ComputeStatus returns a juju status for the resource.
func (*ServiceAccount) Delete ¶
func (sa *ServiceAccount) Delete(ctx context.Context, client kubernetes.Interface) error
Delete removes the resource.
func (*ServiceAccount) Ensure ¶
func (sa *ServiceAccount) Ensure( ctx context.Context, client kubernetes.Interface, claims ...Claim, ) ([]func(), error)
func (*ServiceAccount) Events ¶
func (sa *ServiceAccount) Events(ctx context.Context, client kubernetes.Interface) ([]corev1.Event, error)
Events emitted by the resource.
func (*ServiceAccount) Get ¶
func (sa *ServiceAccount) Get(ctx context.Context, client kubernetes.Interface) error
Get refreshes the resource.
func (*ServiceAccount) ID ¶
func (sa *ServiceAccount) ID() ID
ID returns a comparable ID for the Resource
func (*ServiceAccount) Update ¶
func (sa *ServiceAccount) Update( ctx context.Context, client kubernetes.Interface, ) error
type StatefulSet ¶
type StatefulSet struct {
appsv1.StatefulSet
}
StatefulSet extends the k8s statefulSet.
func NewStatefulSet ¶
func NewStatefulSet(name string, namespace string, in *appsv1.StatefulSet) *StatefulSet
NewStatefulSet creates a new statefulset resource.
func (*StatefulSet) Apply ¶
func (ss *StatefulSet) Apply(ctx context.Context, client kubernetes.Interface) error
Apply patches the resource change.
func (*StatefulSet) Clone ¶
func (ss *StatefulSet) Clone() Resource
Clone returns a copy of the resource.
func (*StatefulSet) ComputeStatus ¶
func (ss *StatefulSet) ComputeStatus(ctx context.Context, client kubernetes.Interface, now time.Time) (string, status.Status, time.Time, error)
ComputeStatus returns a juju status for the resource.
func (*StatefulSet) Delete ¶
func (ss *StatefulSet) Delete(ctx context.Context, client kubernetes.Interface) error
Delete removes the resource.
func (*StatefulSet) Events ¶
func (ss *StatefulSet) Events(ctx context.Context, client kubernetes.Interface) ([]corev1.Event, error)
Events emitted by the resource.
func (*StatefulSet) Get ¶
func (ss *StatefulSet) Get(ctx context.Context, client kubernetes.Interface) error
Get refreshes the resource.
type StorageClass ¶
type StorageClass struct {
storagev1.StorageClass
}
StorageClass extends the k8s storageClass.
func ListStorageClass ¶
func ListStorageClass(ctx context.Context, client kubernetes.Interface, opts metav1.ListOptions) ([]StorageClass, error)
ListStorageClass returns a list of storage classes.
func NewStorageClass ¶
func NewStorageClass(name string, in *storagev1.StorageClass) *StorageClass
NewStorageClass creates a new storage class resource.
func (*StorageClass) Apply ¶
func (sc *StorageClass) Apply(ctx context.Context, client kubernetes.Interface) error
Apply patches the resource change.
func (*StorageClass) Clone ¶
func (sc *StorageClass) Clone() Resource
Clone returns a copy of the resource.
func (*StorageClass) ComputeStatus ¶
func (sc *StorageClass) ComputeStatus(ctx context.Context, client kubernetes.Interface, now time.Time) (string, status.Status, time.Time, error)
ComputeStatus returns a juju status for the resource.
func (*StorageClass) Delete ¶
func (sc *StorageClass) Delete(ctx context.Context, client kubernetes.Interface) error
Delete removes the resource.
func (*StorageClass) Events ¶
func (sc *StorageClass) Events(ctx context.Context, client kubernetes.Interface) ([]corev1.Event, error)
Events emitted by the resource.
func (*StorageClass) Get ¶
func (sc *StorageClass) Get(ctx context.Context, client kubernetes.Interface) error
Get refreshes the resource.
func (*StorageClass) ID ¶
func (sc *StorageClass) ID() ID
ID returns a comparable ID for the Resource