fluentd: there is no 'td-agent' for Debian/x86-64

As there is no 'td-agent' package image build fails on 'x86-64'.

We have to wait for TD Agent 4.

Change-Id: I03d38628eee0f0823a58cba3a70df22f29022956
This commit is contained in:
Marcin Juszkiewicz 2019-08-16 13:12:31 +02:00
parent be2bc66866
commit f4e0bbd3fb
2 changed files with 8 additions and 12 deletions

View File

@ -5,6 +5,8 @@ LABEL maintainer="{{ maintainer }}" name="{{ image_name }}" build-date="{{ build
{% import "macros.j2" as macros with context %}
{% set fluentd_user = 'fluentd' %}
{% if base_package_type == 'rpm' %}
{{ macros.configure_user(name='fluentd', groups='mysql') }}
@ -32,7 +34,8 @@ LABEL maintainer="{{ maintainer }}" name="{{ image_name }}" build-date="{{ build
'ruby',
'ruby-dev',
] %}
{% if base_arch == 'x86_64' %}
{% if base_arch == 'x86_64' and base_distro == 'ubuntu' %}
{% set fluentd_user = 'td-agent' %}
{{ macros.configure_user(name='td-agent', groups='mysql') }}
{% set fluentd_packages = fluentd_packages + [
'td-agent'
@ -45,10 +48,6 @@ LABEL maintainer="{{ maintainer }}" name="{{ image_name }}" build-date="{{ build
{{ macros.install_packages(fluentd_packages | customizable("packages")) }}
{% if base_package_type == 'deb' and base_arch != 'x86_64' %}
RUN /usr/bin/gem install fluentd --no-rdoc --no-ri
{% endif %}
# Distro specific files and operations
{% if base_package_type == 'rpm' %}
COPY rpm_fluentd_sudoers /etc/sudoers.d/kolla_fluentd_sudoers
@ -56,13 +55,14 @@ RUN chmod 440 /etc/sudoers.d/kolla_fluentd_sudoers \
&& mkdir -p /var/run/fluentd \
&& chown -R fluentd: /etc/fluentd /var/run/fluentd
{% elif base_package_type == 'deb' %}
{% if base_arch == 'x86_64' %}
{% if base_arch == 'x86_64' and base_distro == 'ubuntu' %}
COPY fluentd_sudoers /etc/sudoers.d/kolla_fluentd_sudoers
RUN chmod 440 /etc/sudoers.d/kolla_fluentd_sudoers \
&& sed -i -e "s/USER=td-agent/USER=root/" -e "s/GROUP=td-agent/GROUP=root/" /etc/init.d/td-agent \
&& rm -f /etc/td-agent/td-agent.conf \
&& chown -R td-agent: /etc/td-agent
{% else %}
RUN /usr/bin/gem install fluentd --no-rdoc --no-ri
COPY rpm_fluentd_sudoers /etc/sudoers.d/kolla_fluentd_sudoers
RUN chmod 440 /etc/sudoers.d/kolla_fluentd_sudoers \
&& mkdir -p /etc/fluentd \
@ -106,8 +106,4 @@ RUN tar -xvf /tmp/fluentd-monasca.tar.gz -C /tmp \
{% block fluentd_footer %}{% endblock %}
{% block footer %}{% endblock %}
{% if base_package_type == 'rpm' or (base_package_type == 'deb' and base_arch != 'x86_64') %}
USER fluentd
{% elif base_package_type == 'deb' and base_arch == 'x86_64' %}
USER td-agent
{% endif %}
USER {{ fluentd_user }}

View File

@ -111,7 +111,7 @@ RUN apt-get update \
{%- if base_distro in ['centos', 'oraclelinux', 'rhel'] -%}
ulimit -n 65536 && gem install --minimal-deps {{ plugins | join(' ') }}
{%- elif base_distro in ['debian', 'ubuntu'] -%}
{%- if base_arch == 'x86_64' -%}
{%- if base_arch == 'x86_64' and base_distro == 'ubuntu' -%}
ulimit -n 65536 && td-agent-gem install {{ plugins | join(' ') }}
{%- else -%}
ulimit -n 65536 && gem install --minimal-deps {{ plugins | join(' ') }}