File tree Expand file tree Collapse file tree 1 file changed +6
-7
lines changed
pkg/operator/resources/batchapi Expand file tree Collapse file tree 1 file changed +6
-7
lines changed Original file line number Diff line number Diff line change @@ -43,17 +43,16 @@ func operatorLogStream(jobKey spec.JobKey) string {
4343
4444// Checks if log group exists before creating it
4545func ensureLogGroupForAPI (apiName string ) error {
46- output , err := config .AWS .CloudWatchLogs ().DescribeLogGroups (& cloudwatchlogs.DescribeLogGroupsInput {
47- Limit : aws .Int64 (1 ),
48- LogGroupNamePrefix : aws .String (logGroupNameForAPI (apiName )),
49- })
46+ apiNameLogGroup := logGroupNameForAPI (apiName )
47+
48+ logGroupExists , err := config .AWS .DoesLogGroupExist (apiNameLogGroup )
5049 if err != nil {
51- return errors . WithStack ( err )
50+ return err
5251 }
5352
54- if len ( output . LogGroups ) == 0 {
53+ if ! logGroupExists {
5554 input := & cloudwatchlogs.CreateLogGroupInput {
56- LogGroupName : aws .String (logGroupNameForAPI ( apiName ) ),
55+ LogGroupName : aws .String (apiNameLogGroup ),
5756 }
5857
5958 // There should always be a default tag. Tags are only empty when running local operator without the tags field specified in a cluster.yaml.
You can’t perform that action at this time.
0 commit comments