Skip to content

Commit

Permalink
Fix envvar subsitution in config files
Browse files Browse the repository at this point in the history
PyYaml 5.1 regression doesnt resolve envvars in configuration files
Fix bz 1688647
  • Loading branch information
Josef Karasek committed Mar 29, 2019
1 parent 6b6dc15 commit becc6dd
Show file tree
Hide file tree
Showing 3 changed files with 14 additions and 5 deletions.
3 changes: 2 additions & 1 deletion curator/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,8 @@ RUN if [ -n "${LOCAL_REPO}" ] ; then \
curl -s -o /etc/yum.repos.d/local.repo ${LOCAL_REPO} ; \
fi

RUN INSTALL_PKGS="elastic-curator-${CURATOR_VER} \
RUN INSTALL_PKGS="python2-pyyaml-3.12-11 \
elastic-curator-${CURATOR_VER} \
python2-ruamel-yaml" && \
yum install -y --setopt=tsflags=nodocs $INSTALL_PKGS && \
rpm -V ${INSTALL_PKGS} && \
Expand Down
2 changes: 1 addition & 1 deletion curator/Dockerfile.centos7
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ RUN yum install -y epel-release && \
rpm --import https://packages.elastic.co/GPG-KEY-elasticsearch
RUN yum install -y --setopt=tsflags=nodocs \
python-pip && \
pip install --no-cache-dir 'ruamel.yaml<=0.15' elasticsearch-curator==${CURATOR_VER} && \
pip install --no-cache-dir 'pyyaml==3.12' 'ruamel.yaml<=0.15' elasticsearch-curator==${CURATOR_VER} && \
yum clean all

COPY run.sh lib/oalconverter/* ${HOME}/
Expand Down
14 changes: 11 additions & 3 deletions curator/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -99,9 +99,6 @@ months from that date.
If you want to be exact with curator, it is best to use `days` e.g. `delete: days: 31`
[Curator issue](https://github.com/elastic/curator/issues/569)

### Compatibility with OpenShift 3.7
In earlier releases admins could control the timezone and time when curator runs from the curator config. This configuration has been moved to openshift-ansible. The [timezone is not currently configurable](https://github.com/kubernetes/kubernetes/issues/47202), instead the timezone of OpenShift master node is used.

### Using actions file
OpenShift custom config file format ensures that important internal indices don't get deleted by mistake. In order to use the actions file add an [exclude](https://www.elastic.co/guide/en/elasticsearch/client/curator/5.2/fe_exclude.html) rule to your configuration to retain these indices. You also need to manually add all the other patterns, see action 3 in the below example:
```
Expand Down Expand Up @@ -209,3 +206,14 @@ oc patch cronjob logging-curator -p '{"spec":{"schedule":"0 0 * * *"}}'
# this
oc create job --from=cronjob/logging-curator <job_name>
```

#### Hacking on oalconverter
Create virtual environment
```
virtualenv dev
source dev/bin/activate
```
Edit `.py` files and run tests
```
python setup.py test
```

0 comments on commit becc6dd

Please sign in to comment.