diff --git a/Dockerfile b/Dockerfile index c9403b4..37c8650 100644 --- a/Dockerfile +++ b/Dockerfile @@ -25,7 +25,7 @@ ### Build Base Stage ### # Build base just has the packages installed we need. -FROM artifactory.algol60.net/docker.io/library/golang:1.16-alpine AS build-base +FROM artifactory.algol60.net/docker.io/library/golang:1.23-alpine AS build-base RUN set -ex \ && apk -U upgrade \ @@ -50,9 +50,9 @@ FROM base AS builder # Base image contains everything needed for Go building, just build. RUN set -ex \ - && go build -v -tags musl -i github.com/Cray-HPE/hms-smd/v2/cmd/smd \ - && go build -v -tags musl -i github.com/Cray-HPE/hms-smd/v2/cmd/smd-loader \ - && go build -v -tags musl -i github.com/Cray-HPE/hms-smd/v2/cmd/smd-init + && go build -v -tags musl github.com/Cray-HPE/hms-smd/v2/cmd/smd \ + && go build -v -tags musl github.com/Cray-HPE/hms-smd/v2/cmd/smd-loader \ + && go build -v -tags musl github.com/Cray-HPE/hms-smd/v2/cmd/smd-init ### Final Stage ### diff --git a/cmd/smd-init/main.go b/cmd/smd-init/main.go index e060a59..3797935 100644 --- a/cmd/smd-init/main.go +++ b/cmd/smd-init/main.go @@ -30,7 +30,7 @@ import ( "strconv" "time" - "github.com/OpenCHAMI/smd/v2/internal/hmsds" + "github.com/Cray-HPE/hms-smd/v2/internal/hmsds" "github.com/golang-migrate/migrate/v4" "github.com/golang-migrate/migrate/v4/database/postgres" _ "github.com/golang-migrate/migrate/v4/source/file" diff --git a/cmd/smd/components.go b/cmd/smd/components.go index 8500fe2..1590f10 100644 --- a/cmd/smd/components.go +++ b/cmd/smd/components.go @@ -28,8 +28,8 @@ import ( "strconv" base "github.com/Cray-HPE/hms-base" - "github.com/OpenCHAMI/smd/v2/internal/hmsds" - "github.com/OpenCHAMI/smd/v2/pkg/rf" + "github.com/Cray-HPE/hms-smd/v2/internal/hmsds" + "github.com/Cray-HPE/hms-smd/v2/pkg/rf" ) //////////////////////////////////////////////////////////////////////////// diff --git a/cmd/smd/discover.go b/cmd/smd/discover.go index 564cfed..a3e2091 100644 --- a/cmd/smd/discover.go +++ b/cmd/smd/discover.go @@ -30,8 +30,8 @@ import ( base "github.com/Cray-HPE/hms-base" compcreds "github.com/Cray-HPE/hms-compcredentials" - "github.com/OpenCHAMI/smd/v2/pkg/rf" - "github.com/OpenCHAMI/smd/v2/pkg/sm" + "github.com/Cray-HPE/hms-smd/v2/pkg/rf" + "github.com/Cray-HPE/hms-smd/v2/pkg/sm" ) // When we discover a Redfish Endpoint, the data retrieved is processed diff --git a/cmd/smd/hmsdsmock_test.go b/cmd/smd/hmsdsmock_test.go index 9bcb323..647315e 100644 --- a/cmd/smd/hmsdsmock_test.go +++ b/cmd/smd/hmsdsmock_test.go @@ -26,8 +26,8 @@ import ( "log" base "github.com/Cray-HPE/hms-base" - "github.com/OpenCHAMI/smd/v2/internal/hmsds" - "github.com/OpenCHAMI/smd/v2/pkg/sm" + "github.com/Cray-HPE/hms-smd/v2/internal/hmsds" + "github.com/Cray-HPE/hms-smd/v2/pkg/sm" ) type TestResults struct { diff --git a/cmd/smd/job-types.go b/cmd/smd/job-types.go index 50c66d7..10d3215 100644 --- a/cmd/smd/job-types.go +++ b/cmd/smd/job-types.go @@ -37,7 +37,7 @@ import ( "github.com/hashicorp/go-retryablehttp" base "github.com/Cray-HPE/hms-base" - "github.com/OpenCHAMI/smd/v2/pkg/sm" + "github.com/Cray-HPE/hms-smd/v2/pkg/sm" ) /////////////////////////////////////////////////////////////////////////////// diff --git a/cmd/smd/main.go b/cmd/smd/main.go index 83d08c4..0c601c3 100644 --- a/cmd/smd/main.go +++ b/cmd/smd/main.go @@ -40,13 +40,13 @@ import ( "github.com/Cray-HPE/hms-certs/pkg/hms_certs" compcreds "github.com/Cray-HPE/hms-compcredentials" sstorage "github.com/Cray-HPE/hms-securestorage" + "github.com/Cray-HPE/hms-smd/v2/internal/hbtdapi" + "github.com/Cray-HPE/hms-smd/v2/internal/hmsds" + "github.com/Cray-HPE/hms-smd/v2/internal/pgmigrate" + "github.com/Cray-HPE/hms-smd/v2/internal/slsapi" + "github.com/Cray-HPE/hms-smd/v2/pkg/rf" + "github.com/Cray-HPE/hms-smd/v2/pkg/sm" jwtauth "github.com/OpenCHAMI/jwtauth/v5" - "github.com/OpenCHAMI/smd/v2/internal/hbtdapi" - "github.com/OpenCHAMI/smd/v2/internal/hmsds" - "github.com/OpenCHAMI/smd/v2/internal/pgmigrate" - "github.com/OpenCHAMI/smd/v2/internal/slsapi" - "github.com/OpenCHAMI/smd/v2/pkg/rf" - "github.com/OpenCHAMI/smd/v2/pkg/sm" "github.com/go-chi/chi/v5" "github.com/hashicorp/go-retryablehttp" "github.com/sirupsen/logrus" diff --git a/cmd/smd/response.go b/cmd/smd/response.go index 9007732..a35e030 100644 --- a/cmd/smd/response.go +++ b/cmd/smd/response.go @@ -6,7 +6,7 @@ import ( "net/http" base "github.com/Cray-HPE/hms-base" - "github.com/OpenCHAMI/smd/v2/pkg/sm" + "github.com/Cray-HPE/hms-smd/v2/pkg/sm" ) type Response struct { @@ -60,7 +60,6 @@ func sendResource(w http.ResponseWriter, code int, uri *sm.ResourceURI) { sendJSON(w, code, uri) } - func sendJsonNewResourceIDArray(w http.ResponseWriter, collectionURI string, uris []*sm.ResourceURI) { if len(uris) == 0 { sendJSON(w, http.StatusNoContent, nil) diff --git a/cmd/smd/rfevent.go b/cmd/smd/rfevent.go index 52f5490..263c48b 100644 --- a/cmd/smd/rfevent.go +++ b/cmd/smd/rfevent.go @@ -29,9 +29,9 @@ import ( "sync" base "github.com/Cray-HPE/hms-base" - "github.com/OpenCHAMI/smd/v2/internal/hmsds" - "github.com/OpenCHAMI/smd/v2/pkg/rf" - "github.com/OpenCHAMI/smd/v2/pkg/sm" + "github.com/Cray-HPE/hms-smd/v2/internal/hmsds" + "github.com/Cray-HPE/hms-smd/v2/pkg/rf" + "github.com/Cray-HPE/hms-smd/v2/pkg/sm" ) var em = base.NewHMSError("sm.msgbus", "internal error") diff --git a/cmd/smd/rfevent_test.go b/cmd/smd/rfevent_test.go index f3dd475..91cf10e 100644 --- a/cmd/smd/rfevent_test.go +++ b/cmd/smd/rfevent_test.go @@ -31,10 +31,10 @@ import ( compcreds "github.com/Cray-HPE/hms-compcredentials" sstorage "github.com/Cray-HPE/hms-securestorage" - "github.com/OpenCHAMI/smd/v2/internal/hmsds" - "github.com/OpenCHAMI/smd/v2/pkg/rf" - st "github.com/OpenCHAMI/smd/v2/pkg/sharedtest" - "github.com/OpenCHAMI/smd/v2/pkg/sm" + "github.com/Cray-HPE/hms-smd/v2/internal/hmsds" + "github.com/Cray-HPE/hms-smd/v2/pkg/rf" + st "github.com/Cray-HPE/hms-smd/v2/pkg/sharedtest" + "github.com/Cray-HPE/hms-smd/v2/pkg/sm" ) var testFQDN = "[fd40:aaaa:bbbb:1000:240:a6ff:ee82:d7c2]" diff --git a/cmd/smd/smd-api.go b/cmd/smd/smd-api.go index b7f7435..1105dd5 100644 --- a/cmd/smd/smd-api.go +++ b/cmd/smd/smd-api.go @@ -34,9 +34,9 @@ import ( base "github.com/Cray-HPE/hms-base" compcreds "github.com/Cray-HPE/hms-compcredentials" - "github.com/OpenCHAMI/smd/v2/internal/hmsds" - "github.com/OpenCHAMI/smd/v2/pkg/rf" - "github.com/OpenCHAMI/smd/v2/pkg/sm" + "github.com/Cray-HPE/hms-smd/v2/internal/hmsds" + "github.com/Cray-HPE/hms-smd/v2/pkg/rf" + "github.com/Cray-HPE/hms-smd/v2/pkg/sm" "github.com/go-chi/chi/v5" "github.com/openchami/schemas/schemas" redfish "github.com/openchami/schemas/schemas/csm" @@ -2696,7 +2696,7 @@ func (s *SmD) parseRedfishPostDataV2(w http.ResponseWriter, data []byte) error { ceNum := 0 for _, system := range root.Systems { var nid json.Number - nidJNum, err := json.Marshal(ceNum+1) + nidJNum, err := json.Marshal(ceNum + 1) if err != nil { s.Log(LOG_NOTICE, "failed to marshal NID %d into json: %v", ceNum+1, err) } else { diff --git a/cmd/smd/smd-api_test.go b/cmd/smd/smd-api_test.go index 9dbe942..e6d0708 100644 --- a/cmd/smd/smd-api_test.go +++ b/cmd/smd/smd-api_test.go @@ -38,10 +38,10 @@ import ( base "github.com/Cray-HPE/hms-base" compcreds "github.com/Cray-HPE/hms-compcredentials" sstorage "github.com/Cray-HPE/hms-securestorage" - "github.com/OpenCHAMI/smd/v2/internal/hmsds" - "github.com/OpenCHAMI/smd/v2/pkg/rf" - stest "github.com/OpenCHAMI/smd/v2/pkg/sharedtest" - "github.com/OpenCHAMI/smd/v2/pkg/sm" + "github.com/Cray-HPE/hms-smd/v2/internal/hmsds" + "github.com/Cray-HPE/hms-smd/v2/pkg/rf" + stest "github.com/Cray-HPE/hms-smd/v2/pkg/sharedtest" + "github.com/Cray-HPE/hms-smd/v2/pkg/sm" "github.com/gorilla/mux" ) diff --git a/cmd/smd/state-change.go b/cmd/smd/state-change.go index 429de4b..51f54f6 100644 --- a/cmd/smd/state-change.go +++ b/cmd/smd/state-change.go @@ -29,9 +29,9 @@ import ( "time" base "github.com/Cray-HPE/hms-base" - "github.com/OpenCHAMI/smd/v2/internal/hmsds" - "github.com/OpenCHAMI/smd/v2/pkg/rf" - "github.com/OpenCHAMI/smd/v2/pkg/sm" + "github.com/Cray-HPE/hms-smd/v2/internal/hmsds" + "github.com/Cray-HPE/hms-smd/v2/pkg/rf" + "github.com/Cray-HPE/hms-smd/v2/pkg/sm" ) var e = base.NewHMSError("sm", "server error") diff --git a/go.mod b/go.mod index abf2c79..b8b7cdb 100644 --- a/go.mod +++ b/go.mod @@ -1,4 +1,4 @@ -module github.com/OpenCHAMI/smd/v2 +module github.com/Cray-HPE/hms-smd/v2 go 1.21 diff --git a/internal/hmsds/hmsds-api.go b/internal/hmsds/hmsds-api.go index 0951d95..0d7e2c7 100644 --- a/internal/hmsds/hmsds-api.go +++ b/internal/hmsds/hmsds-api.go @@ -24,7 +24,7 @@ package hmsds import ( base "github.com/Cray-HPE/hms-base" - "github.com/OpenCHAMI/smd/v2/pkg/sm" + "github.com/Cray-HPE/hms-smd/v2/pkg/sm" ) var e = base.NewHMSError("hmsds", "GenericError") diff --git a/internal/hmsds/hmsds-api_test.go b/internal/hmsds/hmsds-api_test.go index 4f65053..2355e55 100644 --- a/internal/hmsds/hmsds-api_test.go +++ b/internal/hmsds/hmsds-api_test.go @@ -28,7 +28,7 @@ import ( "os" "testing" - "github.com/OpenCHAMI/smd/v2/pkg/sm" + "github.com/Cray-HPE/hms-smd/v2/pkg/sm" "github.com/DATA-DOG/go-sqlmock" sq "github.com/Masterminds/squirrel" diff --git a/internal/hmsds/hmsds-postgres.go b/internal/hmsds/hmsds-postgres.go index 83c54e2..fdd8d39 100644 --- a/internal/hmsds/hmsds-postgres.go +++ b/internal/hmsds/hmsds-postgres.go @@ -35,8 +35,8 @@ import ( "time" base "github.com/Cray-HPE/hms-base" - "github.com/OpenCHAMI/smd/v2/pkg/rf" - "github.com/OpenCHAMI/smd/v2/pkg/sm" + "github.com/Cray-HPE/hms-smd/v2/pkg/rf" + "github.com/Cray-HPE/hms-smd/v2/pkg/sm" sq "github.com/Masterminds/squirrel" "github.com/lib/pq" diff --git a/internal/hmsds/hmsds-postgres_test.go b/internal/hmsds/hmsds-postgres_test.go index c0ca71a..f2f76f9 100644 --- a/internal/hmsds/hmsds-postgres_test.go +++ b/internal/hmsds/hmsds-postgres_test.go @@ -34,9 +34,9 @@ import ( "time" base "github.com/Cray-HPE/hms-base" - "github.com/OpenCHAMI/smd/v2/pkg/rf" - stest "github.com/OpenCHAMI/smd/v2/pkg/sharedtest" - "github.com/OpenCHAMI/smd/v2/pkg/sm" + "github.com/Cray-HPE/hms-smd/v2/pkg/rf" + stest "github.com/Cray-HPE/hms-smd/v2/pkg/sharedtest" + "github.com/Cray-HPE/hms-smd/v2/pkg/sm" "github.com/DATA-DOG/go-sqlmock" sq "github.com/Masterminds/squirrel" diff --git a/internal/hmsds/hmsds-tx-postgres.go b/internal/hmsds/hmsds-tx-postgres.go index 70e8c8d..46d7197 100644 --- a/internal/hmsds/hmsds-tx-postgres.go +++ b/internal/hmsds/hmsds-tx-postgres.go @@ -33,7 +33,7 @@ import ( "time" base "github.com/Cray-HPE/hms-base" - "github.com/OpenCHAMI/smd/v2/pkg/sm" + "github.com/Cray-HPE/hms-smd/v2/pkg/sm" sq "github.com/Masterminds/squirrel" "github.com/google/uuid" diff --git a/internal/hmsds/query-postgres.go b/internal/hmsds/query-postgres.go index 6c38cda..e32bd49 100644 --- a/internal/hmsds/query-postgres.go +++ b/internal/hmsds/query-postgres.go @@ -30,7 +30,7 @@ import ( "strings" base "github.com/Cray-HPE/hms-base" - "github.com/OpenCHAMI/smd/v2/pkg/sm" + "github.com/Cray-HPE/hms-smd/v2/pkg/sm" "github.com/lib/pq" ) diff --git a/internal/hmsds/query-shared.go b/internal/hmsds/query-shared.go index 02042d6..773d9d4 100644 --- a/internal/hmsds/query-shared.go +++ b/internal/hmsds/query-shared.go @@ -27,7 +27,7 @@ import ( "strings" base "github.com/Cray-HPE/hms-base" - "github.com/OpenCHAMI/smd/v2/pkg/sm" + "github.com/Cray-HPE/hms-smd/v2/pkg/sm" ) // Matches generic query sources in external API, but with real table names, diff --git a/pkg/service-reservations/demo/demoApp.go b/pkg/service-reservations/demo/demoApp.go index 7a2fd97..aa9e5d1 100644 --- a/pkg/service-reservations/demo/demoApp.go +++ b/pkg/service-reservations/demo/demoApp.go @@ -25,7 +25,7 @@ package main import ( "time" - reservation "github.com/OpenCHAMI/smd/v2/pkg/service-reservations" + reservation "github.com/Cray-HPE/hms-smd/v2/pkg/service-reservations" "github.com/sirupsen/logrus" ) diff --git a/pkg/service-reservations/interface.go b/pkg/service-reservations/interface.go index 7472bd4..3aa60eb 100644 --- a/pkg/service-reservations/interface.go +++ b/pkg/service-reservations/interface.go @@ -36,7 +36,7 @@ import ( "time" base "github.com/Cray-HPE/hms-base" - "github.com/OpenCHAMI/smd/v2/pkg/sm" + "github.com/Cray-HPE/hms-smd/v2/pkg/sm" "github.com/hashicorp/go-retryablehttp" "github.com/sirupsen/logrus" ) diff --git a/pkg/sharedtest/endpoints-examples.go b/pkg/sharedtest/endpoints-examples.go index 5058166..64903d9 100644 --- a/pkg/sharedtest/endpoints-examples.go +++ b/pkg/sharedtest/endpoints-examples.go @@ -25,8 +25,8 @@ package sharedtest import ( "encoding/json" - "github.com/OpenCHAMI/smd/v2/pkg/rf" - "github.com/OpenCHAMI/smd/v2/pkg/sm" + "github.com/Cray-HPE/hms-smd/v2/pkg/rf" + "github.com/Cray-HPE/hms-smd/v2/pkg/sm" ) ////////////////////////////////////////////////////////////////////////////// diff --git a/pkg/sharedtest/hwinv-examples.go b/pkg/sharedtest/hwinv-examples.go index 8d88d95..7b415c6 100644 --- a/pkg/sharedtest/hwinv-examples.go +++ b/pkg/sharedtest/hwinv-examples.go @@ -25,8 +25,8 @@ package sharedtest import ( "encoding/json" - "github.com/OpenCHAMI/smd/v2/pkg/rf" - "github.com/OpenCHAMI/smd/v2/pkg/sm" + "github.com/Cray-HPE/hms-smd/v2/pkg/rf" + "github.com/Cray-HPE/hms-smd/v2/pkg/sm" ) /////////////////////////////////////////////////////////////////////////////// diff --git a/pkg/sm/endpoints.go b/pkg/sm/endpoints.go index f2bfac1..947e1dc 100644 --- a/pkg/sm/endpoints.go +++ b/pkg/sm/endpoints.go @@ -26,7 +26,7 @@ import ( "encoding/json" base "github.com/Cray-HPE/hms-base" - "github.com/OpenCHAMI/smd/v2/pkg/rf" + "github.com/Cray-HPE/hms-smd/v2/pkg/rf" ) // This is a generic link to a resource owned by state manager, i.e. a diff --git a/pkg/sm/hwinv.go b/pkg/sm/hwinv.go index f6b7c4b..1288012 100644 --- a/pkg/sm/hwinv.go +++ b/pkg/sm/hwinv.go @@ -28,7 +28,7 @@ import ( "strconv" base "github.com/Cray-HPE/hms-base" - "github.com/OpenCHAMI/smd/v2/pkg/rf" + "github.com/Cray-HPE/hms-smd/v2/pkg/rf" ) var ErrHWLocInvalid = base.NewHMSError("sm", "ID is empty or not a valid xname") diff --git a/pkg/sm/hwinv_test.go b/pkg/sm/hwinv_test.go index 1316685..b64c18e 100644 --- a/pkg/sm/hwinv_test.go +++ b/pkg/sm/hwinv_test.go @@ -25,8 +25,8 @@ package sm_test import ( "testing" - stest "github.com/OpenCHAMI/smd/v2/pkg/sharedtest" - "github.com/OpenCHAMI/smd/v2/pkg/sm" + stest "github.com/Cray-HPE/hms-smd/v2/pkg/sharedtest" + "github.com/Cray-HPE/hms-smd/v2/pkg/sm" ) ///////////////////////////////////////////////////////////////////////////////