Fix: Webhook will take over Deployment even Rollout CR doesn't exist (#278)
(cherry picked from commit deaa5f38b5)
Signed-off-by: AiRanthem <zhongtianyun.zty@alibaba-inc.com>
This commit is contained in:
parent
8b187f9c71
commit
db8ecb0879
|
|
@ -373,12 +373,14 @@ func TestHandlerDeployment(t *testing.T) {
|
|||
rs := rsDemo.DeepCopy()
|
||||
return []*apps.ReplicaSet{rs}
|
||||
},
|
||||
getRollout: func() *appsv1beta1.Rollout {
|
||||
getRollout: func() *appsv1alpha1.Rollout {
|
||||
obj := rolloutDemo.DeepCopy()
|
||||
obj.Spec.WorkloadRef = appsv1beta1.ObjectRef{
|
||||
APIVersion: "apps/v1",
|
||||
Kind: "Deployment",
|
||||
Name: "other",
|
||||
obj.Spec.ObjectRef = appsv1alpha1.ObjectRef{
|
||||
WorkloadRef: &appsv1alpha1.WorkloadRef{
|
||||
APIVersion: "apps/v1",
|
||||
Kind: "Deployment",
|
||||
Name: "other",
|
||||
},
|
||||
}
|
||||
return obj
|
||||
},
|
||||
|
|
|
|||
Loading…
Reference in New Issue