Skip to content

Commit

Permalink
fix: restart daemonset failed (#2773)
Browse files Browse the repository at this point in the history
  • Loading branch information
CraigMChen authored Nov 2, 2021
1 parent 5e3aebd commit 2c564ab
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 6 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -375,10 +375,10 @@ func (t *ComponentEventTable) SetComponentValue(ctx context.Context) {
}
}

func (t *ComponentEventTable) Transfer(component *cptype.Component) {
component.Props = t.Props
component.Data = map[string]interface{}{"list": t.Data.List}
component.State = map[string]interface{}{
func (t *ComponentEventTable) Transfer(c *cptype.Component) {
c.Props = t.Props
c.Data = map[string]interface{}{"list": t.Data.List}
c.State = map[string]interface{}{
"clusterName": t.State.ClusterName,
"filterValues": t.State.FilterValues,
"pageNo": t.State.PageNo,
Expand All @@ -387,7 +387,7 @@ func (t *ComponentEventTable) Transfer(component *cptype.Component) {
"total": t.State.Total,
"eventTable__urlQuery": t.State.EventTableUQLQuery,
}
component.Operations = t.Operations
c.Operations = t.Operations
}

func contain(arr []string, target string) bool {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -200,7 +200,7 @@ func (b *ComponentRestartButton) restartWorkload(userID, orgID, clusterName, kin
case string(apistructs.K8SStatefulSet):
_, err = client.ClientSet.AppsV1().StatefulSets(namespace).Patch(b.ctx, name, types.StrategicMergePatchType, data, v1.PatchOptions{})
case string(apistructs.K8SDaemonSet):
_, err = client.ClientSet.AppsV1().StatefulSets(namespace).Patch(b.ctx, name, types.StrategicMergePatchType, data, v1.PatchOptions{})
_, err = client.ClientSet.AppsV1().DaemonSets(namespace).Patch(b.ctx, name, types.StrategicMergePatchType, data, v1.PatchOptions{})
default:
return errors.Errorf("invalid workload kind %s (only deployment, statefulSet and daemonSet can be restarted)", kind)
}
Expand Down

0 comments on commit 2c564ab

Please sign in to comment.