Revert "debian: stx-audit: port to debian"

This reverts commit 4b2004a95e526e8fdb837a28aac8d48f9b79997c.

Reason for revert: Introduced a new issue as reported in https://bugs.launchpad.net/starlingx/+bug/1972732

Closes-Bug: 1972732

Change-Id: I56353f8929175f2303a67fa3a748468d6a4655ef
This commit is contained in:
Ghada Khalil 2022-05-09 21:36:54 +00:00
parent 4b2004a95e
commit 22dce7343f
15 changed files with 11 additions and 78 deletions

View File

@ -1 +0,0 @@
stx-audit-helm

View File

@ -50,7 +50,7 @@ StarlingX Auditd Application FluxCD Helm Charts
%build
cd helm-charts
make VARIANTS=centos
make
cd -
# Create a chart tarball compliant with sysinv kube-app.py
@ -63,7 +63,7 @@ mkdir -p %{app_staging}
cp files/metadata.yaml %{app_staging}
cp manifests/auditd_manifest.yaml %{app_staging}
mkdir -p %{app_staging}/charts
cp helm-charts/.build/centos/*.tgz %{app_staging}/charts
cp helm-charts/*.tgz %{app_staging}/charts
cd %{app_staging}
# Populate metadata

View File

@ -1,4 +1,3 @@
BUILDER=docker
LABEL=stx-audit
DOCKER_CONTEXT=../stx-audit
DOCKER_FILE=../stx-audit/Dockerfile.centos
DOCKER_CONTEXT=docker/stx-audit

View File

@ -1 +0,0 @@
/tmp/

View File

@ -20,13 +20,13 @@ export STAGING = staging
override_dh_auto_build:
# Create the TGZ file.
cd helm-charts && make VARIANTS=debian
cd helm-charts && make
# Setup the staging directory.
mkdir -p $(STAGING)
cp files/metadata.yaml $(STAGING)
cp manifests/*.yaml $(STAGING)
mkdir -p $(STAGING)/charts
cp helm-charts/.build/debian/*.tgz $(STAGING)/charts
cp helm-charts/*.tgz $(STAGING)/charts
# Populate metadata.
sed -i 's/@APP_NAME@/$(APP_NAME)/g' $(STAGING)/metadata.yaml
sed -i 's/@APP_VERSION@/$(APP_VERSION)/g' $(STAGING)/metadata.yaml

View File

@ -1,4 +0,0 @@
BUILDER=docker
LABEL=stx-audit
DOCKER_CONTEXT=../stx-audit
DOCKER_FILE=../stx-audit/Dockerfile.debian

View File

@ -1 +0,0 @@
.build/

View File

@ -9,25 +9,11 @@
SHELL := /bin/bash
TASK := build
EXCLUDES := helm-toolkit doc tests tools logs tmp .build
EXCLUDES := helm-toolkit doc tests tools logs tmp
CHARTS := helm-toolkit $(filter-out $(EXCLUDES), $(patsubst %/.,%,$(wildcard */.)))
VARIANTS := centos debian
.PHONY: $(EXCLUDES) $(CHARTS)
# Usage: $(call helm-package,VARIANT,CHART_SRC_DIR)
# Build the specified variant of a chart by replacing
# "variant = ..." with VARIANT
define helm-package
{ \
rm -rf .build/$(1)/$(2) && \
mkdir -p .build/$(1) && \
cp -ar $(2) .build/$(1)/$(2) && \
sed -i 's#^\(\s*variant\s*:\s*\).*#\1'"$(1)"'#' .build/$(1)/$(2)/values.yaml && \
helm package -d .build/$(1) .build/$(1)/$(2) ; \
}
endef
all: $(CHARTS)
$(CHARTS):
@ -45,18 +31,13 @@ lint-%: init-%
if [ -d $* ]; then helm lint $*; fi
build-%:
if [ -d $* ]; then \
for variant in $(VARIANTS) ; do \
$(call helm-package,$$variant,$*) || exit 1 ; \
done ; \
fi
if [ -d $* ]; then helm package $*; fi
clean:
@echo "Clean all build artifacts"
rm -f */templates/_partials.tpl */templates/_globals.tpl
rm -f *tgz */charts/*tgz */requirements.lock
rm -rf */charts */tmpcharts
rm -rf .build
%:
@:

View File

@ -31,10 +31,3 @@ Create chart name and version as used by the chart label.
{{- define "audit.chart" -}}
{{- printf "%s-%s" .Chart.Name .Chart.Version | replace "+" "_" | trunc 63 | trimSuffix "-" -}}
{{- end -}}
{{/*
Define the image tag
*/}}
{{- define "audit.image.tag" -}}
{{ get .Values.image.tags .Values.variant }}
{{- end -}}

View File

@ -29,7 +29,7 @@ spec:
effect: NoSchedule
containers:
- name: {{ include "audit.name" . }}
image: '{{ .Values.image.repository }}:{{ include "audit.image.tag" . }}'
image: "{{ .Values.image.repository }}:{{ .Values.image.tag }}"
imagePullPolicy: {{ .Values.image.pullPolicy }}
securityContext:
privileged: true

View File

@ -2,16 +2,11 @@
# This is a YAML-formatted file.
# Declare variables to be passed into your templates.
# must match one of image.tags below
variant: centos
image:
repository: docker.io/starlingx/stx-audit
tag: stx.6.0-v1.0.3
pullPolicy: IfNotPresent
debug: ''
tags:
centos: stx.6.0-v1.0.3
debian: stx.6.0-v1.0.3
nameOverride: ""
fullnameOverride: ""

View File

@ -1,20 +0,0 @@
ARG BASE
FROM ${BASE} AS stx
ENV DEBIAN_FRONTEND=noninteractive
RUN rm -f /etc/apt/sources.list.d/*.list && \
cp /etc/apt/sources.list.d/debian.list.disabled /etc/apt/sources.list.d/debian.list && \
apt-get -y update && \
apt-get -y install auditd && \
apt-get -y clean && \
rm -rf /var/lib/apt/lists/*
COPY startAuditd.sh .
RUN mkdir -p /etc/audit && \
touch /etc/audit/audit.rules && \
chmod 600 /etc/audit/audit.rules
RUN chmod 755 startAuditd.sh
ENTRYPOINT ["./startAuditd.sh"]

12
tox.ini
View File

@ -22,11 +22,7 @@ whitelist_externals =
# Treat all E* codes as Errors rather than warnings using: -e 'E*'
commands =
bash -c "find {toxinidir} \
\( \
-type d \
\( -name .?\* -o -name tmp \) \
-prune \
\) \
-not \( -type d -name .?\* -prune \) \
-type f \
-not -name \*~ \
-not -name \*.md \
@ -45,11 +41,7 @@ basepython=python3
commands =
bash -c "find {toxinidir} \
\( \
-type d \
\( -name .?\* -o -name tmp \) \
-prune \
\) \
-name .tox -prune \
-o -type f -name '*.yaml' \
-print0 | xargs -0 yamllint -d relaxed -f parsable"