Skip to content

Commit

Permalink
local and container version endpoints working
Browse files Browse the repository at this point in the history
  • Loading branch information
Adam0Brien committed Feb 13, 2025
1 parent 90188b3 commit 80a7f7f
Show file tree
Hide file tree
Showing 9 changed files with 16 additions and 11 deletions.
1 change: 1 addition & 0 deletions Makefile
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
FIPS_ENABLED?=true
export RESOURCE_DIR=data/resources

ifeq ($(GO),)
GO:=$(shell command -v go)
Expand Down
3 changes: 0 additions & 3 deletions data/resources/notification/config.yaml

This file was deleted.

3 changes: 0 additions & 3 deletions data/resources/notification/integration/config.yaml

This file was deleted.

3 changes: 3 additions & 0 deletions data/resources/notifications/config.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
resource_type: notifications-integrations
resource_reporters:
- NOTIFICATIONS
3 changes: 3 additions & 0 deletions data/resources/notifications/integration/config.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
resource_type: notifications-integrations
resource_reporters:
- NOTIFICATIONS
4 changes: 2 additions & 2 deletions go.mod
Original file line number Diff line number Diff line change
Expand Up @@ -8,13 +8,13 @@ require (
github.com/bufbuild/protovalidate-go v0.9.1
github.com/cloudevents/sdk-go/protocol/kafka_confluent/v2 v2.0.0-20241021120453-70fb95191324
github.com/cloudevents/sdk-go/v2 v2.15.2
github.com/confluentinc/confluent-kafka-go/v2 v2.8.0
github.com/confluentinc/confluent-kafka-go/v2 v2.3.0
github.com/coreos/go-oidc/v3 v3.12.0
github.com/go-kratos/kratos/v2 v2.8.3
github.com/golang-jwt/jwt/v5 v5.2.1
github.com/google/uuid v1.6.0
github.com/patrickmn/go-cache v2.1.0+incompatible
github.com/project-kessel/inventory-client-go v0.0.0-20240918112335-d9c72f85b234
github.com/project-kessel/inventory-client-go v0.0.0-20250213094514-4b90870d8dcf
github.com/project-kessel/relations-api v0.0.0-20241021205601-90db9ba90a73
github.com/prometheus/client_golang v1.20.5
github.com/redhatinsights/app-common-go v1.6.8
Expand Down
4 changes: 4 additions & 0 deletions go.sum
Original file line number Diff line number Diff line change
Expand Up @@ -80,6 +80,8 @@ github.com/cncf/xds/go v0.0.0-20240905190251-b4127c9b8d78 h1:QVw89YDxXxEe+l8gU8E
github.com/cncf/xds/go v0.0.0-20240905190251-b4127c9b8d78/go.mod h1:W+zGtBO5Y1IgJhy4+A9GOqVhqLpfZi+vwmdNXUehLA8=
github.com/compose-spec/compose-go/v2 v2.1.3 h1:bD67uqLuL/XgkAK6ir3xZvNLFPxPScEi1KW7R5esrLE=
github.com/compose-spec/compose-go/v2 v2.1.3/go.mod h1:lFN0DrMxIncJGYAXTfWuajfwj5haBJqrBkarHcnjJKc=
github.com/confluentinc/confluent-kafka-go/v2 v2.3.0 h1:icCHutJouWlQREayFwCc7lxDAhws08td+W3/gdqgZts=
github.com/confluentinc/confluent-kafka-go/v2 v2.3.0/go.mod h1:/VTy8iEpe6mD9pkCH5BhijlUl8ulUXymKv1Qig5Rgb8=
github.com/confluentinc/confluent-kafka-go/v2 v2.8.0 h1:0HlcSNWg4LpLA9nIjzUMIqWHI+w0S68UN7alXAc3TeA=
github.com/confluentinc/confluent-kafka-go/v2 v2.8.0/go.mod h1:hScqtFIGUI1wqHIgM3mjoqEou4VweGGGX7dMpcUKves=
github.com/containerd/console v1.0.4 h1:F2g4+oChYvBTsASRTz8NP6iIAi97J3TtSAsLbIFn4ro=
Expand Down Expand Up @@ -346,6 +348,8 @@ github.com/power-devops/perfstat v0.0.0-20221212215047-62379fc7944b h1:0LFwY6Q3g
github.com/power-devops/perfstat v0.0.0-20221212215047-62379fc7944b/go.mod h1:OmDBASR4679mdNQnz2pUhc2G8CO2JrUAVFDRBDP/hJE=
github.com/project-kessel/inventory-client-go v0.0.0-20240918112335-d9c72f85b234 h1:Ms0bb3nq9slmvRIRhPxTocC/nVJtUrRDlEnmcXgP7as=
github.com/project-kessel/inventory-client-go v0.0.0-20240918112335-d9c72f85b234/go.mod h1:ghVJESku3BJcPp3A8RTuHIErM0RptidPKoi0xGTlgrk=
github.com/project-kessel/inventory-client-go v0.0.0-20250213094514-4b90870d8dcf h1:RIKxvHBg98bak8Z58gNOgYbBZsOOLYKNRpLVSNhdNA8=
github.com/project-kessel/inventory-client-go v0.0.0-20250213094514-4b90870d8dcf/go.mod h1:ghVJESku3BJcPp3A8RTuHIErM0RptidPKoi0xGTlgrk=
github.com/project-kessel/relations-api v0.0.0-20241021205601-90db9ba90a73 h1:w/VpkTj8lEw4/EoCVjMj7Yiq3qI6jAPJ35vEWpiMKdk=
github.com/project-kessel/relations-api v0.0.0-20241021205601-90db9ba90a73/go.mod h1:eFvW2RvCRuvjpfpovZHlgw7JLQLIU0G0GVX0SXd7FUE=
github.com/prometheus/client_golang v1.20.5 h1:cxppBPuYhUnsO6yo/aoRol4L7q7UFfdm+bR9r+8l63Y=
Expand Down
6 changes: 3 additions & 3 deletions internal/middleware/schema_loader.go
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ func ValidateCombination(resourceType, reporterType string) error {

// LoadResourceSchema finds the resources schema based on the directory structure of data/resources
func LoadResourceSchema(resourceType string) (string, error) {
schemaPath := filepath.Join("data/resources", resourceType, resourceType+".json")
schemaPath := filepath.Join(resourceDir, resourceType, resourceType+".json")
data, err := os.ReadFile(schemaPath)
if err != nil {
return "", fmt.Errorf("failed to read schema file for '%s': %w", resourceType, err)
Expand All @@ -34,7 +34,7 @@ func LoadResourceSchema(resourceType string) (string, error) {

// LoadReporterSchema finds the reporters schemas based on the directory structure of data/resources
func LoadReporterSchema(resourceType string, reporterType string) (string, error) {
schemaPath := filepath.Join("data/resources", resourceType, "reporters", reporterType, reporterType+".json")
schemaPath := filepath.Join(resourceDir, resourceType, "reporters", reporterType, reporterType+".json")
data, err := os.ReadFile(schemaPath)
if err != nil {
return "", fmt.Errorf("failed to read schema file for '%s' and reporter '%s': %w", resourceType, reporterType, err)
Expand All @@ -44,7 +44,7 @@ func LoadReporterSchema(resourceType string, reporterType string) (string, error

// LoadValidReporters Takes the resource_type from the provided config.yaml and compares it to the defined reporter_types
func LoadValidReporters(resourceType string) ([]string, error) {
configPath := filepath.Join("data/resources", resourceType, "config.yaml")
configPath := filepath.Join(resourceDir, resourceType, "config.yaml")
data, err := os.ReadFile(configPath)
if err != nil {
return nil, fmt.Errorf("failed to read config file for '%s': %w", resourceType, err)
Expand Down

0 comments on commit 80a7f7f

Please sign in to comment.