Giter Site home page Giter Site logo

trendyol / kubectl-view-webhook Goto Github PK

View Code? Open in Web Editor NEW
107.0 9.0 7.0 906 KB

:eyes: :bangbang: This projects aims to visualize critical parts of the admission webhook configuration resource

License: Apache License 2.0

Go 100.00%
krew kubectl kubernetes admission-webhook kubectl-plugin go golang

kubectl-view-webhook's Introduction

kubectl-view-webhook

GitHub go.mod Go version GitHub tag (latest SemVer) GitHub Workflow Status goreleaser Go Report Card GitHub

Visualize your webhook configurations in Kubernetes.

asciicast

Table of Contents

Installation

Go binaries are automatically built with each release by GoReleaser. These can be accessed on the GitHub releases page for this project.

There are several ways to install view-webhook. The recommended installation method is via krew.

Via Go

$ go get https://github.com/Trendyol/kubectl-view-webhook

Via source code

Option 1 (if you have a Go compiler and want to tweak the code):

$ git clone https://github.com/Trendyol/kubectl-view-webhook
$ cd kubectl-view-webhook
$ go build .

Via krew

Krew is a kubectl plugin manager. If you have not yet installed krew, get it at kubernetes-sigs/krew. Then installation is as simple as :

$ kubectl krew install view-webhook
$ kubectl view-webhook --help

Usage

By default, view-webhook will display all the Validating&Mutating Admission webhooks that available on your cluster.Also, you can get the detail of each one of them by giving its name.

$ kubectl view-webhook [flags]
$ kubectl view-webhook NAME [flags]

Table details

| Kind                                      | Name                       | Webhook             | Service                    | Resources                                    | Operations                                  | Remaing Day        | Active Namespaces    |
|-------------------------------------------|----------------------------|---------------------|----------------------------|----------------------------------------------|---------------------------------------------|--------------------|----------------------|
| Type of the webhook (Mutating/Validating) | Name of the webhook config | Name of the webhook | service details of webhook | Kubernetes Resources which webhook interests | Kubernetes Operations(CREATE/UPDATE/DELETE) | Cert Remaining Day | Activated namespaces |

License

This repository is available under the Apache License 2.0.

kubectl-view-webhook's People

Contributors

dentrax avatar developer-guy avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

kubectl-view-webhook's Issues

Crash on usage

Describe the bug

% k view-webhook                                                                                                
W1002 10:10:34.102548   96545 warnings.go:67] admissionregistration.k8s.io/v1beta1 MutatingWebhookConfiguration is deprecated in v1.16+, unavailable in v1.22+; use admissionregistration.k8s.io/v1 MutatingWebhookConfiguration
W1002 10:10:34.162715   96545 warnings.go:67] admissionregistration.k8s.io/v1beta1 ValidatingWebhookConfiguration is deprecated in v1.16+, unavailable in v1.22+; use admissionregistration.k8s.io/v1 ValidatingWebhookConfiguration
panic: runtime error: invalid memory address or nil pointer dereference
[signal SIGSEGV: segmentation violation code=0x1 addr=0x18 pc=0x1e96c8a]

goroutine 1 [running]:
github.com/Trendyol/kubectl-view-webhook/pkg/k8s.retrieveValidDateCount(0x0, 0x0, 0x0, 0x0)
	/home/runner/work/kubectl-view-webhook/kubectl-view-webhook/pkg/k8s/webhook.go:257 +0x4a
github.com/Trendyol/kubectl-view-webhook/pkg/k8s.(*WebHookClient).fillMutatingWebhookConfigurations(0xc000353d60, 0x0, 0x0, 0x0, 0x0, 0xc00056cae0, 0x21, 0x0, 0x0, 0x0, ...)
	/home/runner/work/kubectl-view-webhook/kubectl-view-webhook/pkg/k8s/webhook.go:112 +0x2b3
