ReplicaSet has owner ref of the Deployment that created it
This commit is contained in:
@@ -361,6 +361,26 @@ const (
|
||||
SuccessfulDeletePodReason = "SuccessfulDelete"
|
||||
)
|
||||
|
||||
// RSControlInterface is an interface that knows how to add or delete
|
||||
// ReplicaSets, as well as increment or decrement them. It is used
|
||||
// by the deployment controller to ease testing of actions that it takes.
|
||||
type RSControlInterface interface {
|
||||
PatchReplicaSet(namespace, name string, data []byte) error
|
||||
}
|
||||
|
||||
// RealRSControl is the default implementation of RSControllerInterface.
|
||||
type RealRSControl struct {
|
||||
KubeClient clientset.Interface
|
||||
Recorder record.EventRecorder
|
||||
}
|
||||
|
||||
var _ RSControlInterface = &RealRSControl{}
|
||||
|
||||
func (r RealRSControl) PatchReplicaSet(namespace, name string, data []byte) error {
|
||||
_, err := r.KubeClient.Extensions().ReplicaSets(namespace).Patch(name, api.StrategicMergePatchType, data)
|
||||
return err
|
||||
}
|
||||
|
||||
// PodControlInterface is an interface that knows how to add or delete pods
|
||||
// created as an interface to allow testing.
|
||||
type PodControlInterface interface {
|
||||
|
Reference in New Issue
Block a user