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

Add error messages in aws-k8s-agent initialization #1650

Merged
merged 5 commits into from
Jan 11, 2022
Merged
Changes from 1 commit
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
6 changes: 4 additions & 2 deletions cmd/aws-k8s-agent/main.go
Original file line number Diff line number Diff line change
Expand Up @@ -39,22 +39,24 @@ func _main() int {
version.RegisterMetric()

//Check API Server Connectivity
if k8sapi.CheckAPIServerConnectivity() != nil {
if err := k8sapi.CheckAPIServerConnectivity(); err != nil {
log.Errorf("Failed check API server connectivity: %s", err)
ryan-joynbio marked this conversation as resolved.
Show resolved Hide resolved
return 1
}

rawK8SClient, err := k8sapi.CreateKubeClient()
if err != nil {
log.Errorf("Failed create kube client: %s", err)
return 1
}

cacheK8SClient, err := k8sapi.CreateCachedKubeClient(rawK8SClient)
if err != nil {
log.Errorf("Failed create cached kube client: %s", err)
return 1
}

ipamContext, err := ipamd.New(rawK8SClient, cacheK8SClient)

if err != nil {
log.Errorf("Initialization failure: %v", err)
return 1
Expand Down