From 7fee507de14b50f4f88288aed975463830b897ec Mon Sep 17 00:00:00 2001 From: garciay Date: Sat, 9 Nov 2024 14:44:14 +0100 Subject: [PATCH] Lint errors fixed in CAPIF --- .../meep-dai/templates/onboardedapp-pv.yaml | 2 + .../server/capif-mgmt/convert.go | 70 ++++++++++--------- .../model_mec_transport_info_capif_ext.go | 33 +++++---- .../server/capif-mgmt/service-mgmt.go | 29 ++++---- 4 files changed, 70 insertions(+), 64 deletions(-) diff --git a/charts/meep-dai/templates/onboardedapp-pv.yaml b/charts/meep-dai/templates/onboardedapp-pv.yaml index 6f3cadfa7..792279e25 100644 --- a/charts/meep-dai/templates/onboardedapp-pv.yaml +++ b/charts/meep-dai/templates/onboardedapp-pv.yaml @@ -1,3 +1,4 @@ +{{- if .Values.onboardedapp.enabled}} kind: PersistentVolume apiVersion: v1 metadata: @@ -31,3 +32,4 @@ spec: resources: requests: storage: 100Mi +{{- end}} diff --git a/go-apps/meep-app-enablement/server/capif-mgmt/convert.go b/go-apps/meep-app-enablement/server/capif-mgmt/convert.go index fb49112e5..e281a55dd 100644 --- a/go-apps/meep-app-enablement/server/capif-mgmt/convert.go +++ b/go-apps/meep-app-enablement/server/capif-mgmt/convert.go @@ -40,14 +40,15 @@ func convertServiceInfoToJson_1(obj *ServiceApiDescription) string { return string(jsonInfo) } -func convertServiceInfoToJson_2(obj *ServiceApiDescriptionPatch) string { - jsonInfo, err := json.Marshal(*obj) - if err != nil { - log.Error(err.Error()) - return "" - } - return string(jsonInfo) -} +// FSCOM Unsused +// func convertServiceInfoToJson_2(obj *ServiceApiDescriptionPatch) string { +// jsonInfo, err := json.Marshal(*obj) +// if err != nil { +// log.Error(err.Error()) +// return "" +// } +// return string(jsonInfo) +// } func convertJsonToServiceInfo(jsonInfo string) *ServiceInfo { var obj ServiceInfo @@ -59,14 +60,15 @@ func convertJsonToServiceInfo(jsonInfo string) *ServiceInfo { return &obj } -func convertSerAvailabilityNotifSubToJson(obj *SerAvailabilityNotificationSubscription) string { - jsonInfo, err := json.Marshal(*obj) - if err != nil { - log.Error(err.Error()) - return "" - } - return string(jsonInfo) -} +// FSCOM Unsused +// func convertSerAvailabilityNotifSubToJson(obj *SerAvailabilityNotificationSubscription) string { +// jsonInfo, err := json.Marshal(*obj) +// if err != nil { +// log.Error(err.Error()) +// return "" +// } +// return string(jsonInfo) +// } func convertSerAvailabilityNotifSubToJson_1(obj *EventSubscription) string { jsonInfo, err := json.Marshal(*obj) @@ -77,15 +79,16 @@ func convertSerAvailabilityNotifSubToJson_1(obj *EventSubscription) string { return string(jsonInfo) } -func convertJsonToSerAvailabilityNotifSub(jsonData string) *SerAvailabilityNotificationSubscription { - var obj SerAvailabilityNotificationSubscription - err := json.Unmarshal([]byte(jsonData), &obj) - if err != nil { - log.Error(err.Error()) - return nil - } - return &obj -} +// FSCOM Unsused +// func convertJsonToSerAvailabilityNotifSub(jsonData string) *SerAvailabilityNotificationSubscription { +// var obj SerAvailabilityNotificationSubscription +// err := json.Unmarshal([]byte(jsonData), &obj) +// if err != nil { +// log.Error(err.Error()) +// return nil +// } +// return &obj +// } // Convert []string back to []CapifEventFilter func convertStringsToEventFilters(stringFilters []string) []CapifEventFilter { @@ -134,14 +137,15 @@ func convertJsonToSerAvailabilityNotifSub_1(jsonData string) *EventSubscription return &obj } -func convertServiceAvailabilityNotifToJson(obj *ServiceAvailabilityNotification) string { - jsonInfo, err := json.Marshal(*obj) - if err != nil { - log.Error(err.Error()) - return "" - } - return string(jsonInfo) -} +// FSCOM Unsused +// func convertServiceAvailabilityNotifToJson(obj *ServiceAvailabilityNotification) string { +// jsonInfo, err := json.Marshal(*obj) +// if err != nil { +// log.Error(err.Error()) +// return "" +// } +// return string(jsonInfo) +// } func convertServiceAvailabilityNotifToJson_1(obj *EventNotification) string { jsonInfo, err := json.Marshal(*obj) diff --git a/go-apps/meep-app-enablement/server/capif-mgmt/model_mec_transport_info_capif_ext.go b/go-apps/meep-app-enablement/server/capif-mgmt/model_mec_transport_info_capif_ext.go index b0adc7bfc..124759c3e 100644 --- a/go-apps/meep-app-enablement/server/capif-mgmt/model_mec_transport_info_capif_ext.go +++ b/go-apps/meep-app-enablement/server/capif-mgmt/model_mec_transport_info_capif_ext.go @@ -10,20 +10,19 @@ package server // This type represents the general information of a MEC service. - type MecTransportInfoCapifExt struct { - // Name of the transport info. - Name string `json:"name,omitempty"` - // Description of the transport info. - Description string `json:"description,omitempty"` - - Type_ *TransportType `json:"type,omitempty"` - // The name of the protocol used. Shall be set to HTTP for a REST API. - Protocol string `json:"protocol,omitempty"` - // The version of the protocol used - Version string `json:"version,omitempty"` - - Security *SecurityInfo `json:"security,omitempty"` - // Additional implementation specific details of the transport - ImplSpecificInfo string `json:"implSpecificInfo,omitempty"` - } - \ No newline at end of file +type MecTransportInfoCapifExt struct { + // Name of the transport info. + Name string `json:"name,omitempty"` + // Description of the transport info. + Description string `json:"description,omitempty"` + + Type_ *TransportType `json:"type,omitempty"` + // The name of the protocol used. Shall be set to HTTP for a REST API. + Protocol string `json:"protocol,omitempty"` + // The version of the protocol used + Version string `json:"version,omitempty"` + + Security *SecurityInfo `json:"security,omitempty"` + // Additional implementation specific details of the transport + ImplSpecificInfo string `json:"implSpecificInfo,omitempty"` +} diff --git a/go-apps/meep-app-enablement/server/capif-mgmt/service-mgmt.go b/go-apps/meep-app-enablement/server/capif-mgmt/service-mgmt.go index 11ce04b9c..fd5255055 100644 --- a/go-apps/meep-app-enablement/server/capif-mgmt/service-mgmt.go +++ b/go-apps/meep-app-enablement/server/capif-mgmt/service-mgmt.go @@ -2252,20 +2252,21 @@ func validateCategoryRef(categoryRef *CategoryRef) string { return "" } -func newSerAvailabilityNotifSubCfg(sub *SerAvailabilityNotificationSubscription, subId string, appId string) *subs.SubscriptionCfg { - subCfg := &subs.SubscriptionCfg{ - Id: subId, - AppId: appId, - Type: SER_AVAILABILITY_NOTIF_SUB_TYPE, - Self: sub.Links.Self.Href, - NotifyUrl: sub.CallbackReference, - ExpiryTime: nil, - PeriodicInterval: 0, - RequestTestNotif: false, - RequestWebsocketUri: false, - } - return subCfg -} +// FSCOM Unsused +// func newSerAvailabilityNotifSubCfg(sub *SerAvailabilityNotificationSubscription, subId string, appId string) *subs.SubscriptionCfg { +// subCfg := &subs.SubscriptionCfg{ +// Id: subId, +// AppId: appId, +// Type: SER_AVAILABILITY_NOTIF_SUB_TYPE, +// Self: sub.Links.Self.Href, +// NotifyUrl: sub.CallbackReference, +// ExpiryTime: nil, +// PeriodicInterval: 0, +// RequestTestNotif: false, +// RequestWebsocketUri: false, +// } +// return subCfg +// } func newSerAvailabilityNotifSubCfg_1(sub *EventSubscription, subId string, appId string) *subs.SubscriptionCfg { var eventFilters []string -- GitLab