Skip to content

Commit e6095da

Browse files
Proto changes to pass proxy connection_string to compliance service (#6641)
* proxy_proto changes Signed-off-by: Vivek Shankar <[email protected]> * proto breaking change Signed-off-by: Vivek Shankar <[email protected]>
1 parent 2593038 commit e6095da

File tree

9 files changed

+229
-323
lines changed

9 files changed

+229
-323
lines changed

api/config/compliance/config_request.go

+3-1
Original file line numberDiff line numberDiff line change
@@ -17,6 +17,7 @@ func NewConfigRequest() *ConfigRequest {
1717
Logger: &ConfigRequest_V1_System_Logger{},
1818
Agent: &ConfigRequest_V1_System_Agent{},
1919
Profiles: &ConfigRequest_V1_System_Profiles{},
20+
Proxy: &ConfigRequest_V1_System_Proxy{},
2021
},
2122
Svc: &ConfigRequest_V1_Service{},
2223
},
@@ -82,7 +83,8 @@ func (c *ConfigRequest) PrepareSystemConfig(creds *config.TLSCredentials) (confi
8283
// SetGlobalConfig imports settings from the global configuration
8384
func (c *ConfigRequest) SetGlobalConfig(g *config.GlobalConfig) {
8485
c.V1.Sys.Mlsa = g.V1.Mlsa
85-
c.V1.Sys.Proxy = g.V1.Proxy
86+
c.V1.Sys.Proxy.ConnectionString = g.ProxyString()
87+
c.V1.Sys.Proxy.NoProxyString = g.NoProxyString()
8688
c.V1.Sys.Service.ExternalFqdn = g.V1.GetFqdn()
8789

8890
if logLevel := g.GetV1().GetLog().GetLevel().GetValue(); logLevel != "" {

api/config/compliance/config_request.pb.go

+218-137
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

api/config/compliance/config_request.proto

+6-1
Original file line numberDiff line numberDiff line change
@@ -36,7 +36,7 @@ message ConfigRequest {
3636
reserved 8;
3737
reserved 9;
3838
Agent agent = 10;
39-
chef.automate.infra.config.Proxy proxy = 11;
39+
Proxy proxy = 11;
4040

4141
message Service {
4242
google.protobuf.StringValue host = 1 [deprecated=true]; // The listen host is no longer setable(localhost only)
@@ -45,6 +45,11 @@ message ConfigRequest {
4545
google.protobuf.Int32Value message_buffer_size = 8;
4646
}
4747

48+
message Proxy {
49+
google.protobuf.StringValue connection_string = 1;
50+
google.protobuf.StringValue no_proxy_string = 2;
51+
}
52+
4853
message Profiles {
4954
reserved 1;
5055
google.protobuf.BoolValue install_market_profiles = 2;

buf.yaml

+1
Original file line numberDiff line numberDiff line change
@@ -443,4 +443,5 @@ breaking:
443443
- external/compliance/reporting/reporting.proto
444444
- config/ui/config_request.proto
445445
- external/compliance/reporting/stats/stats.proto
446+
- config/compliance/config_request.proto
446447

-1.07 KB
Binary file not shown.

e2e/cypress/index.d.ts

-1
Original file line numberDiff line numberDiff line change
@@ -20,6 +20,5 @@ declare namespace Cypress {
2020
waitUntilNodemanagerNodeIsDeleted(nodeName: string): void
2121
waitUntilConfigMgmtNodeIsDeleted(clientRunsNodeId: string): void
2222
sendToDataCollector(report: any): void
23-
uploadFileRequest(fileToUpload: any, uniqueName: any, aliasName: any): void
2423
}
2524
}

e2e/cypress/integration/api/compliance/ssh_scan_job_proxy.spec.ts

-150
This file was deleted.

e2e/package.json

-1
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,6 @@
88
"cypress:local": "CYPRESS_BASE_URL=https://a2-dev.test CYPRESS_RUN_FLAKY=no cypress open",
99
"cypress:local:flaky": "CYPRESS_BASE_URL=https://a2-dev.test CYPRESS_RUN_FLAKY=yes cypress open",
1010
"cypress:run": "cypress run",
11-
"cypress:run:proxy": "CYPRESS_IS_PROXY_ENV=true cypress run --spec cypress/integration/api/compliance/ssh_scan_job_proxy.spec.ts",
1211
"cypress:record": "cypress run --record",
1312
"lint": "tslint -p tsconfig.json"
1413
},

integration/tests/proxy.sh

+1-32
Original file line numberDiff line numberDiff line change
@@ -19,27 +19,6 @@ do_deploy() {
1919
chef-automate license apply "$A2_LICENSE"
2020

2121
echo "127.0.0.1 ${CONTAINER_HOSTNAME}" >> /etc/hosts
22-
23-
timestamp=$(date +"%m-%d-%y-%H-%M")
24-
25-
log_info "generating admin token"
26-
if ! token=$(chef-automate iam token create "$timestamp-tok" --admin); then
27-
log_error "Non-zero exit code, output:"
28-
log_error "$token"
29-
return 1
30-
fi
31-
32-
export CYPRESS_ADMIN_TOKEN=$token
33-
export CYPRESS_RUN_FLAKY=$FLAKY
34-
35-
log_info "fixing dns resolution for '${CONTAINER_HOSTNAME}'"
36-
echo "127.0.0.1 ${CONTAINER_HOSTNAME}" >> /etc/hosts
37-
# shellcheck disable=SC2154
38-
proxyurl="http://${test_proxy_container_name}:3128"
39-
echo "export http_proxy=${proxyurl}" >> ~/.bashrc
40-
echo "export https_proxy=${proxyurl}" >> ~/.bashrc
41-
#shellcheck disable=SC1090
42-
source ~/.bashrc
4322
}
4423

4524
do_test_deploy() {
@@ -48,15 +27,5 @@ do_test_deploy() {
4827
source "${source_dir}/helpers/bldr_tests.sh"
4928

5029
do_test_deploy_default
51-
52-
log_info "running cypress in e2e"
53-
cd "${A2_ROOT_DIR}/e2e" || return 1
54-
export CYPRESS_SKIP_SSO=true
55-
export CYPRESS_BASE_URL="https://$CONTAINER_HOSTNAME"
56-
57-
npm install # get dependencies defined in e2e/package.json
58-
if ! npm run cypress:run:proxy; then
59-
buildkite-agent artifact upload "cypress/videos/*;cypress/videos/**/*;cypress/screenshots/*;cypress/screenshots/**/*"
60-
return 1
61-
fi
30+
bldr_smoke_test
6231
}

0 commit comments

Comments
 (0)