Skip to content

Commit 87379a1

Browse files
fix(remote): remote config and e2e tests
1 parent 981feaa commit 87379a1

File tree

10 files changed

+22
-16
lines changed

10 files changed

+22
-16
lines changed

Tiltfile

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -178,9 +178,8 @@ helm_resource(
178178
pod_readiness='ignore',
179179
flags=ac_flags,
180180
image_deps=['tilt.local/agent-control-dev', 'tilt.local/agent-control-cli-dev'],
181-
image_keys=[('agent-control-deployment.image.registry', 'agent-control-deployment.image.repository', 'agent-control-deployment.image.tag'),
182-
[('toolkitImage.registry', 'toolkitImage.repository', 'toolkitImage.tag'),
183-
('agent-control-cd.installer.image.registry', 'agent-control-cd.installer.image.repository', 'agent-control-cd.installer.image.tag')]],
181+
image_keys=[('agentControlDeployment.chartValues.image.registry', 'agentControlDeployment.chartValues.image.repository', 'agentControlDeployment.chartValues.image.tag'),
182+
[('toolkitImage.registry', 'toolkitImage.repository', 'toolkitImage.tag')]],
184183
resource_deps=ac_chart_deps
185184
)
186185

agent-control/src/opamp/remote_config.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@ pub mod signature;
1313
pub mod validators;
1414

1515
/// Identifier key for the primary agent configuration within the OpAMP [opamp_client::opamp::proto::AgentConfigMap].
16-
pub const DEFAULT_AGENT_CONFIG_IDENTIFIER: &str = "configAgent";
16+
pub const DEFAULT_AGENT_CONFIG_IDENTIFIER: &str = "agentConfig";
1717

1818
/// This structure represents the remote configuration that we would retrieve from a server via OpAMP.
1919
/// Contains identifying metadata and the actual configuration values

test/k8s-e2e/apm/e2e-apm.yml

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,7 @@ custom_test_key: appName
55
scenarios:
66
- description: Deploy SA with APM operator and Java, Python and Node.js agents
77
before:
8+
- echo The cluster name of the test is ${SCENARIO_TAG}
89
- cd ../../../ && SA_CHART_VALUES_FILE="test/k8s-e2e/apm/ac-values-apm.yml" CLUSTER=${SCENARIO_TAG} USE_LATEST_FLUX=${USE_LATEST_FLUX} tilt ci
910
# we need wait and retry since the resource might me not created yet
1011
- timeout 600s bash -c "until kubectl wait --for=jsonpath='{.status.readyReplicas}'=1 deploy/operator-k8s-agents-operator -n newrelic-agents; do sleep 5; echo waiting on operator ; done"
@@ -30,7 +31,7 @@ scenarios:
3031
after:
3132
- kubectl logs --tail=-1 -l app.kubernetes.io/name=agent-control --all-containers --prefix=true
3233
- kubectl logs --tail=-1 -l app.kubernetes.io/instance=operator --all-containers --prefix=true -n newrelic-agents
33-
- kubectl get all -o wide
34+
- kubectl get all -o wide --all-namespaces --show-labels
3435
- cd ../../../ && tilt down
3536
tests:
3637
nrqls:

test/k8s-e2e/collector/e2e-collector.yml

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -5,13 +5,14 @@ custom_test_key: k8s.cluster.name
55
scenarios:
66
- description: Deploy SA with single k8s otel-collector
77
before:
8+
- echo The cluster name of the test is ${SCENARIO_TAG}
89
- cd ../../../ && SA_CHART_VALUES_FILE="test/k8s-e2e/collector/ac-values-collector.yml" CLUSTER=${SCENARIO_TAG} USE_LATEST_FLUX=${USE_LATEST_FLUX} tilt ci
910
after:
1011
- kubectl logs --tail=-1 -l app.kubernetes.io/name=agent-control --all-containers --prefix=true
1112
- kubectl logs --tail=-1 -l app.kubernetes.io/name=nr-k8s-otel-collector --all-containers --prefix=true -n newrelic-agents
12-
- kubectl get all -o wide
13+
- kubectl get all -o wide --all-namespaces --show-labels
1314
- kubectl get secrets --show-labels
14-
- kubectl get all -o wide
15+
- kubectl get all -o wide --all-namespaces --show-labels
1516
- kubectl get helmrelease
1617
- kubectl get helmchart
1718
- helm list -a -A

