k8s

package
Version: v0.0.0-...-966fcb4 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Nov 29, 2019 License: Apache-2.0 Imports: 24 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func EqualIgnoreHash

func EqualIgnoreHash(template1, template2 *v1.PodTemplateSpec) bool

EqualIgnoreHash returns true if two given podTemplateSpec are equal, ignoring the diff in value of Labels[pod-template-hash] We ignore pod-template-hash because: 1. The hash result would be different upon podTemplateSpec API changes

(e.g. the addition of a new field will cause the hash code to change)

2. The deployment template won't have hash labels

func FindNewReplicaSet

func FindNewReplicaSet(deployment *v1beta1.Deployment, rsList []*apps.ReplicaSet) *apps.ReplicaSet

FindNewReplicaSet returns the new RS this given deployment targets (the one with the same pod template).

func FindOldReplicaSets

func FindOldReplicaSets(deployment *v1beta1.Deployment, rsList []*apps.ReplicaSet) ([]*apps.ReplicaSet, []*apps.ReplicaSet)

FindOldReplicaSets returns the old replica sets targeted by the given Deployment, with the given slice of RSes. Note that the first set of old replica sets doesn't include the ones with no pods, and the second set of old replica sets include all old replica sets.

func GetNewReplicaSet

func GetNewReplicaSet(deployment *v1beta1.Deployment, c appsclient.AppsV1Interface) (*apps.ReplicaSet, error)

GetNewReplicaSet returns a replica set that matches the intent of the given deployment; get ReplicaSetList from client interface. Returns nil if the new replica set doesn't exist yet.

func GetOldReplicaSets

func GetOldReplicaSets(deployment *v1beta1.Deployment, c appsclient.AppsV1Interface) ([]*apps.ReplicaSet, []*apps.ReplicaSet, error)

GetOldReplicaSets returns the old replica sets targeted by the given Deployment; get PodList and ReplicaSetList from client interface. Note that the first set of old replica sets doesn't include the ones with no pods, and the second set of old replica sets include all old replica sets.

func ListReplicaSets

func ListReplicaSets(deployment *v1beta1.Deployment, getRSList RsListFunc) ([]*apps.ReplicaSet, error)

ListReplicaSets returns a slice of RSes the given deployment targets. Note that this does NOT attempt to reconcile ControllerRef (adopt/orphan), because only the controller itself should do that. However, it does filter out anything whose ControllerRef doesn't match.

func NewClient

func NewClient() (client *kubernetes.Clientset, err error)

func QuickUpdateDeploymentImage

func QuickUpdateDeploymentImage(name, image string) error

func SyncDeployment

func SyncDeployment() chan struct{}

func UpdateDeploymentImages

func UpdateDeploymentImages(name string, images map[string]string) error

Types

type DeploymentSyncController

type DeploymentSyncController struct {
	// contains filtered or unexported fields
}

func NewDeploymentSyncController

func NewDeploymentSyncController(queue workqueue.RateLimitingInterface, indexer cache.Indexer, informer cache.Controller, clientset *kubernetes.Clientset) *DeploymentSyncController

func (*DeploymentSyncController) Run

func (c *DeploymentSyncController) Run(threadiness int, stopCh chan struct{})

type ReplicaSetsByCreationTimestamp

type ReplicaSetsByCreationTimestamp []*apps.ReplicaSet

ReplicaSetsByCreationTimestamp sorts a list of ReplicaSet by creation timestamp, using their names as a tie breaker.

func (ReplicaSetsByCreationTimestamp) Len

func (ReplicaSetsByCreationTimestamp) Less

func (ReplicaSetsByCreationTimestamp) Swap

func (o ReplicaSetsByCreationTimestamp) Swap(i, j int)

type RsListFunc

type RsListFunc func(string, metav1.ListOptions) ([]*apps.ReplicaSet, error)

RsListFunc returns the ReplicaSet from the ReplicaSet namespace and the List metav1.ListOptions.

func RsListFromClient

func RsListFromClient(c appsclient.AppsV1Interface) RsListFunc

RsListFromClient returns an rsListFunc that wraps the given client.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
t or T : Toggle theme light dark auto
y or Y : Canonical URL