github.com/Trendyol/kubectl-view-webhook/pkg/k8s.(*WebHookClient).Run(0xc000353d60, 0x2cf9798, 0x0, 0x0, 0xb, 0x2237d5a, 0x5)
	/home/runner/work/kubectl-view-webhook/kubectl-view-webhook/pkg/k8s/webhook.go:70 +0x208
github.com/Trendyol/kubectl-view-webhook/cmd.(*ViewWebhookOptions).Run(0xc0003e37a0, 0xc0003c7340, 0x2cf9798)
	/home/runner/work/kubectl-view-webhook/kubectl-view-webhook/cmd/root.go:139 +0xa5
github.com/Trendyol/kubectl-view-webhook/cmd.NewCmdViewWebhook.func1(0xc0003c7340, 0x2cf9798, 0x0, 0x0, 0x0, 0x0)
	/home/runner/work/kubectl-view-webhook/kubectl-view-webhook/cmd/root.go:70 +0x78
github.com/spf13/cobra.(*Command).execute(0xc0003c7340, 0xc00003a1d0, 0x0, 0x0, 0xc0003c7340, 0xc00003a1d0)
	/home/runner/go/pkg/mod/github.com/spf13/[email protected]/command.go:850 +0x47c
github.com/spf13/cobra.(*Command).ExecuteC(0xc0003c7340, 0xc00000e010, 0x23d6aa0, 0xc00000e018)
	/home/runner/go/pkg/mod/github.com/spf13/[email protected]/command.go:958 +0x375
github.com/spf13/cobra.(*Command).Execute(...)
	/home/runner/go/pkg/mod/github.com/spf13/[email protected]/command.go:895
main.main()
	/home/runner/work/kubectl-view-webhook/kubectl-view-webhook/main.go:36 +0x167
% k version                                                                                                 
Client Version: version.Info{Major:"1", Minor:"21", GitVersion:"v1.21.2", GitCommit:"092fbfbf53427de67cac1e9fa54aaa09a28371d7", GitTreeState:"clean", BuildDate:"2021-06-16T12:59:11Z", GoVersion:"go1.16.5", Compiler:"gc", Platform:"darwin/amd64"}
Server Version: version.Info{Major:"1", Minor:"21", GitVersion:"v1.21.4-gke.1801", GitCommit:"589503e56a4fd76a38f277d6fb11bd6ec4931482", GitTreeState:"clean", BuildDate:"2021-09-14T03:52:38Z", GoVersion:"go1.16.6b7", Compiler:"gc", Platform:"linux/amd64"}

To Reproduce
Steps to reproduce the behavior:

  1. Go to '...'
  2. Click on '....'
  3. Scroll down to '....'
  4. See error

Expected behavior
A clear and concise description of what you expected to happen.

Screenshots
If applicable, add screenshots to help explain your problem.

Desktop (please complete the following information):

  • OS: [e.g. iOS]
  • Browser [e.g. chrome, safari]
  • Version [e.g. 22]

Smartphone (please complete the following information):

  • Device: [e.g. iPhone6]
  • OS: [e.g. iOS8.1]
  • Browser [e.g. stock browser, safari]
  • Version [e.g. 22]

Additional context
Add any other context about the problem here.

Add support for darwin/arm64

Add support for Apple M1 based systems by building darwin/arm64 in goreleaser.

Currently after migrating and running a kubectl krew upgrade I see the following error

Upgrading plugin: view-webhook
WARNING: failed to upgrade plugin "view-webhook", skipping (error: plugin "view-webhook" does not offer installation for this platform (darwin/arm64))

Should not panic if CABundle not given

Describe the bug
It's throw panic if CABundle not included in Webhook.

To Reproduce

  1. Create a Webhook without CABundle included in
  2. kubectl view-webhook
  3. See panic

Expected behavior
Should not panic, instead it should print something like: No CABundle

Screenshots
Screen Shot 2020-12-23 at 23 38 11

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.