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

AWS kube-down: don't fail if ELB not in VPC - #23784 #23785

Merged

Conversation

ajohnstone
Copy link
Contributor

@ajohnstone ajohnstone commented Apr 2, 2016

Prevent python undefined key error.

Traceback (most recent call last):
  File "<string>", line 1, in <module>
KeyError: 'VPCId'

Fixes #23784


This change is Reviewable

@k8s-bot
Copy link

k8s-bot commented Apr 2, 2016

Can one of the admins verify that this patch is reasonable to test? If so, please reply "ok to test".
(Note: "add to whitelist" is no longer supported. Please update configurations in hack/jenkins/job-configs/kubernetes-jenkins-pull/ instead.)

This message may repeat a few times in short succession due to jenkinsci/ghprb-plugin#292. Sorry.

Otherwise, if this message is too spammy, please complain to ixdy.

2 similar comments
@k8s-bot
Copy link

k8s-bot commented Apr 2, 2016

Can one of the admins verify that this patch is reasonable to test? If so, please reply "ok to test".
(Note: "add to whitelist" is no longer supported. Please update configurations in hack/jenkins/job-configs/kubernetes-jenkins-pull/ instead.)

This message may repeat a few times in short succession due to jenkinsci/ghprb-plugin#292. Sorry.

Otherwise, if this message is too spammy, please complain to ixdy.

@k8s-bot
Copy link

k8s-bot commented Apr 2, 2016

Can one of the admins verify that this patch is reasonable to test? If so, please reply "ok to test".
(Note: "add to whitelist" is no longer supported. Please update configurations in hack/jenkins/job-configs/kubernetes-jenkins-pull/ instead.)

This message may repeat a few times in short succession due to jenkinsci/ghprb-plugin#292. Sorry.

Otherwise, if this message is too spammy, please complain to ixdy.

@ajohnstone ajohnstone changed the title #23784 - check elb vpc key exists #23784 - aws - check elb vpc key exists Apr 2, 2016
@k8s-github-robot k8s-github-robot added size/XS Denotes a PR that changes 0-9 lines, ignoring generated files. release-note-label-needed labels Apr 2, 2016
@justinsb justinsb assigned justinsb and unassigned zmerlynn Apr 2, 2016
@@ -151,7 +151,7 @@ function get_igw_id {
function get_elbs_in_vpc {
# ELB doesn't seem to be on the same platform as the rest of AWS; doesn't support filtering
aws elb --output json describe-load-balancers | \
python -c "import json,sys; lst = [str(lb['LoadBalancerName']) for lb in json.load(sys.stdin)['LoadBalancerDescriptions'] if lb['VPCId'] == '$1']; print('\n'.join(lst))"
python -c "import json,sys; lst = [str(lb['LoadBalancerName']) for lb in json.load(sys.stdin)['LoadBalancerDescriptions'] if 'VPCId' in lb and lb['VPCId'] == '$1']; print('\n'.join(lst))"
Copy link
Member

Choose a reason for hiding this comment

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

I think you could also do if lb.get('VPCId') ==. Your way is more verbose but likely clearer though!

@justinsb
Copy link
Member

justinsb commented Apr 2, 2016

LGTM. Can you change the topic of the commit though - put a description like "AWS kube-up: don't fail if ELB not in VPC" (i.e. no issue # here). And then in the body include "Fixes #23784" on a line by itself, and then github will auto close the issue when this merges.

One comment on the python, but on second thoughts I like your way better.

Thanks for the fix!

@ajohnstone ajohnstone changed the title #23784 - aws - check elb vpc key exists AWS kube-down: don't fail if ELB not in VPC - #23784 Apr 2, 2016
@justinsb justinsb added release-note Denotes a PR that will be considered when it comes time to generate release notes. and removed release-note-label-needed labels May 10, 2016
@justinsb
Copy link
Member

ok to test

@justinsb justinsb added the lgtm "Looks good to me", indicates that a PR is ready to be merged. label May 10, 2016
@k8s-bot
Copy link

k8s-bot commented May 14, 2016

GCE e2e build/test passed for commit 06c04d1.

@k8s-github-robot
Copy link

Automatic merge from submit-queue

@k8s-github-robot k8s-github-robot merged commit 61f383e into kubernetes:master May 16, 2016
@ajohnstone ajohnstone deleted the 23784-aws-vpc-key-error branch May 16, 2016 08:49
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
lgtm "Looks good to me", indicates that a PR is ready to be merged. release-note Denotes a PR that will be considered when it comes time to generate release notes. size/XS Denotes a PR that changes 0-9 lines, ignoring generated files.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

8 participants