Skip to content

Commit 0848638

Browse files
committed
Remove duplicate import of controller-runtime client in deployment.go
Signed-off-by: Andrew Obuchowicz <aobuchow@redhat.com>
1 parent 1590cd9 commit 0848638

1 file changed

Lines changed: 3 additions & 4 deletions

File tree

pkg/provision/workspace/deployment.go

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -37,7 +37,6 @@ import (
3737
"k8s.io/apimachinery/pkg/runtime"
3838
"k8s.io/apimachinery/pkg/types"
3939
k8sclient "sigs.k8s.io/controller-runtime/pkg/client"
40-
runtimeClient "sigs.k8s.io/controller-runtime/pkg/client"
4140
"sigs.k8s.io/controller-runtime/pkg/controller/controllerutil"
4241
)
4342

@@ -136,7 +135,7 @@ func SyncDeploymentToCluster(
136135
}
137136

138137
// DeleteWorkspaceDeployment deletes the deployment for the DevWorkspace
139-
func DeleteWorkspaceDeployment(ctx context.Context, workspace *common.DevWorkspaceWithConfig, client runtimeClient.Client) (wait bool, err error) {
138+
func DeleteWorkspaceDeployment(ctx context.Context, workspace *common.DevWorkspaceWithConfig, client k8sclient.Client) (wait bool, err error) {
140139
err = client.Delete(ctx, &appsv1.Deployment{
141140
ObjectMeta: metav1.ObjectMeta{
142141
Namespace: workspace.Namespace,
@@ -153,14 +152,14 @@ func DeleteWorkspaceDeployment(ctx context.Context, workspace *common.DevWorkspa
153152
}
154153

155154
// ScaleDeploymentToZero scales the cluster deployment to zero
156-
func ScaleDeploymentToZero(ctx context.Context, workspace *common.DevWorkspaceWithConfig, client runtimeClient.Client) error {
155+
func ScaleDeploymentToZero(ctx context.Context, workspace *common.DevWorkspaceWithConfig, client k8sclient.Client) error {
157156
patch := []byte(`{"spec":{"replicas": 0}}`)
158157
err := client.Patch(ctx, &appsv1.Deployment{
159158
ObjectMeta: metav1.ObjectMeta{
160159
Namespace: workspace.Namespace,
161160
Name: common.DeploymentName(workspace.Status.DevWorkspaceId),
162161
},
163-
}, runtimeClient.RawPatch(types.StrategicMergePatchType, patch))
162+
}, k8sclient.RawPatch(types.StrategicMergePatchType, patch))
164163

165164
if err != nil && !k8sErrors.IsNotFound(err) {
166165
return err

0 commit comments

Comments
 (0)