Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Added in hostname #30

Merged
merged 1 commit into from
Jun 7, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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