test/k8s-e2e/custom-repo/e2e-custom-repo.yml

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,12 +7,13 @@ custom_test_key: cluster_name
77
scenarios:
88
- description: Asserts custom helm chart repo configuration works as expected
99
before:
10+
- echo The cluster name of the test is ${SCENARIO_TAG}
1011
- cd ../../../ && CHARTMUSEUM_BASIC_AUTH=true SA_CHART_VALUES_FILE="test/k8s-e2e/custom-repo/ac-values-custom-repo.yml" CLUSTER=${SCENARIO_TAG} USE_LATEST_FLUX=${USE_LATEST_FLUX} tilt ci
1112
after:
1213
- kubectl logs --tail=-1 -l app.kubernetes.io/name=agent-control --all-containers --prefix=true
1314
- kubectl logs --tail=-1 -l app.kubernetes.io/instance=prometheus --all-containers --prefix=true -n newrelic-agents
1415
- kubectl get secrets --show-labels
15-
- kubectl get all -o wide
16+
- kubectl get all -o wide --all-namespaces --show-labels
1617
- kubectl get helmrelease
1718
- kubectl get helmchart
1819
- helm list -a -A

test/k8s-e2e/dynamic/e2e-dynamic.yml

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,13 +5,14 @@ custom_test_key: cluster_name
55
scenarios:
66
- description: Deploy all infra agents
77
before:
8+
- echo The cluster name of the test is ${SCENARIO_TAG}
89
- kubectl create configmap dynamic-agent --from-file=logging=./dynamic-agent-type-logging.yml
910
- cd ../../../ && SA_CHART_VALUES_FILE="test/k8s-e2e/dynamic/ac-values-dynamic.yml" CLUSTER=${SCENARIO_TAG} USE_LATEST_FLUX=${USE_LATEST_FLUX} tilt ci
1011
after:
1112
- kubectl logs --tail=-1 -l app.kubernetes.io/name=agent-control --all-containers --prefix=true
1213
- kubectl logs --tail=-1 -l app.kubernetes.io/name=newrelic-logging --all-containers --prefix=true -n newrelic-agents
1314
- kubectl get secrets --show-labels
14-
- kubectl get all -o wide
15+
- kubectl get all -o wide --all-namespaces --show-labels
1516
- kubectl get helmrelease
1617
- kubectl get gitrepository
1718
- kubectl get helmchart

test/k8s-e2e/ebpf/e2e-ebpf.yml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,7 @@ custom_test_key: k8s.cluster.name
55
scenarios:
66
- description: Deploy eBPF Agent
77
before:
8+
- echo The cluster name of the test is ${SCENARIO_TAG}
89
- cd ../../../ && SA_CHART_VALUES_FILE="test/k8s-e2e/ebpf/ac-values-ebpf.yml" CLUSTER=${SCENARIO_TAG} USE_LATEST_FLUX=${USE_LATEST_FLUX} tilt ci
910
after:
1011
- kubectl logs --tail=-1 -l app.kubernetes.io/name=agent-control --all-containers --prefix=true

