Conversation
4ecf902 to
0c3987a
Compare
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: 0c3987a7e7
ℹ️ About Codex in GitHub
Codex has been enabled to automatically review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
When you sign up for Codex through ChatGPT, Codex can also answer questions or update the PR, like "@codex address that feedback".
| # yum has a default retry of 10 https://github.com/Distrotech/yum/blob/f4e54aeed297158c563828aa3ebb93d0c8ce7e38/docs/yum.conf.5#L364-L366 | ||
| $sudo_cmd bash -c "SYSTEMD_OFFLINE=${SYSTEMD_OFFLINE:-0} DATADOG_TRACE_ID=${DATADOG_TRACE_ID} DATADOG_PARENT_ID=${DATADOG_PARENT_ID} yum -y --disablerepo='*' --enablerepo='datadog' install $dnf_flag ${packages[*]}" 2> >($sudo_cmd tee /tmp/ddog_install_error_msg >&2) || $sudo_cmd bash -c "SYSTEMD_OFFLINE=${SYSTEMD_OFFLINE:-0} yum -y install $dnf_flag ${packages[*]}" 2> >($sudo_cmd tee /tmp/ddog_install_error_msg >&2) | ||
| if [ -n "$DD_OTELCOLLECTOR_ENABLED" ]; then | ||
| $sudo_cmd bash -c "SYSTEMD_OFFLINE=${SYSTEMD_OFFLINE:-0} DATADOG_TRACE_ID=${DATADOG_TRACE_ID} DATADOG_PARENT_ID=${DATADOG_PARENT_ID} DD_INSTALLER_REGISTRY_URL=${DD_INSTALLER_REGISTRY_URL} yum -y --disablerepo='*' --enablerepo='datadog' install $dnf_flag ${packages[*]}" 2> >($sudo_cmd tee /tmp/ddog_install_error_msg >&2) || $sudo_cmd bash -c "SYSTEMD_OFFLINE=${SYSTEMD_OFFLINE:-0} DD_INSTALLER_REGISTRY_URL=${DD_INSTALLER_REGISTRY_URL} yum -y install $dnf_flag ${packages[*]}" 2> >($sudo_cmd tee /tmp/ddog_install_error_msg >&2) |
There was a problem hiding this comment.
Do we also need to set DD_INSTALLER_REGISTRY_URL_AGENT_PACKAGE on the install commands? We're using DD_INSTALLER_REGISTRY_URL_AGENT_PACKAGE for ddot_oci_registry but this env var isn't passed to the install commands. So if DD_INSTALLER_REGISTRY_URL_AGENT_PACKAGE is set without DD_INSTALLER_REGISTRY_URL, we get the following error in upgrades/downgrades:
could not download image using install.datadoghq.com/agent-package:7.78.0-rc.2-1: GET https://install.datadoghq.com/v2/agent-package/manifests/7.78.0-rc.2-1: unexpected status code 404 Not Found: <?xml version="1.0" encoding="UTF-8"?>
<Error><Code>NoSuchKey</Code><Message>The specified key does not exist.</Message><Key>v2/agent-package/manifests/7.78.0-rc.2-1</Key><RequestId>EKNAE187CXD0RGH9</RequestId><HostId>zKo74kJNoNUgVjJfMUt7hjw+WGUoiyZ4lbB2E1x04XKbAhoiLxEKmqDos7a+qyZYXffbCInF2bI=</HostId></Error>
could not download image using install.datadoghq.com/agent-package:7.78.0-rc.2-1: GET https://gcr.io/v2/datadoghq/agent-package/manifests/7.78.0-rc.2-1: MANIFEST_UNKNOWN: Failed to fetch "7.78.0-rc.2-1"
failed to restore extensions: could not install extensions: could not download package: could not download package: could not download image from any registry: could not download image using install.datadoghq.com/agent-package:7.78.0-rc.2-1: GET https://install.datadoghq.com/v2/agent-package/manifests/7.78.0-rc.2-1: unexpected status code 404 Not Found: <?xml version="1.0" encoding="UTF-8"?>
<Error><Code>NoSuchKey</Code><Message>The specified key does not exist.</Message><Key>v2/agent-package/manifests/7.78.0-rc.2-1</Key><RequestId>EKNAE187CXD0RGH9</RequestId><HostId>zKo74kJNoNUgVjJfMUt7hjw+WGUoiyZ4lbB2E1x04XKbAhoiLxEKmqDos7a+qyZYXffbCInF2bI=</HostId></Error>; could not download image using install.datadoghq.com/agent-package:7.78.0-rc.2-1: GET https://gcr.io/v2/datadoghq/agent-package/manifests/7.78.0-rc.2-1: MANIFEST_UNKNOWN: Failed to fetch "7.78.0-rc.2-1"
W: --force-yes is deprecated, use one of the options starting with --allow instead.
| else | ||
| echo -e " \033[33mInstalling package(s): ${packages[*]}\n\033[0m" | ||
| fi | ||
|
|
There was a problem hiding this comment.
Did some testing and found that the rpm -> oci upgrade was failing
| # When upgrading to 7.78+, DDOT is managed via OCI extension install. | |
| # Remove the legacy datadog-agent-ddot RPM first to avoid strict version | |
| # dependency conflicts that prevent yum from upgrading datadog-agent. | |
| if [ -n "$ddot_use_installer" ] && rpm -q datadog-agent-ddot &>/dev/null; then | |
| echo -e " \033[33mRemoving legacy datadog-agent-ddot RPM package before upgrade...\n\033[0m" | |
| $sudo_cmd yum -y remove datadog-agent-ddot | |
| fi |
Bug
For Agent >= 7.78.0, DDOT is installed by the Agent's own post-install script rather than the install script. The previous fix (#406) handled this by unsetting `DD_OTELCOLLECTOR_ENABLED`, which caused two regressions:
Why not pass DD_OTELCOLLECTOR_ENABLED to the package manager?
An intermediate approach passed `DD_OTELCOLLECTOR_ENABLED` to the `apt-get`/`yum`/`zypper` install command so the Agent's post-install script could pick it up. This failed because the Agent post-install runs before the install script creates `datadog.yaml`, causing:
Fix
For Agent >= 7.78.0, instead of relying on the Agent post-install script:
For Agent < 7.78.0, behavior is unchanged: the `datadog-agent-ddot` package is installed from the dedicated apt/yum/zypper repo, and `update_ddot`/`manage_otel_config` run as before.
Test plan