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

Remove pod struct in logs #16

Merged
merged 1 commit into from
Feb 17, 2021
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 3 additions & 2 deletions fargate/pod.go
Original file line number Diff line number Diff line change
Expand Up @@ -127,12 +127,13 @@ func NewPod(cluster *Cluster, pod *corev1.Pod) (*Pod, error) {
// Register the task definition with Fargate.
log.Printf("RegisterTaskDefinition input:%+v", taskDef)
output, err := api.RegisterTaskDefinition(taskDef)
log.Printf("RegisterTaskDefinition err:%+v output:%+v", err, output)
if err != nil {
err = fmt.Errorf("failed to register task definition: %v", err)
return nil, err
}

log.Printf("RegisterTaskDefinition output:%+v", output)

// Save the registered task definition ARN.
fgPod.taskDefArn = *output.TaskDefinition.TaskDefinitionArn

Expand Down Expand Up @@ -193,7 +194,6 @@ func (pod *Pod) Start() error {

log.Printf("RunTask input:%+v", runTaskInput)
runTaskOutput, err := api.RunTask(runTaskInput)
log.Printf("RunTask err:%+v output:%+v", err, runTaskOutput)
if err != nil || len(runTaskOutput.Tasks) == 0 {
if len(runTaskOutput.Failures) != 0 {
err = fmt.Errorf("reason: %s", *runTaskOutput.Failures[0].Reason)
Expand All @@ -202,6 +202,7 @@ func (pod *Pod) Start() error {
return err
}

log.Printf("RunTask output:%+v", runTaskOutput)
// Save the task ARN.
pod.taskArn = *runTaskOutput.Tasks[0].TaskArn

Expand Down
6 changes: 3 additions & 3 deletions provider.go
Original file line number Diff line number Diff line change
Expand Up @@ -166,8 +166,6 @@ func (p *FargateProvider) GetPod(ctx context.Context, namespace, name string) (*
return nil, err
}

log.Printf("Responding to GetPod: %+v.\n", spec)

return spec, nil
}

Expand Down Expand Up @@ -216,6 +214,7 @@ func (p *FargateProvider) GetPods(ctx context.Context) ([]*corev1.Pod, error) {
}

var result []*corev1.Pod
var podNames []string

for _, pod := range pods {
spec, err := pod.GetSpec()
Expand All @@ -225,9 +224,10 @@ func (p *FargateProvider) GetPods(ctx context.Context) ([]*corev1.Pod, error) {
}

result = append(result, spec)
podNames = append(podNames, fmt.Sprintf("%s/%s", spec.Namespace, spec.Name))
}

log.Printf("Responding to GetPods: %+v.\n", result)
log.Printf("Responding to GetPods: %+v.\n", podNames)

return result, nil
}
Expand Down