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

Import master to stable-1.5 #509

Merged
merged 96 commits into from
Oct 27, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
96 commits
Select commit Hold shift + click to select a range
69d73b7
Fixes for 17.0 ir script (#380)
csibbitt Oct 14, 2022
1dc0808
Move the SNMP trap delivery checks (#381)
leifmadsen Oct 20, 2022
1560d3c
Lock the bundle to OCP v4.10 (#385)
leifmadsen Oct 28, 2022
af35714
Make all certs 8yr expiry
csibbitt Nov 7, 2022
bc71384
Revert "Make all certs 8yr expiry"
csibbitt Nov 7, 2022
4b5d7a1
Make all certs 8yr expiry (#387)
csibbitt Nov 10, 2022
729f841
Expand support for OCP 4.11 (#391)
leifmadsen Nov 18, 2022
f097977
Force SGO checkout during build (#388)
csibbitt Nov 22, 2022
6811894
Update oc to 4.11 in jenkins agent (#393)
csibbitt Nov 22, 2022
e50f057
Remove OperatorHub.io as a CatalogSource (#394)
leifmadsen Nov 24, 2022
37dceed
Changes for 4.12 (#401)
csibbitt Jan 24, 2023
73fbb73
Remove Loki from stf-run-ci (#405)
vyzigold Feb 23, 2023
7687cd7
GHA checkout action v2 is deprecated (#407)
leifmadsen Feb 28, 2023
16324bc
Implement SNMPtrap delivery controls (#404)
leifmadsen Feb 28, 2023
aa12146
Implement changes for operator-sdk-1.26.0 testing (#411)
leifmadsen Mar 3, 2023
71ac4dd
Expose ability to set certificate renewal target times (#406)
vkmc Mar 6, 2023
e3a1125
Fix default CA cert lifetime values in stf-run-ci (#414)
csibbitt Mar 8, 2023
7c66ed8
fix/client version mismatch (#415)
leifmadsen Mar 8, 2023
4d2f348
Allow oc client version override for Jenkins agent (#416)
leifmadsen Mar 9, 2023
007f005
Update CatalogSource for Prometheus Operator deployment (#419)
leifmadsen Apr 5, 2023
45baeb4
Fix path to right collectd service template file for OSP 13 (#418)
JoaquinVeira Apr 17, 2023
c1716a9
Latest oauth-proxy with bcrypt (#420)
csibbitt Apr 25, 2023
ea5616c
[jenkins] Add custom context labels for github build status notificat…
elfiesmelfie May 8, 2023
da4d091
Observability Operator for Prometheus & Alertmanager (#421)
csibbitt May 8, 2023
9785fa7
Use stable-v1 cert-manager in CI for OCP >= 4.12 (#424)
csibbitt May 9, 2023
ee571fe
Pinning prometheus version to ease migration to OBO (#425)
csibbitt May 9, 2023
ffd3dbf
Fix auto-reversion to use_community (#427)
csibbitt May 15, 2023
c5f7c7b
Fix duplicate alarm expressions (#426)
csibbitt May 15, 2023
13370ad
[zuul] Create zuul no-op job to test integration (#431)
elfiesmelfie Jun 2, 2023
153bdb1
Allow bundle deploy from unauth'd repo (#437)
leifmadsen Jun 7, 2023
e30efa0
Manage Operator dependencies with properties.yaml (#423)
leifmadsen Jun 12, 2023
9eacaf4
Use the proper parameter for SNMP timeout (#435)
leifmadsen Jun 13, 2023
5678f64
Support External Elasticsearch (#439)
csibbitt Jul 7, 2023
10bf140
Fix bug with supplied user.crt/key not persisting (#442)
csibbitt Jul 12, 2023
483f898
Test with "external" elasticsearch (#441)
csibbitt Jul 13, 2023
f88fa19
Revert cert-manager channel to "tech-preview" (#444)
vkmc Jul 25, 2023
0dfe245
Fix infinite reconcile loop (#445)
leifmadsen Aug 25, 2023
6bf4784
Add checks for not set sto and sgo bundle paths (#447)
vkmc Sep 4, 2023
3549d5b
Bump compatibility from 4.10-4.12 to 4.10-4.14 (#448)
csibbitt Sep 5, 2023
cd216c0
Allow Grafana management in all observability modes (#449)
leifmadsen Sep 7, 2023
266fc3e
Add tests/infrared/17.1 (#440)
leifmadsen Sep 11, 2023
627db78
Corrected Hugepages alert summary to match severity (#451)
enothen Sep 11, 2023
9a6142d
[stf-run-ci] Update vars in README (#459)
elfiesmelfie Sep 13, 2023
29460aa
Update Dockerfile to create epel repo config when NO_PROXY is undefin…
elfiesmelfie Sep 13, 2023
1d9acc7
Add basic README for OSP 17.1 test deployment (#456)
leifmadsen Sep 13, 2023
0d1c4da
Use fully qualified apiVersion on Routes (#453)
csibbitt Sep 13, 2023
f490a9f
Clean up dependency installation in stf-run-ci (#455)
leifmadsen Sep 13, 2023
0d0dbec
Fix static namespace reference (#464)
leifmadsen Sep 14, 2023
e04c521
[ansible-lint] Use fqcn for modules (#457)
elfiesmelfie Sep 14, 2023
bf93f82
[stf-run-ci] Update pre-flight checks to be time-limited (#461)
elfiesmelfie Sep 14, 2023
19f2505
Expose operator_sdk versions used in CI (#466)
vkmc Sep 15, 2023
92c7a8b
Remove registry access config tags (#446)
vkmc Sep 18, 2023
d41edf4
generate_bundle: add logging (#463)
elfiesmelfie Sep 18, 2023
aa95e09
Improve logging (#471)
elfiesmelfie Sep 19, 2023
59a40d2
Relax pod admission controls when using a local catalog index (#450)
csibbitt Sep 19, 2023
a4b4b7a
[stf-run-ci] Update pull_secret check for running bundles (#474)
elfiesmelfie Sep 21, 2023
dcf6964
Install ObO during index-based deployments (#472)
leifmadsen Sep 21, 2023
3765a65
Update 17.1 helper scripts README (#476)
leifmadsen Sep 21, 2023
805ada4
[issue#306] Add missing ClusterRoles (#465)
elfiesmelfie Sep 21, 2023
1f6aa2c
[stf-run-ci] Use {{ base_dir }} instead of relative paths (#460)
elfiesmelfie Sep 22, 2023
9dbcf3b
[stf-run-ci] Update base_dir in setup_stf_local_build.yml (#478)
elfiesmelfie Sep 25, 2023
48aad2e
[stf-run-ci] Add timeout to validate deployment (#477)
elfiesmelfie Sep 26, 2023
0b33d76
Adjust the default scrape interval (#454)
leifmadsen Sep 26, 2023
e20f8a5
[stf-run-ci] Add requirements.txt (#484)
elfiesmelfie Sep 26, 2023
18e9161
Add local generation difference check (#482)
leifmadsen Sep 26, 2023
761bd9a
Bump origin-ansible-operator base image (#487)
leifmadsen Sep 26, 2023
76156cc
Remove logs API interface from STF (#483)
leifmadsen Sep 27, 2023
bb46012
Reduce the Ceilometer pollsters in helper script (#489)
leifmadsen Sep 27, 2023
511a94f
[zuul] Add base job for testing with zuul (#479)
elfiesmelfie Sep 27, 2023
eea83b3
Move the metrics_result retrieve (#493)
leifmadsen Sep 28, 2023
624776e
Increase sensubility smart-gateway ring buffer (#490)
leifmadsen Sep 28, 2023
48f452f
Disable event pipeline management (#491)
leifmadsen Sep 28, 2023
30461a8
[zuul] Use include_vars in prepare stage (#496)
elfiesmelfie Sep 29, 2023
be41737
Initial changes for QDR basicAuth (#481)
csibbitt Sep 29, 2023
713be16
[zuul] use 'service-telemetry' as namespace (#497)
elfiesmelfie Sep 29, 2023
fe97f48
Add var to set QDR auth to none (#498)
elfiesmelfie Sep 29, 2023
79d8968
[zuul] Add a job that does a local build and deploys an STF object (#…
elfiesmelfie Oct 3, 2023
863f459
Bump requests from 2.27.1 to 2.31.0 in /build/stf-run-ci (#486)
dependabot[bot] Oct 5, 2023
0dd478b
Use vars for registry image container name (#452)
csibbitt Oct 9, 2023
6517ac5
[stf-run-ci] Generate extra logs if preflight checks fail (#500)
elfiesmelfie Oct 11, 2023
0a0065d
Bump oauthlib from 3.2.0 to 3.2.2 in /build/stf-run-ci (#485)
dependabot[bot] Oct 11, 2023
1823727
[stf-run-ci][create_catalog] Swap query for a command task (#470)
elfiesmelfie Oct 11, 2023
ad37387
Add requires infrastructure annotations (#499)
leifmadsen Oct 12, 2023
d7f1708
[stf-collect-logs] Add a role for log collection (#488)
elfiesmelfie Oct 17, 2023
542ac47
[zuul] Add job to deploy from nightly bundles (#494)
elfiesmelfie Oct 17, 2023
7c61bbd
Next release of STF will start at OCP 4.11 (#503)
leifmadsen Oct 17, 2023
c9df561
Update base image to pass security scans (#502)
leifmadsen Oct 18, 2023
7eb2862
Cluster Observability Operator dependency (#504)
leifmadsen Oct 20, 2023
cab5a60
[better_logging] Show generate_bundle log when task fails (#501)
elfiesmelfie Oct 24, 2023
23eb686
Don't deploy events SGs by default (#506)
leifmadsen Oct 24, 2023
bc245eb
Adjust CR annotation to matchdefault scrape interval
leifmadsen Oct 24, 2023
5786978
Fix bundle check test (#507)
leifmadsen Oct 25, 2023
03a1589
Update path to internal TLS CA (#508)
leifmadsen Oct 25, 2023
2403533
Merge branch 'master' into import/stf153
leifmadsen Oct 26, 2023
8693f46
Use stable-1.5 channel in the stable-1.5 branch
leifmadsen Oct 26, 2023
e50dc5f
Drop .zuul.yaml for the stable-1.5 branch
leifmadsen Oct 27, 2023
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
48 changes: 45 additions & 3 deletions .github/workflows/main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,8 @@ name: CI
on: push

jobs:
linting:
name: Linting
operator-linting:
name: Operator Linting
runs-on: ubuntu-20.04
steps:
- name: Checkout code
Expand All @@ -16,11 +16,53 @@ jobs:
run: ansible-galaxy collection install operator_sdk.util

- name: Install ansible-lint
run: pip install 'ansible-lint < 6.0.0'
run: python -m pip install 'ansible-lint < 6.0.0'

- name: Lint Ansible roles/servicetelemetry/ directory
run: ${HOME}/.local/bin/ansible-lint roles/servicetelemetry

stf-run-ci-linting:
name: stf-run-ci Linting
runs-on: ubuntu-latest
steps:
- name: Checkout code
uses: actions/checkout@v3

- name: Install Ansible
run: python -m pip install 'ansible'

- name: Install ansible-lint
run: python -m pip install 'ansible-lint'

- name: Lint Ansible build/stf-run-ci directory
run: ${HOME}/.local/bin/ansible-lint .
working-directory: ./build/stf-run-ci

generate-bundle-diff-check:
name: Check if generating the bundle would result in local changes
runs-on: ubuntu-latest
env:
RELEASE_VERSION: v0.19.4

steps:
- name: Checkout code
uses: actions/checkout@v3

- name: Get operator-sdk image 0.19.4
run: curl --output operator-sdk -JL https://github.com/operator-framework/operator-sdk/releases/download/$RELEASE_VERSION/operator-sdk-$RELEASE_VERSION-x86_64-linux-gnu

- name: Make operator-sdk executable
run: chmod +x operator-sdk

- name: Move operator-sdk binary
run: sudo mv operator-sdk /usr/local/bin

- name: Generate bundle locally
run: operator-sdk generate bundle --manifests --metadata --default-channel stable-1.5 --channels stable-1.5

- name: Check if bundle generation results in local changes
run: git diff --exit-code

build-operator-check:
name: Build Operator check
runs-on: ubuntu-20.04
Expand Down
8 changes: 8 additions & 0 deletions .gitleaks.toml
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
[allowlist]
description = "Global Allowlist"

# Ignore based on any subset of the file path
paths = [
# Ignore all example certs
'''roles\/servicetelemetry\/vars\/dummy_user_certs\.yml'''
]
1 change: 1 addition & 0 deletions .jenkins/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@ RUN jenkins-plugin-cli -p ant:latest \
email-ext:latest \
git:latest \
github-branch-source:latest \
github-scm-trait-notification-context:latest \
gradle:latest \
ldap:latest \
mailer:latest \
Expand Down
2 changes: 2 additions & 0 deletions .jenkins/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -39,6 +39,8 @@ oc apply -f deploy/service-route.yaml
export SMEE_CHANNEL=<YOUR_SMEE_CHANNEL> #(just the slug, not the whole URL)
export GH_ORG=<YOUR_GITHUB_ORGANIZATION>
export JENKINS_URL=$(oc get route jenkins -ojsonpath='{.spec.host}')
# This is for labelling the status that is returned to github
export OCP_VERSION=<ocp version> # e.g. 4.14

for f in deploy/*; do
envsubst < "${f}" | oc apply -f -
Expand Down
2 changes: 1 addition & 1 deletion .jenkins/agent/Dockerfile
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
FROM quay.io/openshift/origin-jenkins-agent-base:latest

# pass --build-arg OC_CLIENT_VERSION=<version> to build stage to change client version
ARG OC_CLIENT_VERSION="4.12"
ARG OC_CLIENT_VERSION="4.13"

RUN curl -LO "https://github.com/operator-framework/operator-sdk/releases/download/v0.19.4/operator-sdk-v0.19.4-x86_64-linux-gnu" && \
chmod +x operator-sdk-v0.19.4-x86_64-linux-gnu && mv operator-sdk-v0.19.4-x86_64-linux-gnu /usr/local/bin/operator-sdk
Expand Down
5 changes: 5 additions & 0 deletions .jenkins/deploy/casc-configmap.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -94,6 +94,11 @@ data:
// 1 : Forks in the same account
// 2 : Nobody
}
// Custom Github Notification Context; https://github.com/jenkinsci/github-scm-trait-notification-context-plugin
traits << 'org.jenkinsci.plugins.githubScmTraitNotificationContext.NotificationContextTrait' {
contextLabel("continuous-integration/jenkins/ocp-${OCP_VERSION}")
typeSuffix(true)
}
}

// "Project Recognizers"
Expand Down
5 changes: 3 additions & 2 deletions Jenkinsfile
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ metadata:
name: default
namespace: ${namespace}
spec:
observabilityStrategy: use_community
observabilityStrategy: use_redhat
alerting:
alertmanager:
storage:
Expand All @@ -36,6 +36,7 @@ spec:
strategy: ephemeral
transports:
qdr:
auth: none
enabled: true
deploymentSize: 1
web:
Expand Down Expand Up @@ -177,7 +178,7 @@ pipeline {
openshift.withProject(namespace) {
timeout(time: 800, unit: 'SECONDS') {
openshift.create(stf_resource)
sh "OCP_PROJECT=${namespace} ./build/validate_deployment.sh"
sh "OCP_PROJECT=${namespace} VALIDATION_SCOPE=use_redhat ./build/validate_deployment.sh"
}
}
}
Expand Down
18 changes: 17 additions & 1 deletion build/Dockerfile
Original file line number Diff line number Diff line change
@@ -1,5 +1,21 @@
FROM quay.io/openshift/origin-ansible-operator:4.10
FROM quay.io/openshift/origin-ansible-operator:4.12

# temporarily switch to root user to adjust image layers
USER 0
# Upstream CI builds need the additional EPEL sources for python3-passlib and python3-bcrypt but have no working repos to install epel-release
# NO_PROXY is undefined in upstream CI builds, but defined (usually blank) during openshift builds (a possibly brittle hack)
RUN bash -c -- 'if [ "${NO_PROXY:-__ZZZZZ}" == "__ZZZZZ" ]; then echo "Applying upstream EPEL hacks" && echo -e "-----BEGIN PGP PUBLIC KEY BLOCK-----\n\nmQINBFz3zvsBEADJOIIWllGudxnpvJnkxQz2CtoWI7godVnoclrdl83kVjqSQp+2\ndgxuG5mUiADUfYHaRQzxKw8efuQnwxzU9kZ70ngCxtmbQWGmUmfSThiapOz00018\n+eo5MFabd2vdiGo1y+51m2sRDpN8qdCaqXko65cyMuLXrojJHIuvRA/x7iqOrRfy\na8x3OxC4PEgl5pgDnP8pVK0lLYncDEQCN76D9ubhZQWhISF/zJI+e806V71hzfyL\n/Mt3mQm/li+lRKU25Usk9dWaf4NH/wZHMIPAkVJ4uD4H/uS49wqWnyiTYGT7hUbi\necF7crhLCmlRzvJR8mkRP6/4T/F3tNDPWZeDNEDVFUkTFHNU6/h2+O398MNY/fOh\nyKaNK3nnE0g6QJ1dOH31lXHARlpFOtWt3VmZU0JnWLeYdvap4Eff9qTWZJhI7Cq0\nWm8DgLUpXgNlkmquvE7P2W5EAr2E5AqKQoDbfw/GiWdRvHWKeNGMRLnGI3QuoX3U\npAlXD7v13VdZxNydvpeypbf/AfRyrHRKhkUj3cU1pYkM3DNZE77C5JUe6/0nxbt4\nETUZBTgLgYJGP8c7PbkVnO6I/KgL1jw+7MW6Az8Ox+RXZLyGMVmbW/TMc8haJfKL\nMoUo3TVk8nPiUhoOC0/kI7j9ilFrBxBU5dUtF4ITAWc8xnG6jJs/IsvRpQARAQAB\ntChGZWRvcmEgRVBFTCAoOCkgPGVwZWxAZmVkb3JhcHJvamVjdC5vcmc+iQI4BBMB\nAgAiBQJc9877AhsPBgsJCAcDAgYVCAIJCgsEFgIDAQIeAQIXgAAKCRAh6kWrL4bW\noWagD/4xnLWws34GByVDQkjprk0fX7Iyhpm/U7BsIHKspHLL+Y46vAAGY/9vMvdE\n0fcr9Ek2Zp7zE1RWmSCzzzUgTG6BFoTG1H4Fho/7Z8BXK/jybowXSZfqXnTOfhSF\nalwDdwlSJvfYNV9MbyvbxN8qZRU1z7PEWZrIzFDDToFRk0R71zHpnPTNIJ5/YXTw\nNqU9OxII8hMQj4ufF11040AJQZ7br3rzerlyBOB+Jd1zSPVrAPpeMyJppWFHSDAI\nWK6x+am13VIInXtqB/Cz4GBHLFK5d2/IYspVw47Solj8jiFEtnAq6+1Aq5WH3iB4\nbE2e6z00DSF93frwOyWN7WmPIoc2QsNRJhgfJC+isGQAwwq8xAbHEBeuyMG8GZjz\nxohg0H4bOSEujVLTjH1xbAG4DnhWO/1VXLX+LXELycO8ZQTcjj/4AQKuo4wvMPrv\n9A169oETG+VwQlNd74VBPGCvhnzwGXNbTK/KH1+WRH0YSb+41flB3NKhMSU6dGI0\nSGtIxDSHhVVNmx2/6XiT9U/znrZsG5Kw8nIbbFz+9MGUUWgJMsd1Zl9R8gz7V9fp\nn7L7y5LhJ8HOCMsY/Z7/7HUs+t/A1MI4g7Q5g5UuSZdgi0zxukiWuCkLeAiAP4y7\nzKK4OjJ644NDcWCHa36znwVmkz3ixL8Q0auR15Oqq2BjR/fyog==\n=84m8\n-----END PGP PUBLIC KEY BLOCK-----" > /etc/pki/rpm-gpg/RPM-GPG-KEY-EPEL-8 && echo -e "[epel]\nname=Extra Packages for Enterprise Linux 8 - \$basearch\nmetalink=https://mirrors.fedoraproject.org/metalink?repo=epel-8&arch=\$basearch&infra=\$infra&content=\$contentdir\nenabled=1\ngpgcheck=1\ngpgkey=file:///etc/pki/rpm-gpg/RPM-GPG-KEY-EPEL-8" > /etc/yum.repos.d/epel.repo; fi'

# update the base image to allow forward-looking optimistic updates during the testing phase, with the added benefit of helping move closer to passing security scans.
# -- excludes ansible so it remains at 2.9 tag as shipped with the base image
# -- installs python3-passlib and python3-bcrypt for oauth-proxy interface
# -- cleans up the cached data from dnf to keep the image as small as possible
RUN dnf update -y --exclude=ansible* && dnf install -y python3-passlib python3-bcrypt && dnf clean all && rm -rf /var/cache/dnf

# switch back to user 1001 when running the base image (non-root)
USER 1001

# copy in required artifacts for the operator
COPY watches.yaml ${HOME}/watches.yaml
COPY roles/ ${HOME}/roles/
COPY collections/ ${HOME}/.ansible/collections/
49 changes: 32 additions & 17 deletions build/generate_bundle.sh
Original file line number Diff line number Diff line change
@@ -1,41 +1,52 @@
#!/usr/bin/env bash
set -e
REL=$(dirname "$0")
set -x

LOGFILE=${LOGFILE:-/dev/null}

# If LOGFILE is /dev/null, this command fails, so ignore that error
truncate --size=0 ${LOGFILE} || true

OPERATOR_SDK=${OPERATOR_SDK:-operator-sdk}

REL=$( readlink -f $(dirname "$0"))

# shellcheck source=build/metadata.sh
. "${REL}/metadata.sh"

generate_version() {
echo "-- Generating operator version"
UNIXDATE=$(date '+%s')
OPERATOR_BUNDLE_VERSION=${OPERATOR_CSV_MAJOR_VERSION}.${UNIXDATE}
echo "---- Operator Version: ${OPERATOR_BUNDLE_VERSION}"
}

create_working_dir() {
echo "-- Create working directory"
WORKING_DIR=${WORKING_DIR:-"/tmp/${OPERATOR_NAME}-bundle-${OPERATOR_BUNDLE_VERSION}"}
mkdir -p "${WORKING_DIR}"
echo "---- Created working directory: ${WORKING_DIR}"
}

generate_dockerfile() {
echo "-- Generate Dockerfile for bundle"
sed -E "s#<<OPERATOR_BUNDLE_VERSION>>#${OPERATOR_BUNDLE_VERSION}#g;s#<<BUNDLE_CHANNELS>>#${BUNDLE_CHANNELS}#g;s#<<BUNDLE_DEFAULT_CHANNEL>>#${BUNDLE_DEFAULT_CHANNEL}#g" "${REL}/../${BUNDLE_PATH}/Dockerfile.in" > "${WORKING_DIR}/Dockerfile"
echo "---- Generated Dockerfile complete"
}

generate_bundle() {
echo "-- Generate bundle"
REPLACE_REGEX="s#<<CREATED_DATE>>#${CREATED_DATE}#g;s#<<OPERATOR_IMAGE>>#${OPERATOR_IMAGE}#g;s#<<OPERATOR_TAG>>#${OPERATOR_TAG}#g;s#<<RELATED_IMAGE_PROMETHEUS_WEBHOOK_SNMP>>#${RELATED_IMAGE_PROMETHEUS_WEBHOOK_SNMP}#g;s#<<RELATED_IMAGE_PROMETHEUS_WEBHOOK_SNMP_TAG>>#${RELATED_IMAGE_PROMETHEUS_WEBHOOK_SNMP_TAG}#g;s#<<OPERATOR_BUNDLE_VERSION>>#${OPERATOR_BUNDLE_VERSION}#g;s#1.99.0#${OPERATOR_BUNDLE_VERSION}#g;s#<<OPERATOR_DOCUMENTATION_URL>>#${OPERATOR_DOCUMENTATION_URL}#g;s#<<BUNDLE_OLM_SKIP_RANGE_LOWER_BOUND>>#${BUNDLE_OLM_SKIP_RANGE_LOWER_BOUND}#g"
REPLACE_REGEX="s#<<CREATED_DATE>>#${CREATED_DATE}#g;s#<<OPERATOR_IMAGE>>#${OPERATOR_IMAGE}#g;s#<<OPERATOR_TAG>>#${OPERATOR_TAG}#g;s#<<RELATED_IMAGE_PROMETHEUS_WEBHOOK_SNMP>>#${RELATED_IMAGE_PROMETHEUS_WEBHOOK_SNMP}#g;s#<<RELATED_IMAGE_PROMETHEUS_WEBHOOK_SNMP_TAG>>#${RELATED_IMAGE_PROMETHEUS_WEBHOOK_SNMP_TAG}#g;s#<<RELATED_IMAGE_OAUTH_PROXY>>#${RELATED_IMAGE_OAUTH_PROXY}#g;s#<<RELATED_IMAGE_OAUTH_PROXY_TAG>>#${RELATED_IMAGE_OAUTH_PROXY_TAG}#g;s#<<OPERATOR_BUNDLE_VERSION>>#${OPERATOR_BUNDLE_VERSION}#g;s#1.99.0#${OPERATOR_BUNDLE_VERSION}#g;s#<<OPERATOR_DOCUMENTATION_URL>>#${OPERATOR_DOCUMENTATION_URL}#g;s#<<BUNDLE_OLM_SKIP_RANGE_LOWER_BOUND>>#${BUNDLE_OLM_SKIP_RANGE_LOWER_BOUND}#g"

pushd "${REL}/../"
${OPERATOR_SDK} generate bundle --channels ${BUNDLE_CHANNELS} --default-channel ${BUNDLE_DEFAULT_CHANNEL} --manifests --metadata --version "${OPERATOR_BUNDLE_VERSION}" --output-dir "${WORKING_DIR}"
popd
pushd "${REL}/../" > /dev/null 2>&1
${OPERATOR_SDK} generate bundle --verbose --channels ${BUNDLE_CHANNELS} --default-channel ${BUNDLE_DEFAULT_CHANNEL} --manifests --metadata --version "${OPERATOR_BUNDLE_VERSION}" --output-dir "${WORKING_DIR}" >> ${LOGFILE} 2>&1
popd > /dev/null 2>&1

echo "---- Replacing variables in generated manifest"
sed -i -E "${REPLACE_REGEX}" "${WORKING_DIR}/manifests/${OPERATOR_NAME}.clusterserviceversion.yaml"
echo "---- Generated bundle complete at ${WORKING_DIR}/manifests/${OPERATOR_NAME}.clusterserviceversion.yaml"
}

copy_extra_metadata() {
# We add this because our version of operator-sdk for building doesn't
# understand these files, but newer versions of operator-sdk (for testing
# purposes) does, and newer versions of opm (as used in both downstream and
# upstream index image builds) also understands these files. Just copy them
# into the bundle directory during building.
pushd "${REL}/../" > /dev/null 2>&1
cp -r ./deploy/olm-catalog/service-telemetry-operator/tests/ "${WORKING_DIR}"
cp ./deploy/olm-catalog/service-telemetry-operator/metadata/properties.yaml "${WORKING_DIR}/metadata/"
}

copy_extra_metadata() {
Expand All @@ -58,11 +69,15 @@ build_bundle_instructions() {


# generate templates
echo "## Begin bundle creation"
#echo "## Begin bundle creation"
generate_version
create_working_dir
generate_dockerfile
generate_bundle
copy_extra_metadata
build_bundle_instructions
echo "## End Bundle creation"
#build_bundle_instructions
#echo "## End Bundle creation"

set +x
JSON_OUTPUT='{"operator_bundle_image":"%s","operator_bundle_version":"%s","operator_image":"%s","bundle_channels":"%s","bundle_default_channel":"%s","operator_tag":"%s","working_dir":"%s"}'
printf "$JSON_OUTPUT" "$OPERATOR_BUNDLE_IMAGE" "$OPERATOR_BUNDLE_VERSION" "$OPERATOR_IMAGE" "$BUNDLE_CHANNELS" "$BUNDLE_DEFAULT_CHANNEL" "$OPERATOR_TAG" "$WORKING_DIR"
16 changes: 0 additions & 16 deletions build/get_new_operator_sdk.sh

This file was deleted.

24 changes: 24 additions & 0 deletions build/get_operator_sdk.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
#!/bin/bash

set -x

REL=$(dirname "$0")
ARCH=$(case $(uname -m) in x86_64) echo -n amd64 ;; aarch64) echo -n arm64 ;; *) echo -n $(uname -m) ;; esac)
OS=$(uname | awk '{print tolower($0)}')
VERSION="${1:-v1.5.0}"
OPERATOR_SDK_DL_URL=https://github.com/operator-framework/operator-sdk/releases/download/${VERSION}

if [[ ! -f ${REL}/working/operator-sdk-${VERSION} ]]; then
mkdir ${REL}/working
if [[ "${VERSION}" =~ "v0" ]]; then
# naming scheme for v0.x is operator-sdk-$VERSION-$ARCH-$OS e.g. operator-sdk-v0.19.4-x86_64-linux-gnu
curl -L ${OPERATOR_SDK_DL_URL}/operator-sdk-${VERSION}-x86_64-linux-gnu -o ${REL}/working/operator-sdk-${VERSION}
else
# naming scheme for v1.x is operator-sdk_$OS-$ARCH e.g. operator-sdk_linux_amd64
curl -L ${OPERATOR_SDK_DL_URL}/operator-sdk_${OS}_${ARCH} -o ${REL}/working/operator-sdk-${VERSION}
fi
chmod +x ${REL}/working/operator-sdk-${VERSION}
rm -f ${REL}/working/operator-sdk
fi

set +x
2 changes: 2 additions & 0 deletions build/metadata.sh
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,8 @@ BUNDLE_OLM_SKIP_RANGE_LOWER_BOUND=${BUNDLE_OLM_SKIP_RANGE_LOWER_BOUND:-1.3.0}
CREATED_DATE=${CREATED_DATE:-$(date +'%Y-%m-%dT%H:%M:%SZ')}
RELATED_IMAGE_PROMETHEUS_WEBHOOK_SNMP=${RELATED_IMAGE_PROMETHEUS_WEBHOOK_SNMP:-quay.io/infrawatch/prometheus-webhook-snmp}
RELATED_IMAGE_PROMETHEUS_WEBHOOK_SNMP_TAG=${RELATED_IMAGE_PROMETHEUS_WEBHOOK_SNMP_TAG:-stable-1.5}
RELATED_IMAGE_OAUTH_PROXY=${RELATED_IMAGE_OAUTH_PROXY:-quay.io/openshift/origin-oauth-proxy}
RELATED_IMAGE_OAUTH_PROXY_TAG=${RELATED_IMAGE_OAUTH_PROXY_TAG:-latest}
BUNDLE_PATH=${BUNDLE_PATH:-deploy/olm-catalog/service-telemetry-operator}
BUNDLE_CHANNELS=${BUNDLE_CHANNELS:-stable-1.5}
BUNDLE_DEFAULT_CHANNEL=${BUNDLE_DEFAULT_CHANNEL:-stable-1.5}
Expand Down
10 changes: 8 additions & 2 deletions build/run-ci.yaml
Original file line number Diff line number Diff line change
@@ -1,9 +1,15 @@
---
# run STF CI setup in CRC (already provisioned)
- hosts: localhost
gather_facts: no
gather_facts: yes
connection: local
tasks:
- name: Run the STF CI system
import_role:
name: stf-run-ci
name: stf-run-ci

- name: Collect the logs
import_role:
name: stf-collect-logs
vars:
logfile_dir: "{{ playbook_dir }}/"
38 changes: 38 additions & 0 deletions build/stf-collect-logs/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,38 @@
stf-collect-logs
================

This role collects logs that are useful for debugging an STF deployment.

Once the logs are collected, the user will need to fetch the logs themselves.

Requirements
------------


Role Variables
--------------

* `logfile_dir` - The location that the logs will be created in on the remote host(s).

Dependencies
------------


Example Playbook
----------------

Including an example of how to use your role (for instance, with variables passed in as parameters) is always nice for users too:

- hosts: servers
roles:
- { role: username.rolename, x: 42 }

License
-------

Apache 2

Author Information
------------------

Red Hat
2 changes: 2 additions & 0 deletions build/stf-collect-logs/defaults/main.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
---
# defaults file for stf-collect-logs
15 changes: 15 additions & 0 deletions build/stf-collect-logs/meta/main.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
galaxy_info:
role_name: stf-collect-logs
namespace: infrawatch

author: InfraWatch
description: Log collection role for Service Telemetry Framework
company: Red Hat

license: Apache-2.0

min_ansible_version: 2.1

galaxy_tags: []

dependencies: []
Loading