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

chore/ingress-additions #315

Merged
merged 19 commits into from
Sep 19, 2024
Merged

chore/ingress-additions #315

merged 19 commits into from
Sep 19, 2024

Conversation

mosheavni
Copy link
Contributor

fix nil on hosts
fix ingress class, from annotation or from class property
open an ingress link in the browser

@@ -13,6 +14,58 @@ local function set_keymap(bufnr)
overview_view.View()
end,
})
api.nvim_buf_set_keymap(bufnr, "n", "gx", "", {
Copy link
Owner

Choose a reason for hiding this comment

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

I love this!

Copy link
Owner

@Ramilito Ramilito Sep 19, 2024

Choose a reason for hiding this comment

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

We need to add a plug function like this:

api.nvim_buf_set_keymap(bufnr, "n",  "<Plug>(kubectl.browse)", "", {

@Ramilito
Copy link
Owner

Tell me when you feel ready to merge!

@mosheavni
Copy link
Contributor Author

the keymap doesn't appear on hints. mind stepping in here?

@@ -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" },
Copy link
Owner

@Ramilito Ramilito Sep 19, 2024

Choose a reason for hiding this comment

The 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 ingresses_view = require("kubectl.views.ingresses")
local loop = require("kubectl.utils.loop")
local overview_view = require("kubectl.views.overview")
local mappings = require("kubectl.mappings")

mappings.map_if_plug_not_set("n", "gx", "<Plug>(kubectl.browse)")
Copy link
Owner

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 ☝️

@Ramilito
Copy link
Owner

the keymap doesn't appear on hints. mind stepping in here?

I did some ninja commits, but haven't verified that they actually work

@mosheavni
Copy link
Contributor Author

image any idea why?

@mosheavni
Copy link
Contributor Author

oh this stupid vim.notify(). i removed it

@mosheavni
Copy link
Contributor Author

ready!

@Ramilito
Copy link
Owner

Awesome idea about the browse to host btw 👏

@Ramilito Ramilito merged commit 2f1cd64 into Ramilito:main Sep 19, 2024
1 check passed
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