Skip to content

Commit

Permalink
feat(cxl-host): changes for zero-based hdm range (#40)
Browse files Browse the repository at this point in the history
* fix: move all redfish api define to the redfish-openapi.yaml
No need to query dmtf.org

* feat: add patch to force endpoint empty array

* fix: handle zero based hdm range

* chore: sync cxl-lib module to v1.3.3 to fix CDAT query timeout

* feat: [cxl-host] change account file location to /etc when run as systemd service

* fix: PCIeDevicesGet Members return empty list instead of null

* fix: [cxl-host] Collection return empty list instead of null when there is zero member

* fix: [cfm-service] handle cxl-host response with no host port

* fix: [cxl-host] pick up latest fix from cxl-lib

* fix build issue after merge

* fix: fix compilation syntax errors

---------

Co-authored-by: Scott Howe <[email protected]>
  • Loading branch information
HJ-Fan and scott-howe-1 authored Oct 15, 2024
1 parent f254c8c commit 5833680
Show file tree
Hide file tree
Showing 10 changed files with 24,519 additions and 304 deletions.
6 changes: 2 additions & 4 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -109,10 +109,8 @@ generate-redfish:
docker run -u $(GENERATE_USER) --rm -v ${PWD}:/local openapitools/openapi-generator-cli:v7.0.0 generate -i /local/$(OPENAPI_REDFISH_YAML) -g go-server -o /local/pkg/redfishapi --package-name redfishapi --additional-properties=sourceFolder=,outputAsLibrary=true,router=mux,serverPort=8080,enumClassPrefix=true -t /local/api/templates/go-server --skip-validate-spec
@echo "Format files after generation to conform to project standard"
docker run --rm -v ${PWD}:/local golang:$(GO_VERSION) $(GOFMT_OPTS)
@echo "Apply local patch for xml response fix"
git apply api/patch/Apply-xml-workaround-to-fix-metadata-response.patch
@echo "Apply local patch for missing import"
git apply api/patch/fix-missing-import.patch
@echo "Apply local patch for redfish auto generated codes"
git apply api/patch/*.redfish.patch

generate-axios:
@echo "Generating $(OPENAPI_YAML) axios server using openapi-generator-cli"
Expand Down
File renamed without changes.
29 changes: 29 additions & 0 deletions api/patch/force-endpoint-even-when-there-is-no-link.redfish.patch
Original file line number Diff line number Diff line change
@@ -0,0 +1,29 @@
From e3add1887e6d256b255d5fd48f5e1d2bbe4402c8 Mon Sep 17 00:00:00 2001
From: Hongjian Fan <[email protected]>
Date: Fri, 9 Aug 2024 08:16:44 -0500
Subject: [PATCH] patch: force endpoint even when there is no link

---
pkg/redfishapi/model_memory_chunks_v1_6_1_links.go | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/pkg/redfishapi/model_memory_chunks_v1_6_1_links.go b/pkg/redfishapi/model_memory_chunks_v1_6_1_links.go
index 6f6d6f2..176899b 100644
--- a/pkg/redfishapi/model_memory_chunks_v1_6_1_links.go
+++ b/pkg/redfishapi/model_memory_chunks_v1_6_1_links.go
@@ -18,10 +18,10 @@ type MemoryChunksV161Links struct {
CXLLogicalDevicesodataCount int64 `json:"[email protected],omitempty"`

// An array of links to the endpoints that connect to this memory chunk.
- Endpoints []OdataV4IdRef `json:"Endpoints,omitempty"`
+ Endpoints []OdataV4IdRef `json:"Endpoints"` // manual change to force endpoint even when there is no link

// The number of items in a collection.
- EndpointsodataCount int64 `json:"[email protected],omitempty"`
+ EndpointsodataCount int64 `json:"[email protected]"` // manual change to force endpoint even when there is no link

// An array of links to the memory regions for which this memory chunk provides capacity.
MemoryRegions []OdataV4IdRef `json:"MemoryRegions,omitempty"`
--
2.25.1

Loading

0 comments on commit 5833680

Please sign in to comment.