Skip to content

Commit

Permalink
Merge pull request #30 from RedHatInsights/psav/add_hostname
Browse files Browse the repository at this point in the history
Added in hostname
  • Loading branch information
psav authored Jun 7, 2024
2 parents a118d17 + 615bab7 commit d9098d7
Show file tree
Hide file tree
Showing 7 changed files with 189 additions and 150 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/package.yml
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,6 @@ jobs:
uses: actions/checkout@v1
- name: Install package and dependencies
run: |
sudo apt-get install golang-1.13
sudo apt-get install golang-1.18
- name: Run Tests
run: ACG_CONFIG="../../../tests/test.json" go test -v ./pkg/api/v1/...
4 changes: 2 additions & 2 deletions go.mod
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
module github.com/redhatinsights/app-common-go

go 1.17
go 1.18

require github.com/stretchr/testify v1.8.0
require github.com/stretchr/testify v1.8.4

require (
github.com/davecgh/go-spew v1.1.1 // indirect
Expand Down
9 changes: 2 additions & 7 deletions go.sum
Original file line number Diff line number Diff line change
@@ -1,15 +1,10 @@
github.com/davecgh/go-spew v1.1.0/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSsI+c5H38=
github.com/davecgh/go-spew v1.1.1 h1:vj9j/u1bqnvCEfJOwUhtlOARqs3+rkHYY13jYWTU97c=
github.com/davecgh/go-spew v1.1.1/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSsI+c5H38=
github.com/pmezard/go-difflib v1.0.0 h1:4DBwDE0NGyQoBHbLQYPwSUPoCMWR5BEzIk/f1lZbAQM=
github.com/pmezard/go-difflib v1.0.0/go.mod h1:iKH77koFhYxTK1pcRnkKkqfTogsbg7gZNVY4sRDYZ/4=
github.com/stretchr/objx v0.1.0/go.mod h1:HFkY916IF+rwdDfMAkV7OtwuqBVzrE8GR6GFx+wExME=
github.com/stretchr/objx v0.4.0/go.mod h1:YvHI0jy2hoMjB+UWwv71VJQ9isScKT/TqJzVSSt89Yw=
github.com/stretchr/testify v1.7.1/go.mod h1:6Fq8oRcR53rry900zMqJjRRixrwX3KX962/h/Wwjteg=
github.com/stretchr/testify v1.8.0 h1:pSgiaMZlXftHpm5L7V1+rVB+AZJydKsMxsQBIJw4PKk=
github.com/stretchr/testify v1.8.0/go.mod h1:yNjHg4UonilssWZ8iaSj1OCr/vHnekPRkoO+kdMU+MU=
github.com/stretchr/testify v1.8.4 h1:CcVxjf3Q8PM0mHUKJCdn+eZZtm5yQwehR5yeSVQQcUk=
github.com/stretchr/testify v1.8.4/go.mod h1:sz/lmYIOXD/1dqDmKjjqLyZ2RngseejIcXlSw2iwfAo=
gopkg.in/check.v1 v0.0.0-20161208181325-20d25e280405 h1:yhCVgyC4o1eVCa2tZl7eS0r+SDo693bJlVdllGtEeKM=
gopkg.in/check.v1 v0.0.0-20161208181325-20d25e280405/go.mod h1:Co6ibVJAznAaIkqp8huTwlJQCZ016jof/cbN4VW5Yz0=
gopkg.in/yaml.v3 v3.0.0-20200313102051-9f266ea9e77c/go.mod h1:K4uyk7z7BCEPqu6E+C64Yfv1cQ7kz7rIZviUmN+EgEM=
gopkg.in/yaml.v3 v3.0.1 h1:fxVm/GzAzEWqLHuvctI91KS9hhNmmWOoWu0XTYJS7CA=
gopkg.in/yaml.v3 v3.0.1/go.mod h1:K4uyk7z7BCEPqu6E+C64Yfv1cQ7kz7rIZviUmN+EgEM=
2 changes: 2 additions & 0 deletions pkg/api/v1/config_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -50,6 +50,8 @@ func TestClientLoad(t *testing.T) {
content, err = os.ReadFile(kafkaFilename)
assert.Nil(t, err, "error reading ca")
assert.Equal(t, *LoadedConfig.Kafka.Brokers[0].Cacert, string(content), "kafka ca didn't match")

assert.Equal(t, *LoadedConfig.Hostname, "testing", "top level hostname didn't match")
}

func TestEmptyRDSCa(t *testing.T) {
Expand Down
37 changes: 32 additions & 5 deletions pkg/api/v1/schema.json
Original file line number Diff line number Diff line change
Expand Up @@ -71,8 +71,8 @@
"description": "Defines the path to the BOPURL.",
"type": "string"
},
"hashCache": {
"description": "A set of configMap/secret hashes",
"hostname": {
"description": "The external hostname of the deployment, where applicable",
"type": "string"
}
},
Expand Down Expand Up @@ -201,16 +201,19 @@
"description": "SASL Configuration for Kafka",
"properties": {
"username": {
"description": "Broker SASL username",
"type": "string"
},
"password": {
"description": "Broker SASL password",
"type": "string"
},
"securityProtocol": {
"description": "Deprecated: Use the top level securityProtocol field instead",
"description": "Broker security protocol, expect one of either: SASL_SSL, SSL. DEPRECATED, use the top level securityProtocol field instead",
"type": "string"
},
"saslMechanism": {
"description": "Broker SASL mechanism, expect: SCRAM-SHA-512",
"type": "string"
}
},
Expand All @@ -222,22 +225,26 @@
"description": "Broker Configuration",
"properties": {
"hostname": {
"description": "Hostname of kafka broker",
"type": "string"
},
"port": {
"description": "Port of kafka broker",
"type": "integer"
},
"cacert": {
"description": "CA certificate trust list for broker in PEM format. If absent, client should use OS default trust list",
"type": "string"
},
"authtype": {
"type": "string",
"enum": ["mtls", "sasl"]
"enum": ["sasl"]
},
"sasl": {
"$ref": "#/definitions/KafkaSASLConfig"
},
"securityProtocol": {
"description": "Broker security procotol, expect one of either: SASL_SSL, SSL",
"type": "string"
}
},
Expand Down Expand Up @@ -342,6 +349,14 @@
"name": {
"description": "The actual name of the bucket being accessed.",
"type": "string"
},
"tls": {
"description": "Details if the Object Server uses TLS.",
"type": "boolean"
},
"endpoint": {
"description": "Defines the endpoint for the Object Storage server configuration.",
"type": "string"
}
},
"required": [
Expand Down Expand Up @@ -436,6 +451,10 @@
"password": {
"description": "Defines the password for the In Memory DB server configuration.",
"type": "string"
},
"sslMode": {
"description": "Defines the sslMode used by the In Memory DB server coniguration",
"type": "boolean"
}
},
"required": [
Expand Down Expand Up @@ -470,7 +489,15 @@
"type": "integer"
},
"apiPath": {
"description": "The top level api path that the app should serve from /api/<apiPath>"
"description": "The top level api path that the app should serve from /api/<apiPath> (deprecated, use apiPaths)",
"type": "string"
},
"apiPaths": {
"description": "The list of API paths (each matching format: '/api/some-path/') that this app will serve requests from",
"type": "array",
"items": {
"type": "string"
}
}
},
"required": [
Expand Down
Loading

0 comments on commit d9098d7

Please sign in to comment.