Skip to content

Commit 5e7c92c

Browse files
committed
fix(ws): Fix lint errors and typo
Signed-off-by: mohamedch7 <[email protected]>
1 parent ad49f17 commit 5e7c92c

File tree

2 files changed

+34
-4
lines changed

2 files changed

+34
-4
lines changed

workspaces/backend/api/workspace_yaml_handler.go

+15
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,17 @@
1+
// Copyright 2024.
2+
//
3+
// Licensed under the Apache License, Version 2.0 (the "License");
4+
// you may not use this file except in compliance with the License.
5+
// You may obtain a copy of the License at
6+
//
7+
// http://www.apache.org/licenses/LICENSE-2.0
8+
//
9+
// Unless required by applicable law or agreed to in writing, software
10+
// distributed under the License is distributed on an "AS IS" BASIS,
11+
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
12+
// See the License for the specific language governing permissions and
13+
// limitations under the License.
14+
115
package api
216

317
import (
@@ -9,6 +23,7 @@ import (
923
"errors"
1024

1125
"github.com/kubeflow/notebooks/workspaces/backend/internal/repositories/workspaces"
26+
1227
"sigs.k8s.io/yaml"
1328
)
1429

workspaces/backend/api/workspace_yaml_handler_test.go

+19-4
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,17 @@
1+
// Copyright 2024.
2+
//
3+
// Licensed under the Apache License, Version 2.0 (the "License");
4+
// you may not use this file except in compliance with the License.
5+
// You may obtain a copy of the License at
6+
//
7+
// http://www.apache.org/licenses/LICENSE-2.0
8+
//
9+
// Unless required by applicable law or agreed to in writing, software
10+
// distributed under the License is distributed on an "AS IS" BASIS,
11+
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
12+
// See the License for the specific language governing permissions and
13+
// limitations under the License.
14+
115
package api
216

317
import (
@@ -9,15 +23,16 @@ import (
923
"os"
1024

1125
"github.com/julienschmidt/httprouter"
12-
"github.com/kubeflow/notebooks/workspaces/backend/internal/config"
13-
"github.com/kubeflow/notebooks/workspaces/backend/internal/repositories"
1426
kubefloworgv1beta1 "github.com/kubeflow/notebooks/workspaces/controller/api/v1beta1"
1527
. "github.com/onsi/ginkgo/v2"
1628
. "github.com/onsi/gomega"
1729
corev1 "k8s.io/api/core/v1"
1830
metav1 "k8s.io/apimachinery/pkg/apis/meta/v1"
1931
"k8s.io/apimachinery/pkg/types"
2032
"sigs.k8s.io/controller-runtime/pkg/client"
33+
34+
"github.com/kubeflow/notebooks/workspaces/backend/internal/config"
35+
"github.com/kubeflow/notebooks/workspaces/backend/internal/repositories"
2136
)
2237

2338
var _ = Describe("Workspace YAML Handler", Ordered, func() {
@@ -90,7 +105,7 @@ var _ = Describe("Workspace YAML Handler", Ordered, func() {
90105
})
91106

92107
It("should retrieve the workspace YAML successfully", func() {
93-
req := httptest.NewRequest(http.MethodGet, fmt.Sprintf("/api/v1/workspaces/%s/%s/details/yaml", namespaceName, workspaceKey.Name), nil)
108+
req := httptest.NewRequest(http.MethodGet, fmt.Sprintf("/api/v1/workspaces/%s/%s/details/yaml", namespaceName, workspaceKey.Name), http.NoBody)
94109
rr := httptest.NewRecorder()
95110

96111
ps := httprouter.Params{
@@ -110,7 +125,7 @@ var _ = Describe("Workspace YAML Handler", Ordered, func() {
110125
})
111126

112127
It("should return 404 when workspace doesn't exist", func() {
113-
req := httptest.NewRequest(http.MethodGet, fmt.Sprintf("/api/v1/workspaces/%s/non-existent/details/yaml", namespaceName), nil)
128+
req := httptest.NewRequest(http.MethodGet, fmt.Sprintf("/api/v1/workspaces/%s/non-existent/details/yaml", namespaceName), http.NoBody)
114129
rr := httptest.NewRecorder()
115130

116131
ps := httprouter.Params{

0 commit comments

Comments
 (0)