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

Print EULA in osm-metrics-agents containers #156

Open
wants to merge 1 commit into
base: main
Choose a base branch
from
Open
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
21 changes: 21 additions & 0 deletions charts/osm-arc/templates/metrics-agent-deployment.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,8 @@ spec:
containers:
- name: mdm
image: linuxgeneva-microsoft.azurecr.io/genevamdm:master_20220401.1
command: ["/bin/echo"]
args: ["$(EULA_CONTENT)"]
imagePullPolicy: IfNotPresent
resources:
requests:
Expand All @@ -40,11 +42,16 @@ spec:
value: statsd_udp,statsd_tcp
- name: MDM_LOG_LEVEL
value: "Info"
- name: EULA_CONTENT
value: |-
{{ .Values.OpenServiceMesh.eulaContent | indent 16 }}
volumeMounts:
- name: mdm-config
mountPath: /tmp/geneva_mdm
- name: msi-adapter
image: mcr.microsoft.com/azurearck8s/msi-adapter:1.0.0
command: ["/bin/echo"]
args: ["$(EULA_CONTENT)"]
imagePullPolicy: IfNotPresent
resources:
requests:
Expand All @@ -68,12 +75,17 @@ spec:
value: "true"
- name: TEST_MODE
value: "false"
- name: EULA_CONTENT
value: |-
{{ .Values.OpenServiceMesh.eulaContent | indent 16 }}
securityContext:
capabilities:
add:
- NET_ADMIN
- name: prom-mdm-converter
image: upstreamarc.azurecr.io/prom-mdm-converter:v1.0.0
command: ["/bin/echo"]
args: ["$(EULA_CONTENT)"]
imagePullPolicy: IfNotPresent
resources:
requests:
Expand All @@ -91,8 +103,13 @@ spec:
value: AzureServiceMesh
- name: EXTENSION_RESOURCE_ID
value: {{ .Values.Azure.Extension.ResourceId }}
- name: EULA_CONTENT
value: |-
{{ .Values.OpenServiceMesh.eulaContent | indent 16 }}
- name: telegraf
image: mcr.microsoft.com/oss/mirror/docker.io/library/telegraf:1.21
command: ["/bin/echo"]
args: ["$(EULA_CONTENT)"]
imagePullPolicy: IfNotPresent
resources:
requests:
Expand All @@ -105,6 +122,10 @@ spec:
- name: telegraf-conf
mountPath: /etc/telegraf/telegraf.conf
subPath: telegraf.conf
env:
- name: EULA_CONTENT
value: |-
{{ .Values.OpenServiceMesh.eulaContent | indent 16 }}
volumes:
- name: mdm-config
configMap:
Expand Down
5 changes: 5 additions & 0 deletions charts/osm-arc/values.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,11 @@ Azure:
OpenServiceMesh:
ignoreNamespaces: "kube-system azure-arc arc-osm-system"
testedDistros: "aks gke eks openshift rancher_rke"
eulaContent: |-
MICROSOFT SOFTWARE LICENSE TERMS
MICROSOFT Azure Arc for Kubernetes
__________________________________
This software is licensed to you as part of your or your company's subscription license for Microsoft Azure Services. You may only use the software with Microsoft Azure Services and subject to the terms and conditions of the agreement under which you obtained Microsoft Azure Services. If you do not have an active subscription license for Microsoft Azure Services, you may not use the software. Microsoft Azure Legal Information: https://azure.microsoft.com/en-us/support/legal/

osm:
osm:
Expand Down
20 changes: 20 additions & 0 deletions test/bats/test.bats
Original file line number Diff line number Diff line change
Expand Up @@ -62,6 +62,26 @@ ARC_CLUSTER=${ARC_CLUSTER:-true}
assert_success
}

@test "mdm container printed EULA" {
run wait_for_process $WAIT_TIME $SLEEP_TIME "kubectl logs -n arc-osm-system -l app=osm-metrics-agent -c mdm | grep -q \"MICROSOFT SOFTWARE LICENSE TERMS\""
assert_success
}

@test "msi-adapter container printed EULA" {
run wait_for_process $WAIT_TIME $SLEEP_TIME "kubectl logs -n arc-osm-system -l app=osm-metrics-agent -c msi-adapter | grep -q \"MICROSOFT SOFTWARE LICENSE TERMS\""
assert_success
}

@test "telegraf container printed EULA" {
run wait_for_process $WAIT_TIME $SLEEP_TIME "kubectl logs -n arc-osm-system -l app=osm-metrics-agent -c telegraf | grep -q \"MICROSOFT SOFTWARE LICENSE TERMS\""
assert_success
}

@test "prom-mdm-converter container printed EULA" {
run wait_for_process $WAIT_TIME $SLEEP_TIME "kubectl logs -n arc-osm-system -l app=osm-metrics-agent -c prom-mdm-converter | grep -q \"MICROSOFT SOFTWARE LICENSE TERMS\""
assert_success
}

@test "mutating webhook has been deployed" {
run wait_for_process $WAIT_TIME $SLEEP_TIME "kubectl get mutatingwebhookconfigurations.admissionregistration.k8s.io arc-osm-webhook-osm"
assert_success
Expand Down