Skip to content

Commit

Permalink
Merge pull request #19 from oybed/project-cleanup
Browse files Browse the repository at this point in the history
Adding/Clean-up of comments
  • Loading branch information
etsauer authored Jan 9, 2018
2 parents 7bdc7d8 + ca11c7d commit 78fb646
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 2 deletions.
5 changes: 4 additions & 1 deletion images/prune-ocp-projects/include/prune-ocp-projects.sh
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,10 @@
#PROJECT_EXCLUDE_SYSTEM
#PROJECT_EXCLUDE_USER

# Also make sure to declare the TIMESTAMP_HOURS_AGO environment variable with the
# number of hours "old" a project has to be for deletion - i.e.: '-2hours', '-24hours', etc
#TIMESTAMP_HOURS_AGO='-12hours'

# Use an indexed array to keep track of existing projects
declare -A projects

Expand Down Expand Up @@ -36,7 +40,6 @@ fi
# than the set number of hours
for project in "${!projects[@]}";
do
# need variable for time
purgetime=`date -d "${TIMESTAMP_HOURS_AGO}" +%s`
temp=`oc get project ${project} -o=custom-columns=time:.metadata.creationTimestamp --no-headers`
projects[${project}]=`date -d "${temp}" +%s`
Expand Down
1 change: 0 additions & 1 deletion jobs/cronjob-prune-projects.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,6 @@ objects:
source:
git:
uri: https://github.com/redhat-cop/openshift-management.git
ref: prune
contextDir: /images/prune-ocp-projects
strategy:
dockerStrategy:
Expand Down

0 comments on commit 78fb646

Please sign in to comment.