File tree Expand file tree Collapse file tree 5 files changed +6
-8
lines changed
operator/resources/job/batchapi Expand file tree Collapse file tree 5 files changed +6
-8
lines changed Original file line number Diff line number Diff line change @@ -188,7 +188,6 @@ var _clusterUpCmd = &cobra.Command{
188
188
LogGroup : clusterConfig .ClusterName ,
189
189
Bucket : clusterConfig .Bucket ,
190
190
Region : clusterConfig .Region ,
191
- SQSPrefix : clusterconfig .SQSNamePrefix (clusterConfig .ClusterName ),
192
191
AccountID : accountID ,
193
192
})
194
193
if err != nil {
Original file line number Diff line number Diff line change @@ -77,7 +77,7 @@ _NOTE: The policy created during `cortex cluster up` will automatically be delet
77
77
{
78
78
" Effect" : " Allow" ,
79
79
" Action" : " sqs:*" ,
80
- " Resource" : " arn:aws:sqs:{{ .Region }}:{{ .AccountID }}:{{ .SQSPrefix }} *"
80
+ " Resource" : " arn:aws:sqs:{{ .Region }}:{{ .AccountID }}:cortex- *"
81
81
},
82
82
{
83
83
" Effect" : " Allow" ,
Original file line number Diff line number Diff line change @@ -35,7 +35,7 @@ func apiQueueNamePrefix(apiName string) string {
35
35
return config .CoreConfig .SQSNamePrefix () + apiName + "-"
36
36
}
37
37
38
- // QueueName is <hash of cluster name>-<api_name>-<job_id>.fifo
38
+ // QueueName is cortex- <hash of cluster name>-<api_name>-<job_id>.fifo
39
39
func getJobQueueName (jobKey spec.JobKey ) string {
40
40
return apiQueueNamePrefix (jobKey .APIName ) + jobKey .ID + ".fifo"
41
41
}
@@ -57,7 +57,7 @@ func jobKeyFromQueueURL(queueURL string) spec.JobKey {
57
57
58
58
jobID := strings .TrimSuffix (dashSplit [len (dashSplit )- 1 ], ".fifo" )
59
59
60
- apiNameSplit := dashSplit [1 : len (dashSplit )- 1 ]
60
+ apiNameSplit := dashSplit [2 : len (dashSplit )- 1 ]
61
61
apiName := strings .Join (apiNameSplit , "-" )
62
62
63
63
return spec.JobKey {APIName : apiName , ID : jobID }
Original file line number Diff line number Diff line change @@ -53,7 +53,7 @@ var _cortexPolicy = `
53
53
{
54
54
"Effect": "Allow",
55
55
"Action": "sqs:*",
56
- "Resource": "arn:aws:sqs:{{ .Region }}:{{ .AccountID }}:{{ .SQSPrefix }} *"
56
+ "Resource": "arn:aws:sqs:{{ .Region }}:{{ .AccountID }}:cortex- *"
57
57
},
58
58
{
59
59
"Effect": "Allow",
@@ -89,7 +89,6 @@ type CortexPolicyTemplateArgs struct {
89
89
LogGroup string
90
90
Region string
91
91
Bucket string
92
- SQSPrefix string
93
92
AccountID string
94
93
}
95
94
Original file line number Diff line number Diff line change @@ -682,8 +682,8 @@ func (cc *Config) ToAccessConfig() AccessConfig {
682
682
}
683
683
684
684
func SQSNamePrefix (clusterName string ) string {
685
- // 10 was chosen to make sure that other identifiers can be added to the full queue name before reaching the 80 char SQS name limit
686
- return hash .String (clusterName )[:10 ] + "-"
685
+ // 8 was chosen to make sure that other identifiers can be added to the full queue name before reaching the 80 char SQS name limit
686
+ return "cortex-" + hash .String (clusterName )[:8 ] + "-"
687
687
}
688
688
689
689
// returns hash of cluster name and adds trailing "-"
You can’t perform that action at this time.
0 commit comments