File tree Expand file tree Collapse file tree 2 files changed +7
-3
lines changed Expand file tree Collapse file tree 2 files changed +7
-3
lines changed Original file line number Diff line number Diff line change 12
12
- name : daily-openshift-metrics-collector
13
13
image : ghcr.io/cci-moc/openshift-usage-scripts:main
14
14
env :
15
+ - name : OPENSHIFT_CLUSTER_NAME
16
+ value : nerc-ocp-prod
15
17
- name : S3_OUTPUT_ACCESS_KEY_ID
16
18
valueFrom :
17
19
secretKeyRef :
Original file line number Diff line number Diff line change @@ -160,21 +160,23 @@ def main():
160
160
161
161
if args .upload_to_s3 :
162
162
bucket_name = os .environ .get ("S3_INVOICE_BUCKET" , "nerc-invoicing" )
163
+ cluster_name = os .environ .get ("OPENSHIFT_CLUSTER_NAME" )
164
+ assert cluster_name , "Please set OPENSHIFT_CLUSTER_NAME to upload to S3"
163
165
primary_location = (
164
166
f"Invoices/{ report_month } /"
165
- f"Service Invoices/NERC OpenShift { report_month } .csv"
167
+ f"Service Invoices/{ cluster_name } { report_month } .csv"
166
168
)
167
169
utils .upload_to_s3 (invoice_file , bucket_name , primary_location )
168
170
169
171
timestamp = datetime .utcnow ().strftime ('%Y%m%dT%H%M%SZ' )
170
172
secondary_location = (
171
173
f"Invoices/{ report_month } /"
172
- f"Archive/NERC OpenShift { report_month } { timestamp } .csv"
174
+ f"Archive/{ cluster_name } { report_month } { timestamp } .csv"
173
175
)
174
176
utils .upload_to_s3 (invoice_file , bucket_name , secondary_location )
175
177
pod_report_location = (
176
178
f"Invoices/{ report_month } /"
177
- f"Archive/Pod-NERC OpenShift { report_month } { timestamp } .csv"
179
+ f"Archive/Pod-{ cluster_name } { report_month } { timestamp } .csv"
178
180
)
179
181
utils .upload_to_s3 (pod_report_file , bucket_name , pod_report_location )
180
182
You can’t perform that action at this time.
0 commit comments