Kenchu123 commented on a change in pull request #788:
URL: https://github.com/apache/submarine/pull/788#discussion_r743576384



##########
File path: submarine-cloud-v2/pkg/controller/parser.go
##########
@@ -0,0 +1,169 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements.  See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License.  You may obtain a copy of the License at
+ *
+ *    http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+package controller
+
+import (
+       "encoding/json"
+       "fmt"
+       "io"
+       "os"
+       "path/filepath"
+
+       "github.com/pkg/errors"
+       traefikv1alpha1 
"github.com/traefik/traefik/v2/pkg/provider/kubernetes/crd/traefik/v1alpha1"
+       appsv1 "k8s.io/api/apps/v1"
+       v1 "k8s.io/api/core/v1"
+       extensionsv1beta1 "k8s.io/api/extensions/v1beta1"
+       rbacv1 "k8s.io/api/rbac/v1"
+       "k8s.io/apimachinery/pkg/apis/meta/v1/unstructured"
+       "k8s.io/apimachinery/pkg/util/yaml"
+)
+
+// PathToOSFile gets the absolute path from relative path.
+func pathToOSFile(relativePath string) (*os.File, error) {
+       path, err := filepath.Abs(relativePath)
+       if err != nil {
+               return nil, errors.Wrap(err, fmt.Sprintf("failed generate 
absolute file path of %s", relativePath))
+       }
+
+       manifest, err := os.Open(path)
+       if err != nil {
+               return nil, errors.Wrap(err, fmt.Sprintf("failed to open file 
%s", path))
+       }
+
+       return manifest, nil
+}

Review comment:
       I have found out that the function name is right, which the function 
turns the `path` into the type of `*os.File`. Hence, I modified the comment 
just now. Thanks.




-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]


Reply via email to