fix colors for version cmd + first try arm and snap builds
parent
0a6caa2d54
commit
5f0a5df90a
|
|
@ -60,7 +60,7 @@ brew:
|
|||
test: |
|
||||
system "k9s version"
|
||||
|
||||
# Snap
|
||||
# Snapcraft
|
||||
snapcraft:
|
||||
name: k9s
|
||||
name_template: "{{ .ProjectName }}_{{ .Version }}_{{ .Os }}_{{ .Arch }}"
|
||||
|
|
@ -71,7 +71,7 @@ snapcraft:
|
|||
darwin: macOS
|
||||
linux: Tux
|
||||
|
||||
publish: false
|
||||
publish: true
|
||||
|
||||
summary: K9s is a CLI to view and manage your Kubernetes clusters.
|
||||
description: |
|
||||
|
|
|
|||
|
|
@ -0,0 +1,26 @@
|
|||
# Release v0.3.3
|
||||
|
||||
## Notes
|
||||
|
||||
Thank you to all that contributed with flushing out issues with K9s! I'll try
|
||||
to mark some of these issues as fixed. But if you don't mind grab the latest
|
||||
rev and see if we're happier with some of the fixes!
|
||||
|
||||
If you've filed an issue please help me verify and close.
|
||||
|
||||
Thank you so much for your support!!
|
||||
|
||||
---
|
||||
|
||||
## Change Logs
|
||||
|
||||
1. [Feature #131](https://github.com/derailed/k9s/issues/131)
|
||||
Preliminary support for snapcraft builds ie read trying this out...
|
||||
2. [Feature #118](https://github.com/derailed/k9s/issues/118) Add arm 32/64 bit builds.
|
||||
NOTE: will need help vetting this out as my rpi cluster is currently down.
|
||||
|
||||
---
|
||||
|
||||
## Resolved Bugs
|
||||
|
||||
+ [Feature #132](https://github.com/derailed/k9s/issues/132). With feelings!
|
||||
|
|
@ -1,51 +0,0 @@
|
|||
package k8s
|
||||
|
||||
import (
|
||||
"fmt"
|
||||
"time"
|
||||
|
||||
"github.com/rs/zerolog/log"
|
||||
metav1 "k8s.io/apimachinery/pkg/apis/meta/v1"
|
||||
// rbacv1 "k8s.io/client-go/kubernetes/typed/rbac/v1"
|
||||
)
|
||||
|
||||
func GetFu(c Connection, kind, name string) error {
|
||||
defer func(t time.Time) {
|
||||
log.Info().Msgf("Elapsed %v", time.Since(t))
|
||||
}(time.Now())
|
||||
|
||||
crbs, err := c.DialOrDie().RbacV1().ClusterRoleBindings().List(metav1.ListOptions{
|
||||
FieldSelector: "metadata.name=cluster-admin",
|
||||
})
|
||||
if err != nil {
|
||||
return err
|
||||
}
|
||||
|
||||
log.Info().Msgf("Len %d", len(crbs.Items))
|
||||
|
||||
var crs []string
|
||||
for _, crb := range crbs.Items {
|
||||
log.Info().Msgf("> CRB %s", crb.Name)
|
||||
for _, s := range crb.Subjects {
|
||||
// log.Info().Msgf(" Sub %s %s", s.Kind, s.Name)
|
||||
if s.Kind == kind && s.Name == name {
|
||||
crs = append(crs, crb.RoleRef.Name)
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
fmt.Printf("Find cluster roles %#v\n", crs)
|
||||
|
||||
// Each role has multiple rules
|
||||
for _, r := range crs {
|
||||
cr, err := c.DialOrDie().RbacV1().ClusterRoles().Get(r, metav1.GetOptions{})
|
||||
if err != nil {
|
||||
log.Error().Err(err).Msgf("Unable to find cluster role %s ", r)
|
||||
}
|
||||
for _, rule := range cr.Rules {
|
||||
log.Info().Msgf("Found rule %#v", rule.APIGroups)
|
||||
}
|
||||
}
|
||||
|
||||
return nil
|
||||
}
|
||||
|
|
@ -1,32 +0,0 @@
|
|||
package k8s
|
||||
|
||||
import (
|
||||
"os"
|
||||
"testing"
|
||||
|
||||
"github.com/rs/zerolog"
|
||||
"github.com/rs/zerolog/log"
|
||||
"github.com/stretchr/testify/assert"
|
||||
"k8s.io/cli-runtime/pkg/genericclioptions"
|
||||
_ "k8s.io/client-go/plugin/pkg/client/auth"
|
||||
)
|
||||
|
||||
func TestRBACFu(t *testing.T) {
|
||||
con := dial()
|
||||
assert.Nil(t, GetFu(con, "Group", "system:masters"))
|
||||
}
|
||||
|
||||
func dial() *APIClient {
|
||||
zerolog.SetGlobalLevel(zerolog.InfoLevel)
|
||||
log.Logger = log.Output(zerolog.ConsoleWriter{Out: os.Stderr})
|
||||
|
||||
// c, u := "gke_k9s", "gke_k9s_user"
|
||||
c, u := "minikube", "minikube"
|
||||
|
||||
flags := genericclioptions.ConfigFlags{
|
||||
ClusterName: &c,
|
||||
AuthInfoName: &u,
|
||||
}
|
||||
cfg := NewConfig(&flags)
|
||||
return InitConnectionOrDie(cfg, log.Logger)
|
||||
}
|
||||
Loading…
Reference in New Issue