Skip to content

Commit

Permalink
feat:istioctl x add-to-mesh and remove-from-mesh Should not affect Ow…
Browse files Browse the repository at this point in the history
…nerReferences (istio#26721)
  • Loading branch information
tanjunchen authored Aug 24, 2020
1 parent 7d99a56 commit 4d46781
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 6 deletions.
7 changes: 4 additions & 3 deletions istioctl/cmd/add-to-mesh.go
Original file line number Diff line number Diff line change
Expand Up @@ -336,9 +336,10 @@ func injectSideCarIntoDeployment(client kubernetes.Interface, deps []appsv1.Depl
}
d := &appsv1.Deployment{
ObjectMeta: metav1.ObjectMeta{
Name: dep.Name,
Namespace: dep.Namespace,
UID: dep.UID,
Name: dep.Name,
Namespace: dep.Namespace,
UID: dep.UID,
OwnerReferences: dep.OwnerReferences,
},
}
if _, err = client.AppsV1().Deployments(svcNamespace).UpdateStatus(context.TODO(), d, metav1.UpdateOptions{}); err != nil {
Expand Down
7 changes: 4 additions & 3 deletions istioctl/cmd/remove-from-mesh.go
Original file line number Diff line number Diff line change
Expand Up @@ -233,9 +233,10 @@ func unInjectSideCarFromDeployment(client kubernetes.Interface, deps []appsv1.De
}
d := &appsv1.Deployment{
ObjectMeta: metav1.ObjectMeta{
Name: dep.Name,
Namespace: dep.Namespace,
UID: dep.UID,
Name: dep.Name,
Namespace: dep.Namespace,
UID: dep.UID,
OwnerReferences: dep.OwnerReferences,
},
}
if _, err := client.AppsV1().Deployments(svcNamespace).UpdateStatus(context.TODO(), d, metav1.UpdateOptions{}); err != nil {
Expand Down

0 comments on commit 4d46781

Please sign in to comment.