-
Notifications
You must be signed in to change notification settings - Fork 40
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #127 from dirgim/dptp-image-source
[CVP-1713] Add a playbook for parsing collected image pull events
- Loading branch information
Showing
4 changed files
with
51 additions
and
11 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,18 @@ | ||
--- | ||
- name: "Parse the collected image pull events" | ||
hosts: all | ||
become: false | ||
gather_facts: false | ||
|
||
vars: | ||
run_upstream: false | ||
operator_work_dir: "/home/jenkins/agent/test-operator" | ||
work_dir: "{{ lookup('env', 'WORKSPACE') }}" | ||
collect_pull_events: false | ||
|
||
tasks: | ||
- name: "Parse the collected image pull events" | ||
include_role: | ||
name: collect_modified_images | ||
vars: | ||
events_file_path: "{{ work_dir }}/image_pull_events.json" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,3 +1,4 @@ | ||
pulled_images: [] | ||
events_file_path: /tmp/events.json | ||
deployment_start_time: 1970-01-01T00:00:00Z | ||
collect_pull_events: true |
13 changes: 13 additions & 0 deletions
13
roles/collect_modified_images/files/optional-operators-cvp-common-test-commands.sh
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,13 @@ | ||
#!/bin/bash | ||
|
||
set -o nounset | ||
set -o errexit | ||
set -o pipefail | ||
|
||
# Collect all image pull events from the testing cluster | ||
# The output will contain the timestamp and the event message | ||
# in a comma-separated value format | ||
|
||
PULL_EVENTS_ART="${ARTIFACT_DIR}/image_pull_events.csv" | ||
echo "Collecting all image pull events from the testing cluster in ${PULL_EVENTS_ART}" | ||
oc get events --all-namespaces --field-selector reason==Pulling -o go-template='{{range .items}}{{.lastTimestamp}},{{.message}}{{"\n"}}{{end}}' > "${PULL_EVENTS_ART}" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters