From 565e1d4116319a72f87e75da5d5dccf488ab9dae Mon Sep 17 00:00:00 2001 From: Taewan Kim Date: Wed, 23 Aug 2023 17:43:58 +0900 Subject: [PATCH] Align format through `go fmt` Issue-ID: AIMLFW-55 Change-Id: I9e646fe178613c1231350cef06c7cbfcb5b03eb3 Signed-off-by: Taewan Kim --- Makefile | 3 +++ cmd/kserve-adapter/main.go | 2 +- pkg/client/kserve/utils.go | 4 ++-- pkg/commons/types/values.go | 2 +- pkg/helm/config.go | 14 +++++++------- pkg/helm/schema.go | 14 +++++++------- 6 files changed, 21 insertions(+), 18 deletions(-) diff --git a/Makefile b/Makefile index 5f18f89..8557c94 100644 --- a/Makefile +++ b/Makefile @@ -28,3 +28,6 @@ run: ./kserve-adapter genmock: go generate ./... +fmt: + go fmt ./cmd/... + go fmt ./pkg/... diff --git a/cmd/kserve-adapter/main.go b/cmd/kserve-adapter/main.go index 689c324..4e7ad9a 100644 --- a/cmd/kserve-adapter/main.go +++ b/cmd/kserve-adapter/main.go @@ -23,9 +23,9 @@ import ( "flag" "os" - "github.com/spf13/viper" "gerrit.o-ran-sc.org/r/aiml-fw/aihp/ips/kserve-adapter/pkg/api" "gerrit.o-ran-sc.org/r/aiml-fw/aihp/ips/kserve-adapter/pkg/commons/logger" + "github.com/spf13/viper" ) const KSERVE_ADAPTER_CONFIG_FILE = "./config/kserve-adapter.yaml" diff --git a/pkg/client/kserve/utils.go b/pkg/client/kserve/utils.go index 0462be4..f4e8115 100644 --- a/pkg/client/kserve/utils.go +++ b/pkg/client/kserve/utils.go @@ -57,7 +57,7 @@ func convertValuesToInferenceService(values types.Values) (ifsv api_v1beta1.Infe Name: values.FullName, Namespace: ips_namespace, Labels: map[string]string{ - "app": values.FullName, + "app": values.FullName, }, }, Spec: api_v1beta1.InferenceServiceSpec{ @@ -78,7 +78,7 @@ func convertValuesToInferenceService(values types.Values) (ifsv api_v1beta1.Infe case "tensorflow": ifsv.Spec.Predictor.Tensorflow = &api_v1beta1.TFServingSpec{ PredictorExtensionSpec: api_v1beta1.PredictorExtensionSpec{ - StorageURI: &values.StorageURI, + StorageURI: &values.StorageURI, RuntimeVersion: &values.RuntimeVersion, Container: core_v1.Container{ Image: values.Image, diff --git a/pkg/commons/types/values.go b/pkg/commons/types/values.go index 1caa1a1..c43381d 100644 --- a/pkg/commons/types/values.go +++ b/pkg/commons/types/values.go @@ -30,7 +30,7 @@ type Values struct { Resources string `yaml:"resources"` RICServiceAccountName string `yaml:"ric_serviceaccount_name"` StorageURI string `yaml:"storageUri"` - RuntimeVersion string `yaml:"runtimeVersion"` + RuntimeVersion string `yaml:"runtimeVersion"` Image string `yaml:"image"` ResourceVersion string CanaryTrafficPercent int64 diff --git a/pkg/helm/config.go b/pkg/helm/config.go index 9dbe5a4..8ccdb6b 100644 --- a/pkg/helm/config.go +++ b/pkg/helm/config.go @@ -25,14 +25,14 @@ type Config struct { Version string `json:"version"` SaName string `json:"sa_name"` InferenceService InferenceService `json:"inferenceservice"` - configFile string + configFile string } type InferenceService struct { - Engine string `json:"engine"` - StorageURI string `json:"storage_uri"` - RuntimeVersion string `json:"runtime_version"` - ApiVersion string `json:"api_version"` - MinReplicas int32 `json:"min_replicas"` - MaxReplicas int32 `json:"max_replicas"` + Engine string `json:"engine"` + StorageURI string `json:"storage_uri"` + RuntimeVersion string `json:"runtime_version"` + ApiVersion string `json:"api_version"` + MinReplicas int32 `json:"min_replicas"` + MaxReplicas int32 `json:"max_replicas"` } diff --git a/pkg/helm/schema.go b/pkg/helm/schema.go index 7f7a771..b111de5 100644 --- a/pkg/helm/schema.go +++ b/pkg/helm/schema.go @@ -27,7 +27,7 @@ type Schema struct { Title string `json:"title"` Required []string `json:"required"` Properties Properties `json:"properties"` - schemaFile string + schemaFile string } type Definitions struct { @@ -46,12 +46,12 @@ type InferenceServiceSchema struct { } type InferenceServiceProperty struct { - Engine StringProperty `json:"engine"` - StorageURI StringProperty `json:"storage_uri"` - RuntimeVersion StringProperty `json:"runtime_version"` - ApiVersion StringProperty `json:"api_version"` - MinReplicas IntegerProperty `json:"min_replicas"` - MaxReplicas IntegerProperty `json:"max_replicas"` + Engine StringProperty `json:"engine"` + StorageURI StringProperty `json:"storage_uri"` + RuntimeVersion StringProperty `json:"runtime_version"` + ApiVersion StringProperty `json:"api_version"` + MinReplicas IntegerProperty `json:"min_replicas"` + MaxReplicas IntegerProperty `json:"max_replicas"` } type StringProperty struct { -- 2.16.6