Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Configurable task role #2

Merged
merged 1 commit into from Apr 23, 2018

Conversation

johanneswuerbach
Copy link

Configurable task role via iam.amazonaws.com/role, which is also used
by kube2iam.

Copy link
Owner

@ofiliz ofiliz left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thank you! This is awesome.

@@ -33,6 +33,9 @@ const (

// Reason used for task state changes.
taskGenericReason = "Initiated by user"

// Annotation to configure the task role
Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please end comment lines with a '.'

@@ -51,6 +54,7 @@ type Pod struct {
taskCPU int64
taskMemory int64
containers map[string]*container
taskRoleArn *string
Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Can you please move this to between taskArn and taskStatus? So that all ARNs are together. Also, any reason for the type to be *string? Let's just store it as string, like the others.

@@ -223,6 +223,7 @@ func (c *Cluster) loadPodState() error {
pod.taskArn = *task.TaskArn
pod.taskStatus = *task.LastStatus
pod.taskRefreshTime = time.Now()
pod.taskRoleArn = taskDef.TaskRoleArn
Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please move this new line to between taskArn and taskStatus, to follow the same order they were declared in the struct. See my other comment.

if val, ok := pod.Annotations[taskRoleAnnotation]; ok {
taskDef.TaskRoleArn = aws.String(val)
}
fgPod.taskRoleArn = taskDef.TaskRoleArn
Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Can we please move this inside the if block? fdPod.taskRoleArn is only set if there is an annotation (ok == true), so shouldn't it be also inside the if block? Simply fdPod.taskRoleArn = val

@ofiliz ofiliz self-assigned this Apr 23, 2018
Configurable task role via `iam.amazonaws.com/role`, which is also used
by kube2iam.
@johanneswuerbach
Copy link
Author

Thank you @ofiliz, feedback addressed.

@ofiliz ofiliz merged commit 13511a5 into ofiliz:aws-fargate-provider Apr 23, 2018
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
2 participants