test/k8s-e2e/fleet-control/e2e-fleet-control.yml

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -5,15 +5,15 @@ custom_test_key: cluster_name
55
scenarios:
66
- description: Deploy all infra agents
77
before:
8+
- echo The cluster name of the test is ${SCENARIO_TAG}
89
- kubectl get secret sys-identity || kubectl create secret generic sys-identity --from-literal=CLIENT_ID="${NR_SYSTEM_IDENTITY_CLIENT_ID}" --from-literal=private_key="${NR_SYSTEM_IDENTITY_PRIVATE_KEY}"
910
- cd ../../../ && SA_CHART_VALUES_FILE="test/k8s-e2e/fleet-control/ac-values-fleet-control.yml" CLUSTER=${SCENARIO_TAG} USE_LATEST_FLUX=${USE_LATEST_FLUX} tilt ci
1011
after:
1112
- kubectl logs --tail=-1 -l app.kubernetes.io/name=agent-control --all-containers --prefix=true
12-
- kubectl logs --tail=-1 -l app.kubernetes.io/instance=infra --all-containers --prefix=true -n newrelic-agents
13-
- kubectl logs --tail=-1 -l app.kubernetes.io/instance=prometheus --all-containers --prefix=true -n newrelic-agents
14-
- kubectl logs --tail=-1 -l app.kubernetes.io/name=newrelic-logging --all-containers --prefix=true -n newrelic-agents
13+
- kubectl logs --tail=-1 -l app.kubernetes.io/instance=nr-infra --all-containers --prefix=true -n newrelic-agents
1514
- kubectl get secrets --show-labels
16-
- kubectl get all -o wide
15+
- kubectl get configmap
16+
- kubectl get all -o wide --all-namespaces --show-labels
1717
- kubectl get helmrelease
1818
- kubectl get helmchart
1919
- helm list -a -A

test/k8s-e2e/infra/e2e-infra.yml

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -5,14 +5,15 @@ custom_test_key: cluster_name
55
scenarios:
66
- description: Deploy all infra agents
77
before:
8+
- echo The cluster name of the test is ${SCENARIO_TAG}
89
- cd ../../../ && SA_CHART_VALUES_FILE="test/k8s-e2e/infra/ac-values-infra.yml" CLUSTER=${SCENARIO_TAG} USE_LATEST_FLUX=${USE_LATEST_FLUX} tilt ci
910
after:
1011
- kubectl logs --tail=-1 -l app.kubernetes.io/name=agent-control --all-containers --prefix=true
11-
- kubectl logs --tail=-1 -l app.kubernetes.io/instance=infra --all-containers --prefix=true -n newrelic-agents
12+
- kubectl logs --tail=-1 -l app.kubernetes.io/instance=nr-infra --all-containers --prefix=true -n newrelic-agents
1213
- kubectl logs --tail=-1 -l app.kubernetes.io/instance=prometheus --all-containers --prefix=true -n newrelic-agents
1314
- kubectl logs --tail=-1 -l app.kubernetes.io/name=newrelic-logging --all-containers --prefix=true -n newrelic-agents
1415
- kubectl get secrets --show-labels
15-
- kubectl get all -o wide
16+
- kubectl get all -o wide --all-namespaces --show-labels
1617
- kubectl get helmrelease
1718
- kubectl get helmchart
1819
- helm list -a -A

test/k8s-e2e/proxy/e2e-proxy.yml

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,7 @@ custom_test_key: cluster_name
55
scenarios:
66
- description: Deploy all infra agents
77
before:
8+
- echo The cluster name of the test is ${SCENARIO_TAG}
89
# Deploys a Networkpolicy that forces all external req to go through the proxy in the current namespace.
910
- kubectl apply -f ./proxy.yaml
1011
- kubectl wait --for=condition=complete --timeout=60s job/assert-policy-proxy
@@ -22,7 +23,7 @@ scenarios:
2223
- kubectl logs --tail=-1 -l job-name=agent-control-generate-system-identity --all-containers --prefix=true
2324
- kubectl get secrets --show-labels
2425
- kubectl get pods -o yaml
25-
- kubectl get all -o wide --show-labels
26+
- kubectl get all -o wide --all-namespaces --show-labels
2627
- kubectl get helmrelease
2728
- kubectl get helmchart
2829
- helm list -a -A

0 commit comments

Comments
 (0)