Documentation ¶
Index ¶
- func EqualIgnoreHash(template1, template2 *v1.PodTemplateSpec) bool
- func FindNewReplicaSet(deployment *v1beta1.Deployment, rsList []*apps.ReplicaSet) *apps.ReplicaSet
- func FindOldReplicaSets(deployment *v1beta1.Deployment, rsList []*apps.ReplicaSet) ([]*apps.ReplicaSet, []*apps.ReplicaSet)
- func GetNewReplicaSet(deployment *v1beta1.Deployment, c appsclient.AppsV1Interface) (*apps.ReplicaSet, error)
- func GetOldReplicaSets(deployment *v1beta1.Deployment, c appsclient.AppsV1Interface) ([]*apps.ReplicaSet, []*apps.ReplicaSet, error)
- func ListReplicaSets(deployment *v1beta1.Deployment, getRSList RsListFunc) ([]*apps.ReplicaSet, error)
- func NewClient() (client *kubernetes.Clientset, err error)
- func QuickUpdateDeploymentImage(name, image string) error
- func SyncDeployment() chan struct{}
- func UpdateDeploymentImages(name string, images map[string]string) error
- type DeploymentSyncController
- type ReplicaSetsByCreationTimestamp
- type RsListFunc
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:
- 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)
- 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 SyncDeployment ¶
func SyncDeployment() chan struct{}
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 (o ReplicaSetsByCreationTimestamp) Len() int
func (ReplicaSetsByCreationTimestamp) Less ¶
func (o ReplicaSetsByCreationTimestamp) Less(i, j int) bool
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.