From 20f017fd44d128ce41599ef8b7d61b5f5bb135ba41856bb924d546e0ae3e5745 Mon Sep 17 00:00:00 2001 From: Johannes Kastl Date: Wed, 3 Jul 2024 16:44:51 +0000 Subject: [PATCH] Accepting request 1185192 from home:ojkastl_buildservice:Branch_devel_kubic update to 0.5.2 OBS-URL: https://build.opensuse.org/request/show/1185192 OBS-URL: https://build.opensuse.org/package/show/devel:kubic/kor?expand=0&rev=40 --- .gitattributes | 23 ++++ .gitignore | 1 + _service | 20 ++++ _servicedata | 4 + kor-0.5.2.obscpio | 3 + kor.changes | 273 ++++++++++++++++++++++++++++++++++++++++++++++ kor.obsinfo | 4 + kor.spec | 123 +++++++++++++++++++++ vendor.tar.gz | 3 + 9 files changed, 454 insertions(+) create mode 100644 .gitattributes create mode 100644 .gitignore create mode 100644 _service create mode 100644 _servicedata create mode 100644 kor-0.5.2.obscpio create mode 100644 kor.changes create mode 100644 kor.obsinfo create mode 100644 kor.spec create mode 100644 vendor.tar.gz diff --git a/.gitattributes b/.gitattributes new file mode 100644 index 0000000..9b03811 --- /dev/null +++ b/.gitattributes @@ -0,0 +1,23 @@ +## Default LFS +*.7z filter=lfs diff=lfs merge=lfs -text +*.bsp filter=lfs diff=lfs merge=lfs -text +*.bz2 filter=lfs diff=lfs merge=lfs -text +*.gem filter=lfs diff=lfs merge=lfs -text +*.gz filter=lfs diff=lfs merge=lfs -text +*.jar filter=lfs diff=lfs merge=lfs -text +*.lz filter=lfs diff=lfs merge=lfs -text +*.lzma filter=lfs diff=lfs merge=lfs -text +*.obscpio filter=lfs diff=lfs merge=lfs -text +*.oxt filter=lfs diff=lfs merge=lfs -text +*.pdf filter=lfs diff=lfs merge=lfs -text +*.png filter=lfs diff=lfs merge=lfs -text +*.rpm filter=lfs diff=lfs merge=lfs -text +*.tbz filter=lfs diff=lfs merge=lfs -text +*.tbz2 filter=lfs diff=lfs merge=lfs -text +*.tgz filter=lfs diff=lfs merge=lfs -text +*.ttf filter=lfs diff=lfs merge=lfs -text +*.txz filter=lfs diff=lfs merge=lfs -text +*.whl filter=lfs diff=lfs merge=lfs -text +*.xz filter=lfs diff=lfs merge=lfs -text +*.zip filter=lfs diff=lfs merge=lfs -text +*.zst filter=lfs diff=lfs merge=lfs -text diff --git a/.gitignore b/.gitignore new file mode 100644 index 0000000..57affb6 --- /dev/null +++ b/.gitignore @@ -0,0 +1 @@ +.osc diff --git a/_service b/_service new file mode 100644 index 0000000..71e613e --- /dev/null +++ b/_service @@ -0,0 +1,20 @@ + + + https://github.com/yonahd/kor + git + .git + v0.5.2 + @PARENT_TAG@ + enable + v(.*) + + + + + + *.tar + gz + + + + diff --git a/_servicedata b/_servicedata new file mode 100644 index 0000000..17fe20d --- /dev/null +++ b/_servicedata @@ -0,0 +1,4 @@ + + + https://github.com/yonahd/kor + 181141dcce1fb608e6982500e88b8f0609b47356 \ No newline at end of file diff --git a/kor-0.5.2.obscpio b/kor-0.5.2.obscpio new file mode 100644 index 0000000..b003fe6 --- /dev/null +++ b/kor-0.5.2.obscpio @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:57aeaaa8381e57aea09c4c26cb4ec12a66e983a1b05eb9e0870efa5e81b25675 +size 789004 diff --git a/kor.changes b/kor.changes new file mode 100644 index 0000000..e98f7c9 --- /dev/null +++ b/kor.changes @@ -0,0 +1,273 @@ +------------------------------------------------------------------- +Wed Jul 03 16:36:27 UTC 2024 - opensuse_buildservice@ojkastl.de + +- Update to version 0.5.2: + * Fix: Add filters to replicasets (#324) + * fix(multi): Support grouping by resource in multi resource mode + (#320) + * fix(delete): Refactor input handling & output display on + resource deletion (#323) + * feat: add CI step to package and publish Helm chart (#306) + * update readme to show unused reason (#317) + +------------------------------------------------------------------- +Wed Jun 19 04:46:26 UTC 2024 - opensuse_buildservice@ojkastl.de + +- Update to version 0.5.1: + * feat: Add OpenShift exceptions (#311) + * fix: remove reason shorthand (#314) + +------------------------------------------------------------------- +Tue Jun 18 11:26:38 UTC 2024 - opensuse_buildservice@ojkastl.de + +- Update to version 0.5.0: + * feat: find unused networkpolicies (#296) + * Feat: show unused reason (#278) + * fix(image): Centered kor logo image (#308) + * chore(deps): bump k8s.io/apiextensions-apiserver from 0.30.1 to + 0.30.2 (#301) + * chore(deps): bump github.com/spf13/cobra from 1.8.0 to 1.8.1 + (#304) + * feat: add regex in resource exceptions (#277) + * refactor(cmd): standardize subcommand aliases with kubectl + shortnames (#300) + * Feature: exception sorting as makefile targets (#298) + * Add script to find kor exceptions (#294) + +------------------------------------------------------------------- +Fri Jun 07 19:38:02 UTC 2024 - opensuse_buildservice@ojkastl.de + +- Update to version 0.4.2: + * fix(pdb): fix nil pointer in pdb when selector.matchLabels is + nil (#297) + * style: add GitHub action to validate exceptions JSON sorting + (#295) + * feat: add helm chart testing (#293) + * fix(helm): Add missing labels key in metadata (#292) + * feat: add AWS EKS defaults (#291) + * chore: Add 'kor' to .gitignore (#290) + * Feat: add failed jobs as unused (#283) + * docs: add values.yaml descriptions to README.md (#281) + * chore(pull_request_template): Update PR template (#282) + * chore(charts): run helm-docs (#280) + * feat: add K3S exceptions (#270) + * fix(formatOutput): fix spacing between tables (#269) + +------------------------------------------------------------------- +Thu May 23 19:44:30 UTC 2024 - opensuse_buildservice@ojkastl.de + +- Update to version 0.4.1: + * Feat: add failed jobs as unused (#283) + * docs: add values.yaml descriptions to README.md (#281) + * chore(pull_request_template): Update PR template (#282) + * chore(charts): run helm-docs (#280) + * feat: add K3S exceptions (#270) + * fix(formatOutput): fix spacing between tables (#269) + * chore(deps): bump k8s.io/apiextensions-apiserver from 0.30.0 to + 0.30.1 (#275) + * chore(deps): bump github.com/fatih/color from 1.16.0 to 1.17.0 + (#274) + * feat(helm): Add Extra Labels to Helm Chart for Enhanced + Metadata Management (#265) + +------------------------------------------------------------------- +Tue May 14 05:13:41 UTC 2024 - opensuse_buildservice@ojkastl.de + +- Update to version 0.4.0: + * chore(deps): bump github.com/prometheus/client_golang (#264) + * feat: allow grouping options for output (#256) + * Add Kind exceptions (#263) + * Support -e as shortened flag for --exclude-namespaces (#261) + * feat: add AKS exceptions (#260) + * fix(GetUnusedAll): skip non-namespaced resources if + --include-namespaces flag is used (#258) + * fix: refactor exceptions into seperate files (#257) + * feat: add GKE exceptions (#252) + * ci: skip running go checks when no relevant files were changed + (#254) + * chore: add github pr template (#251) + +------------------------------------------------------------------- +Thu May 02 07:21:00 UTC 2024 - opensuse_buildservice@ojkastl.de + +- Update to version 0.3.8: + * refactor: map false minikube unused resources (#241) + * refactor: configure golangci-lint and upgrade github actions + (#246) + * chore: upgrade go version to 1.22.0 (#250) + * feat(image): build multi-arch image (#247) + * chore(deps): bump k8s.io/apiextensions-apiserver from 0.29.3 to + 0.30.0 (#244) + * Docs: Add CRDs to exceptions (#234) + * Add unused pods to getUnusedAllNamespaced (#231) + * Feat: Add support for multiple resources in Exporter function + (#229) + +------------------------------------------------------------------- +Mon Mar 25 07:45:19 UTC 2024 - opensuse_buildservice@ojkastl.de + +- Update to version 0.3.7: + * Fix: exclude multi (#228) + * Fixed GetUnusedAll() JSON concatenation (#227) + * chore(deps): bump k8s.io/apiextensions-apiserver from 0.29.2 to + 0.29.3 (#222) + * fix: ClusterRole Aggregation (#221) + * feat: unused StorageClasses (#216) + * chore(deps): bump github.com/prometheus/client_golang (#217) + +------------------------------------------------------------------- +Sat Mar 16 14:00:04 UTC 2024 - opensuse_buildservice@ojkastl.de + +- Update to version 0.3.6: + * feat: krew plugin workflow (#214) + * fix: when using -n option dont get all namespaces (#215) + * feat: add mark as unused label (#212) + * Feat: Added version subcommand (#210) + +------------------------------------------------------------------- +Tue Feb 20 20:51:10 UTC 2024 - opensuse_buildservice@ojkastl.de + +- Update to version 0.3.5: + * chore(deps): bump k8s.io/apiextensions-apiserver from 0.29.1 to + 0.29.2 (#207) + * feat: add clusterrole support (#198) + * docs: Update readme to reflect current state (#204) + * Added CONTRIBUTING.md (#203) + * Feat: added support for unused DaemonSets (#199) + +------------------------------------------------------------------- +Fri Feb 09 19:18:00 UTC 2024 - opensuse_buildservice@ojkastl.de + +- Update to version 0.3.4: + * Added missing resources and separated cluster-scoped resources + (#202) + * Fix: refactored mismatching deletion resource types (#201) + * Fix typo: corrected 'confimgmaps.go' to 'configmaps.go' (#196) + * Refactor some codes, add filter objects, and add support for + lable filtering... (#194) + * Fix typo: corrected 'retreive' to 'retrieve' (#195) + * refactor: remove unused "resourceMap" from GetUnusedCrds func + (#193) + * Version print only if table (#192) + * chore(deps): bump k8s.io/apiextensions-apiserver from 0.29.0 to + 0.29.1 (#188) + +------------------------------------------------------------------- +Mon Jan 15 16:52:51 UTC 2024 - opensuse_buildservice@ojkastl.de + +- Update to version 0.3.3: + * Add finalizer subcommand (#172) + * chore(deps): bump github.com/prometheus/client_golang (#185) + * feat: add replicaset cleaner (#180) + * chore(deps): bump k8s.io/apiextensions-apiserver from 0.28.4 to + 0.29.0 (#182) + * chore(deps): bump k8s.io/client-go from 0.28.4 to 0.29.0 (#183) + * Fix spaces and lots labels. (#177) + +------------------------------------------------------------------- +Sun Dec 10 19:15:44 UTC 2023 - kastl@b1-systems.de + +- Update to version 0.3.2: + * Add labels to all templates. (#174) + * Fix command in templates. (#175) + * Fix exporterInterval variable. (#176) + * feat: find evicted pods (#173) + * feat: add jobs cleaner (#168) + * Add discord server to Readme (#171) + +------------------------------------------------------------------- +Thu Nov 30 09:08:31 UTC 2023 - kastl@b1-systems.de + +- Update to version 0.3.1: + * fix ingress flag as used (#169) + * Feat: Find unused pv (#163) + * feat:add version flag to ldflags and print version in banner + (#158) + * Bump k8s.io/apiextensions-apiserver from 0.28.3 to 0.28.4 + (#162) + +------------------------------------------------------------------- +Thu Nov 16 12:10:47 UTC 2023 - kastl@b1-systems.de + +- Update to version 0.3.0: + * feat: add inUse label prompt for non deleted resources (#150) + * add ability to discover projected secrets (#156) + +------------------------------------------------------------------- +Tue Nov 14 12:09:19 UTC 2023 - kastl@b1-systems.de + +- Update to version 0.2.9: + * doc: add verbose flag (#154) + * fix: fix output banner for yaml and json (#153) + * fix incorrect example namespace flags (#152) + * fix: fix output for yaml and json, banner (#149) + * chore: add missing filters to service and SA (#148) + * fix: make verbose logs a flag (#147) + * chore: cleanup unused and remove dup (#146) + +------------------------------------------------------------------- +Mon Nov 13 06:34:40 UTC 2023 - kastl@b1-systems.de + +- Update to version 0.2.8: + * Crd Readme and multi support (#144) + * Bump github.com/fatih/color from 1.15.0 to 1.16.0 (#143) + * Refactor the GetUnusedMulti function (#142) + * chore: update to golang 1.21 and scratch (#141) + * feat: add support for linux arm64 (#139) + * add support for finding unused CRDs (#134) + * grafana dashboard ds selector and repeat kinds (#135) + * Fix exporter typo (#133) + * fix: clear counter between iterations (#132) + * fix: add filter options in export command (#129) + +------------------------------------------------------------------- +Mon Nov 06 05:45:00 UTC 2023 - kastl@b1-systems.de + +- Update to version 0.2.7: + * Document: add delete flag in Readme (#127) + * Bump github.com/spf13/cobra from 1.7.0 to 1.8.0 (#126) + * fix: Resolve panic error due to redefined flag in kor (#125) + * feat: add delete flag (#120) + +------------------------------------------------------------------- +Wed Nov 01 19:07:35 UTC 2023 - kastl@b1-systems.de + +- Update to version 0.2.6: + * feat: add customization and filtering options for finding + unused resources (#116) + * Add Grafana Dashboard (#118) + * Bump sigs.k8s.io/yaml from 1.3.0 to 1.4.0 (#119) + * Bump k8s.io/client-go from 0.28.2 to 0.28.3 (#112) + * Documentation: update chart with release v0.2.5 (#111) + +------------------------------------------------------------------- +Fri Oct 20 04:59:42 UTC 2023 - kastl@b1-systems.de + +- Update to version 0.2.5: + * Fix: validate HTTP field (#110) + * merge functions for configmaps (#108) + * Add helm documentation (#104) + * Fix: Add helm condition to skip secret manifest creation when + slack secrets are not provided (#101) + * Bump github.com/prometheus/client_golang from 1.16.0 to 1.17.0 + (#99) + +------------------------------------------------------------------- +Fri Oct 13 06:47:11 UTC 2023 - kastl@b1-systems.de + +- Update to version 0.2.4: + * Fix: add Logo (#98) + * Add Logo (#96) + * Update helm charts with deployment support (#90) + * Export Prometheus metrics (#87) + * Add feature request template + * add helm to the installation options (#93) + * feat: add send to slack support (#77) + * Update installation instructions to README.md (#88) + * feat: add helm charts with cronjob support (#78) + * style: consistent language (#85) + +------------------------------------------------------------------- +Fri Oct 13 06:47:00 UTC 2023 - Johannes Kastl + +- new package kor: Tool to discover unused Kubernetes Resources diff --git a/kor.obsinfo b/kor.obsinfo new file mode 100644 index 0000000..f7645a5 --- /dev/null +++ b/kor.obsinfo @@ -0,0 +1,4 @@ +name: kor +version: 0.5.2 +mtime: 1719389323 +commit: 181141dcce1fb608e6982500e88b8f0609b47356 diff --git a/kor.spec b/kor.spec new file mode 100644 index 0000000..0c6e8f1 --- /dev/null +++ b/kor.spec @@ -0,0 +1,123 @@ +# +# spec file for package kor +# +# Copyright (c) 2024 SUSE LLC +# +# All modifications and additions to the file contributed by third parties +# remain the property of their copyright owners, unless otherwise agreed +# upon. The license for this file, and modifications and additions to the +# file, is the same license as for the pristine package itself (unless the +# license for the pristine package is not an Open Source License, in which +# case the license is the MIT License). An "Open Source License" is a +# license that conforms to the Open Source Definition (Version 1.9) +# published by the Open Source Initiative. + +# Please submit bugfixes or comments via https://bugs.opensuse.org/ +# + + +%define __arch_install_post export NO_BRP_STRIP_DEBUG=true + +Name: kor +Version: 0.5.2 +Release: 0 +Summary: Tool to discover unused Kubernetes Resources +License: MIT +URL: https://github.com/yonahd/kor +Source: kor-%{version}.tar.gz +Source1: vendor.tar.gz +BuildRequires: go >= 1.22 + +%description +Kor is a tool to discover unused Kubernetes resources. Currently, Kor can identify and list unused: +- ConfigMaps +- Secrets +- Services +- ServiceAccounts +- Deployments +- StatefulSets +- Roles +- HPAs +- PVCs +- Ingresses +- PDBs + +%package -n %{name}-bash-completion +Summary: Bash Completion for %{name} +Group: System/Shells +Requires: %{name} = %{version} +Requires: bash-completion +Supplements: (%{name} and bash-completion) +BuildArch: noarch + +%description -n %{name}-bash-completion +Bash command line completion support for %{name}. + +%package -n %{name}-fish-completion +Summary: Fish Completion for %{name} +Group: System/Shells +Requires: %{name} = %{version} +Supplements: (%{name} and fish) +BuildArch: noarch + +%description -n %{name}-fish-completion +Fish command line completion support for %{name}. + +%package -n %{name}-zsh-completion +Summary: Zsh Completion for %{name} +Group: System/Shells +Requires: %{name} = %{version} +Supplements: (%{name} and zsh) +BuildArch: noarch + +%description -n %{name}-zsh-completion +zsh command line completion support for %{name}. + +%prep +%autosetup -p 1 -a 1 + +%build +DATE_FMT="+%%Y-%%m-%%dT%%H:%%M:%%SZ" +BUILD_DATE=$(date -u -d "@${SOURCE_DATE_EPOCH}" "${DATE_FMT}" 2>/dev/null || date -u -r "${SOURCE_DATE_EPOCH}" "${DATE_FMT}" 2>/dev/null || date -u "${DATE_FMT}") +go build \ + -mod=vendor \ + -buildmode=pie \ + -ldflags="-X github.com/GoogleContainerTools/kor/pkg/kor/version.version=%{version} -X github.com/GoogleContainerTools/kor/pkg/kor/version.buildDate=$BUILD_DATE" \ + -o bin/kor + +%install +# Install the binary. +install -D -m 0755 bin/%{name} "%{buildroot}/%{_bindir}/%{name}" + +# create the bash completion file +mkdir -p %{buildroot}%{_datarootdir}/bash-completion/completions/ +%{buildroot}/%{_bindir}/%{name} completion bash > %{buildroot}%{_datarootdir}/bash-completion/completions/%{name} + +# create the fish completion file +mkdir -p %{buildroot}%{_datarootdir}/fish/vendor_completions.d/ +%{buildroot}/%{_bindir}/%{name} completion fish > %{buildroot}%{_datarootdir}/fish/vendor_completions.d/%{name}.fish + +# create the zsh completion file +mkdir -p %{buildroot}%{_datarootdir}/zsh_completion.d/ +%{buildroot}/%{_bindir}/%{name} completion zsh > %{buildroot}%{_datarootdir}/zsh_completion.d/_%{name} + +%files +%doc README.md +%license LICENSE +%{_bindir}/%{name} + +%files -n %{name}-bash-completion +%dir %{_datarootdir}/bash-completion/completions/ +%{_datarootdir}/bash-completion/completions/%{name} + +%files -n %{name}-fish-completion +%dir %{_datarootdir}/fish +%dir %{_datarootdir}/fish/vendor_completions.d +%{_datarootdir}/fish/vendor_completions.d/%{name}.fish + +%files -n %{name}-zsh-completion +%defattr(-,root,root) +%dir %{_datarootdir}/zsh_completion.d/ +%{_datarootdir}/zsh_completion.d/_%{name} + +%changelog diff --git a/vendor.tar.gz b/vendor.tar.gz new file mode 100644 index 0000000..781722f --- /dev/null +++ b/vendor.tar.gz @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:74f531b47df481547c80f871ff664f786a7737e2a8ab0b3a60d346ab66745630 +size 6720277