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{
188188 LogGroup : clusterConfig .ClusterName ,
189189 Bucket : clusterConfig .Bucket ,
190190 Region : clusterConfig .Region ,
191- SQSPrefix : clusterconfig .SQSNamePrefix (clusterConfig .ClusterName ),
192191 AccountID : accountID ,
193192 })
194193 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
7777 {
7878 " Effect" : " Allow" ,
7979 " Action" : " sqs:*" ,
80- " Resource" : " arn:aws:sqs:{{ .Region }}:{{ .AccountID }}:{{ .SQSPrefix }} *"
80+ " Resource" : " arn:aws:sqs:{{ .Region }}:{{ .AccountID }}:cortex- *"
8181 },
8282 {
8383 " Effect" : " Allow" ,
Original file line number Diff line number Diff line change @@ -35,7 +35,7 @@ func apiQueueNamePrefix(apiName string) string {
3535 return config .CoreConfig .SQSNamePrefix () + apiName + "-"
3636}
3737
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
3939func getJobQueueName (jobKey spec.JobKey ) string {
4040 return apiQueueNamePrefix (jobKey .APIName ) + jobKey .ID + ".fifo"
4141}
@@ -57,7 +57,7 @@ func jobKeyFromQueueURL(queueURL string) spec.JobKey {
5757
5858 jobID := strings .TrimSuffix (dashSplit [len (dashSplit )- 1 ], ".fifo" )
5959
60- apiNameSplit := dashSplit [1 : len (dashSplit )- 1 ]
60+ apiNameSplit := dashSplit [2 : len (dashSplit )- 1 ]
6161 apiName := strings .Join (apiNameSplit , "-" )
6262
6363 return spec.JobKey {APIName : apiName , ID : jobID }
Original file line number Diff line number Diff line change @@ -53,7 +53,7 @@ var _cortexPolicy = `
5353 {
5454 "Effect": "Allow",
5555 "Action": "sqs:*",
56- "Resource": "arn:aws:sqs:{{ .Region }}:{{ .AccountID }}:{{ .SQSPrefix }} *"
56+ "Resource": "arn:aws:sqs:{{ .Region }}:{{ .AccountID }}:cortex- *"
5757 },
5858 {
5959 "Effect": "Allow",
@@ -89,7 +89,6 @@ type CortexPolicyTemplateArgs struct {
8989 LogGroup string
9090 Region string
9191 Bucket string
92- SQSPrefix string
9392 AccountID string
9493}
9594
Original file line number Diff line number Diff line change @@ -682,8 +682,8 @@ func (cc *Config) ToAccessConfig() AccessConfig {
682682}
683683
684684func 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 ] + "-"
687687}
688688
689689// returns hash of cluster name and adds trailing "-"
You can’t perform that action at this time.
0 commit comments