Skip to content

Commit

Permalink
string var repaced by constant (#693)
Browse files Browse the repository at this point in the history
string var repaced by constant

Co-authored-by: dsy3502 <[email protected]>
  • Loading branch information
dsy3502 and dsy3502 authored Dec 23, 2021
1 parent 2cfe547 commit c65cecd
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions pkg/yurtctl/cmd/revert/revert.go
Original file line number Diff line number Diff line change
Expand Up @@ -161,7 +161,7 @@ func (ro *RevertOptions) RunRevert() (err error) {

// 2. remove the yurt controller manager
if err = ro.clientSet.AppsV1().Deployments("kube-system").
Delete(context.Background(), "yurt-controller-manager", metav1.DeleteOptions{
Delete(context.Background(), constants.YurtControllerManager, metav1.DeleteOptions{
PropagationPolicy: &kubeutil.PropagationPolicy,
}); err != nil && !apierrors.IsNotFound(err) {
return fmt.Errorf("fail to remove yurt controller manager: %s", err)
Expand All @@ -170,7 +170,7 @@ func (ro *RevertOptions) RunRevert() (err error) {

// 2.1 remove the serviceaccount for yurt-controller-manager
if err = ro.clientSet.CoreV1().ServiceAccounts("kube-system").
Delete(context.Background(), "yurt-controller-manager", metav1.DeleteOptions{
Delete(context.Background(), constants.YurtControllerManager, metav1.DeleteOptions{
PropagationPolicy: &kubeutil.PropagationPolicy,
}); err != nil && !apierrors.IsNotFound(err) {
return fmt.Errorf("fail to remove serviceaccount for yurt controller manager: %s", err)
Expand All @@ -179,7 +179,7 @@ func (ro *RevertOptions) RunRevert() (err error) {

// 2.2 remove the clusterrole for yurt-controller-manager
if err = ro.clientSet.RbacV1().ClusterRoles().
Delete(context.Background(), "yurt-controller-manager", metav1.DeleteOptions{
Delete(context.Background(), constants.YurtControllerManager, metav1.DeleteOptions{
PropagationPolicy: &kubeutil.PropagationPolicy,
}); err != nil && !apierrors.IsNotFound(err) {
return fmt.Errorf("fail to remove clusterrole for yurt controller manager: %s", err)
Expand All @@ -188,7 +188,7 @@ func (ro *RevertOptions) RunRevert() (err error) {

// 2.3 remove the clusterrolebinding for yurt-controller-manager
if err = ro.clientSet.RbacV1().ClusterRoleBindings().
Delete(context.Background(), "yurt-controller-manager", metav1.DeleteOptions{
Delete(context.Background(), constants.YurtControllerManager, metav1.DeleteOptions{
PropagationPolicy: &kubeutil.PropagationPolicy,
}); err != nil && !apierrors.IsNotFound(err) {
return fmt.Errorf("fail to remove clusterrolebinding for yurt controller manager: %s", err)
Expand Down

0 comments on commit c65cecd

Please sign in to comment.