8000 fix: problems with loadbalancer ip address display #130 password #132 by qdzlug · Pull Request #131 · nginxinc/kic-reference-architectures · GitHub
[go: up one dir, main page]

Skip to content

Conversation

qdzlug
Copy link
Contributor
@qdzlug qdzlug commented Apr 22, 2022

Proposed changes

This fix addresses a bug introduced with #129 where the startup script would fail on retrieval of the IP address from kuberentes. This includes using the correct service name and adds in an or condition for cases where we cannot retrieve the address (which could be a symptom of a problem an 8000 d not a problem itself) so that the operator can debug.

Checklist

Before creating a PR, run through this checklist and mark each as complete.

  • I have written my commit messages in the Conventional Commits format.
  • I have read the CONTRIBUTING doc
  • I have added tests (when possible) that prove my fix is effective or that my feature works
  • I have checked that all unit tests pass after adding my changes
  • I have updated necessary documentation
  • I have rebased my branch onto master
  • I will ensure my PR is targeting the master branch and pulling from my branch from my own fork

@qdzlug qdzlug changed the title fix: problems with loadbalancer ip address display #130 fix: problems with loadbalancer ip address display #130 password #132 Apr 22, 2022
@qdzlug
Copy link
Contributor Author
qdzlug commented Apr 22, 2022

This will also contain a fix to close #132

Copy link
Contributor
@4141done 4141done left a comment

Choose a reason for hiding this comment

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

👍 🐳 👍
Looks good - I had some questions for my own learning.
Before merging, can we also check that the removals from the various JenkinsFiles are intended?


header "Finished!"
THE_FQDN=$(pulumi config get kic-helm:fqdn -C ${script_dir}/../pulumi/python/config || echo "Cannot Retrieve")
THE_IP=$(kubectl get service kic-nginx-ingress --namespace nginx-ingress --output=jsonpath='{.status.loadBalancer.ingress[*].ip}' || echo "Cannot Retrieve")
Copy link
Contributor

Choose a reason for hiding this comment

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

Another bash question: I know that the || will stop the script from crashing if the command exits nonzero, but what's the difference between echo and just doing || "Cannot Retrieve"? I assume the goal is to set THE_IP and THE_FQDN to "Cannot Retrieve"?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

We're running the script in a mode that it exits if there are any failures anywhere (anything return non-zero) - you can see the set statement at the top.

If you look at the CRD removal logic you can see one approach to potentially having errors and wanting to ignore them -we turn off the strict abort on error and allow them to error.

In this case, I wanted to keep going but I also wanted to put a message out there. So what happens is if the RC from CMD1 is non-zero, we run CMD2. If CMD2 exits non-zero it's an error, but if it's 0 then we go. Basically, "if you are unable to get this info substitute this phrase". The other construct you'll see a lot is CMD1 && CMD2 which means "if CMD1 exits 0, then run CMD2".

@qdzlug qdzlug merged commit d00fd8b into nginxinc:master Apr 23, 2022
@qdzlug qdzlug deleted the jaymistake branch April 23, 2022 01:47
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants
0