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

fix: Don't error if $globals.CurrentContainer is nil #2191

Merged
merged 1 commit into from Mar 14, 2023

Conversation

rhansen
Copy link
Collaborator

@rhansen rhansen commented Mar 10, 2023

Also:

  • Note when there are no networks.
  • Fix "networks available" comment.

Fixes #2189

@rhansen
Copy link
Collaborator Author

rhansen commented Mar 10, 2023

Can you test this @genestouxguy (or @SchoNie)?

@SchoNie
Copy link
Contributor

SchoNie commented Mar 10, 2023

It's failing for me with -only-exposed:
Template error: template: nginx.tmpl:29:10: executing "nginx.tmpl" at <sortObjectsByKeysAsc (or $globals.CurrentContainer (dict)).Networks "Name">: error calling sortObjectsByKeysAsc: must pass an array or slice to 'sortObjsByKeys'; received <nil>; kind invalid

Also:
  * Note when there are no networks.
  * Fix "networks available" comment.
@rhansen
Copy link
Collaborator Author

rhansen commented Mar 10, 2023

It's failing for me with -only-exposed

That's what I get for hastily tossing the fix together. Thanks for testing @SchoNie. I pushed a new version; would you mind testing it?

@SchoNie
Copy link
Contributor

SchoNie commented Mar 11, 2023

Confirm now it's OK.
Both scenarios (with and without -only-exposed) tested.

@rhansen rhansen requested a review from buchdag March 11, 2023 07:52
@buchdag buchdag merged commit 1f855fc into nginx-proxy:main Mar 14, 2023
@rhansen rhansen deleted the nil-currentcontainer branch March 14, 2023 07:29
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.

template nginx.tmpl error : nil pointer evaluating interface {}.Networks
3 participants