mirror of
https://github.com/komodorio/helm-dashboard.git
synced 2026-03-26 14:28:04 +00:00
Compare commits
6 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
061bd12f2f | ||
|
|
86c9f89acc | ||
|
|
890994d70d | ||
|
|
35097fed45 | ||
|
|
11912e7b51 | ||
|
|
8e90c9f8d0 |
6
.github/workflows/release.yaml
vendored
6
.github/workflows/release.yaml
vendored
@@ -13,6 +13,12 @@ jobs:
|
||||
uses: actions/checkout@v3
|
||||
with:
|
||||
fetch-depth: 0
|
||||
- name: Inject version
|
||||
uses: jacobtomlinson/gha-find-replace@v2
|
||||
with:
|
||||
find: 'v0.0.0'
|
||||
replace: ${{ github.ref_name }}
|
||||
include: "pkg/dashboard/static/datadog.js"
|
||||
- name: Set up Go
|
||||
uses: actions/setup-go@v3
|
||||
with:
|
||||
|
||||
@@ -10,6 +10,7 @@ import (
|
||||
"github.com/hexops/gotextdiff/span"
|
||||
log "github.com/sirupsen/logrus"
|
||||
"gopkg.in/yaml.v3"
|
||||
"helm.sh/helm/v3/pkg/release"
|
||||
"io/ioutil"
|
||||
v1 "k8s.io/apimachinery/pkg/apis/testapigroup/v1"
|
||||
"os"
|
||||
@@ -116,12 +117,10 @@ func (d *DataLayer) CheckConnectivity() error {
|
||||
return errors.New("did not find any kubectl contexts configured")
|
||||
}
|
||||
|
||||
/*
|
||||
_, err = d.runCommandHelm("env") // no point in doing is, since the default context may be invalid
|
||||
_, err = d.runCommandHelm("--help") // no point in doing is, since the default context may be invalid
|
||||
if err != nil {
|
||||
return err
|
||||
}
|
||||
*/
|
||||
|
||||
return nil
|
||||
}
|
||||
@@ -385,12 +384,9 @@ func (d *DataLayer) ChartUpgrade(namespace string, name string, repoChart string
|
||||
return "", err
|
||||
}
|
||||
|
||||
cmd := []string{name, repoChart, "--version", version, "--namespace", namespace, "--values", file.Name()}
|
||||
cmd := []string{"upgrade", name, repoChart, "--version", version, "--namespace", namespace, "--values", file.Name(), "--output", "json"}
|
||||
if justTemplate {
|
||||
cmd = append([]string{"template", "--skip-tests"}, cmd...)
|
||||
} else {
|
||||
cmd = append([]string{"upgrade"}, cmd...)
|
||||
cmd = append(cmd, "--output", "json")
|
||||
cmd = append(cmd, "--dry-run")
|
||||
}
|
||||
|
||||
out, err := d.runCommandHelm(cmd...)
|
||||
@@ -399,11 +395,17 @@ func (d *DataLayer) ChartUpgrade(namespace string, name string, repoChart string
|
||||
}
|
||||
|
||||
if justTemplate {
|
||||
res := release.Release{}
|
||||
err = json.Unmarshal([]byte(out), &res)
|
||||
if err != nil {
|
||||
return "", err
|
||||
}
|
||||
|
||||
manifests, err := d.RevisionManifests(namespace, name, 0, false)
|
||||
if err != nil {
|
||||
return "", err
|
||||
}
|
||||
out = getDiff(strings.TrimSpace(manifests), strings.TrimSpace(out), "current.yaml", "upgraded.yaml")
|
||||
out = getDiff(strings.TrimSpace(manifests), strings.TrimSpace(res.Manifest), "current.yaml", "upgraded.yaml")
|
||||
}
|
||||
|
||||
return out, nil
|
||||
|
||||
18
pkg/dashboard/static/datadog.js
Normal file
18
pkg/dashboard/static/datadog.js
Normal file
@@ -0,0 +1,18 @@
|
||||
(function(h,o,u,n,d) {
|
||||
h=h[d]=h[d]||{q:[],onReady:function(c){h.q.push(c)}}
|
||||
d=o.createElement(u);d.async=1;d.src=n
|
||||
n=o.getElementsByTagName(u)[0];n.parentNode.insertBefore(d,n)
|
||||
})(window,document,'script','https://www.datadoghq-browser-agent.com/datadog-rum-v4.js','DD_RUM')
|
||||
DD_RUM.onReady(function() {
|
||||
DD_RUM.init({
|
||||
clientToken: 'pub16d64cd1c00cf073ce85af914333bf72',
|
||||
applicationId: 'e75439e5-e1b3-46ba-a9e9-a2e58579a2e2',
|
||||
site: 'datadoghq.com',
|
||||
service: 'helm-dashboard',
|
||||
version: 'v0.0.0',
|
||||
trackInteractions: true,
|
||||
trackResources: true,
|
||||
trackLongTasks: true,
|
||||
defaultPrivacyLevel: 'mask'
|
||||
})
|
||||
})
|
||||
@@ -5,6 +5,7 @@
|
||||
<meta charset="utf-8">
|
||||
<meta name="viewport" content="width=device-width, initial-scale=1">
|
||||
<title>Helm Dashboard</title>
|
||||
<script src="static/datadog.js"></script>
|
||||
<link rel="stylesheet"
|
||||
href="https://fonts.googleapis.com/css2?family=Roboto&family=Inter&family=Poppins:wght@600&family=Poppins:wght@500&family=Inter:wght@500&family=Roboto+Slab:wght@400&family=Roboto+Slab:wght@700&family=Roboto:wght@700&family=Roboto:wght@500"/>
|
||||
|
||||
@@ -14,6 +15,10 @@
|
||||
<link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/highlight.js/9.13.1/styles/lightfair.min.css"/>
|
||||
<link rel="stylesheet" type="text/css" href="https://cdn.jsdelivr.net/npm/diff2html/bundles/css/diff2html.min.css"/>
|
||||
<link href="static/styles.css" rel="stylesheet">
|
||||
<script type="text/javascript">
|
||||
window.heap=window.heap||[],heap.load=function(e,t){window.heap.appid=e,window.heap.config=t=t||{};var r=document.createElement("script");r.type="text/javascript",r.async=!0,r.src="https://cdn.heapanalytics.com/js/heap-"+e+".js";var a=document.getElementsByTagName("script")[0];a.parentNode.insertBefore(r,a);for(var n=function(e){return function(){heap.push([e].concat(Array.prototype.slice.call(arguments,0)))}},p=["addEventProperties","addUserProperties","clearEventProperties","identify","resetIdentity","removeEventProperty","setEventProperties","track","unsetEventProperty"],o=0;o<p.length;o++)heap[p[o]]=n(p[o])};
|
||||
heap.load("3615793373");
|
||||
</script>
|
||||
</head>
|
||||
<body>
|
||||
|
||||
@@ -278,7 +283,6 @@
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<script src="https://cdn.jsdelivr.net/npm/bootstrap@5.2.0/dist/js/bootstrap.bundle.min.js"
|
||||
integrity="sha384-A3rJD856KowSb7dwlZdYEkO39Gagi7vIsF0jrRAoQmDKKtQBHUuLZ9AsSv4jD4Xa"
|
||||
crossorigin="anonymous"></script>
|
||||
|
||||
@@ -62,6 +62,20 @@ function statusStyle(status, card, txt) {
|
||||
}
|
||||
}
|
||||
|
||||
function getCleanClusterName(rawClusterName) {
|
||||
if (rawClusterName.indexOf('arn')==0) {
|
||||
// AWS cluster
|
||||
clusterSplit = rawClusterName.split(':')
|
||||
clusterName = clusterSplit.at(-1).split("/").at(-1)
|
||||
region = clusterSplit.at(-3)
|
||||
return region + "/" + clusterName + ' [AWS]'
|
||||
}
|
||||
if (rawClusterName.indexOf('gke')==0) {
|
||||
// GKE cluster
|
||||
return rawClusterName.split('_').at(-2) + '/' + rawClusterName.split('_').at(-1) + ' [GKE]'
|
||||
}
|
||||
return rawClusterName
|
||||
}
|
||||
|
||||
function fillClusterList(data, context) {
|
||||
data.forEach(function (elm) {
|
||||
@@ -71,7 +85,7 @@ function fillClusterList(data, context) {
|
||||
let opt = $('<li><label><input type="radio" name="cluster" class="me-2"/><span></span></label></li>');
|
||||
opt.attr('title', label)
|
||||
opt.find("input").val(elm.Name).text(label)
|
||||
opt.find("span").text(label)
|
||||
opt.find("span").text(getCleanClusterName(label))
|
||||
if (elm.IsCurrent && !context) {
|
||||
opt.find("input").prop("checked", true)
|
||||
setCurrentContext(elm.Name)
|
||||
|
||||
@@ -272,6 +272,10 @@ span.link {
|
||||
color: #707583;
|
||||
}
|
||||
|
||||
#actionButtons .link {
|
||||
cursor: pointer;
|
||||
}
|
||||
|
||||
#actionButtons button > * {
|
||||
vertical-align: bottom;
|
||||
}
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
name: "dashboard"
|
||||
version: "0.0.6"
|
||||
version: "0.0.9"
|
||||
usage: "A simplified way of working with Helm"
|
||||
description: "View HELM situation in nice web UI"
|
||||
command: "$HELM_PLUGIN_DIR/bin/helm-dashboard"
|
||||
|
||||
BIN
screenshot.png
BIN
screenshot.png
Binary file not shown.
|
Before Width: | Height: | Size: 250 KiB After Width: | Height: | Size: 270 KiB |
Reference in New Issue
Block a user