feat: add cluster auditing, management, and upgrade scripts
This commit is contained in:
15
scripts/inspect_argocd_apps.py
Normal file
15
scripts/inspect_argocd_apps.py
Normal file
@@ -0,0 +1,15 @@
|
||||
import glob
|
||||
import yaml
|
||||
|
||||
files = glob.glob(r"c:\Users\Snarf\OneDrive\Desktop\code\SnarfCode\homelab-gitops-repo\argocd\**\*.yaml", recursive=True)
|
||||
for f in files:
|
||||
with open(f, 'r') as fp:
|
||||
docs = yaml.safe_load_all(fp)
|
||||
for doc in docs:
|
||||
if not doc: continue
|
||||
if doc.get('kind') == 'Application':
|
||||
name = doc.get('metadata', {}).get('name')
|
||||
dest = doc.get('spec', {}).get('destination', {})
|
||||
src = doc.get('spec', {}).get('source', {})
|
||||
print(f"App: {name:<30} Path: {src.get('path'):<35} Server: {dest.get('server'):<35} NS: {dest.get('namespace')}")
|
||||
|
||||
Reference in New Issue
Block a user