-
Notifications
You must be signed in to change notification settings - Fork 5
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
chore/ingress-additions #315
Merged
Merged
Changes from all commits
Commits
Show all changes
19 commits
Select commit
Hold shift + click to select a range
72e1b71
feat/keymap-shift-tab
mosheavni 6a440af
👑 work in progress Sun Sep 8 13:19:17 2024
mosheavni 7b7237e
feat/port-forward-keymaps
mosheavni 6bcbe3a
fix pattern
mosheavni 929545a
Merge branch 'feat/port-forward-keymaps' of github.com:mosheavni/kube…
mosheavni 8f61171
Merge branch 'main' of github.com:mosheavni/kubectl.nvim
mosheavni 18bc6de
Merge remote-tracking branch 'rami/main'
mosheavni bc5fae8
Merge remote-tracking branch 'rami/main'
mosheavni 322d72e
Merge branch 'main' of github.com:mosheavni/kubectl.nvim
mosheavni 20f82c4
Merge remote-tracking branch 'rami/main'
mosheavni a051daa
Merge remote-tracking branch 'rami/main'
mosheavni 9ab16af
fix/ingress-nil
mosheavni 021f865
🚀 work in progress Thu Sep 19 11:02:23 2024
mosheavni 6e76b11
🙉 work in progress Thu Sep 19 11:06:12 2024
mosheavni 39fe3d8
add notify
mosheavni b0e8571
add hint
Ramilito 60e8a84
add plug to mapping
Ramilito 4b27388
fix mapping
Ramilito 2699aad
remove notify
mosheavni File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -5,6 +5,9 @@ local M = { | |
display_name = "Ingresses", | ||
ft = "k8s_ingresses", | ||
url = { "{{BASE}}/apis/networking.k8s.io/v1/{{NAMESPACE}}ingresses?pretty=false" }, | ||
hints = { | ||
{ key = "<Plug>(kubectl.browse)", desc = "browse", long_desc = "Open host in browser" }, | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. and also add a hint here ☝️ (did an edit on the file since I couldn't comment without any changes) |
||
}, | ||
} | ||
|
||
local function get_ports(row) | ||
|
@@ -27,6 +30,9 @@ local function get_ports(row) | |
end | ||
|
||
local function get_hosts(row) | ||
if not row.spec or not row.spec.rules then | ||
return "" | ||
end | ||
local hosts = {} | ||
|
||
for _, rule in ipairs(row.spec.rules) do | ||
|
@@ -55,6 +61,12 @@ local function get_address(row) | |
return table.concat(addresses, ", ") | ||
end | ||
|
||
local function get_class(row) | ||
return row.spec.ingressClassName | ||
or row.metadata.annotations and row.metadata.annotations["kubernetes.io/ingress.class"] | ||
or "" | ||
end | ||
|
||
function M.processRow(rows) | ||
local data = {} | ||
|
||
|
@@ -69,7 +81,7 @@ function M.processRow(rows) | |
data[i] = { | ||
namespace = row.metadata.namespace, | ||
name = row.metadata.name, | ||
class = row.spec.ingressClassName, | ||
class = get_class(row), | ||
hosts = get_hosts(row), | ||
address = get_address(row), | ||
ports = get_ports(row), | ||
|
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
And then the actual mapping here ☝️