Skip to content

Commit

Permalink
Merge pull request #383 from nyrahul/main
Browse files Browse the repository at this point in the history
progress animation fixes & read perms for OSSF workflow
  • Loading branch information
daemon1024 authored Nov 13, 2023
2 parents 4183b81 + 51fdc75 commit 57a92f9
Show file tree
Hide file tree
Showing 7 changed files with 44 additions and 91 deletions.
3 changes: 3 additions & 0 deletions .github/workflows/broken-link-check.yml
Original file line number Diff line number Diff line change
@@ -1,6 +1,9 @@
name: Broken link check
on: [push]

# Declare default permissions as read only.
permissions: read-all

jobs:
broken_link_checker_job:
runs-on: ubuntu-latest
Expand Down
5 changes: 4 additions & 1 deletion .github/workflows/ci-ginkgo-test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,9 @@ on:
pull_request:
branches: [main]

# Declare default permissions as read only.
permissions: read-all

jobs:
ginkgo-test:
runs-on: ubuntu-latest
Expand All @@ -29,4 +32,4 @@ jobs:
go install -mod=mod github.com/onsi/ginkgo/v2/ginkgo
make recommend -C tests/
timeout-minutes: 30


3 changes: 3 additions & 0 deletions .github/workflows/ci-go.yml
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,9 @@ on:
pull_request:
branches: [main]

# Declare default permissions as read only.
permissions: read-all

jobs:
go-build:
runs-on: ubuntu-latest
Expand Down
3 changes: 3 additions & 0 deletions .github/workflows/codeql-analysis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,9 @@ on:
schedule:
- cron: "27 20 * * 2"

# Declare default permissions as read only.
permissions: read-all

jobs:
analyze:
name: Analyze
Expand Down
16 changes: 8 additions & 8 deletions go.mod
Original file line number Diff line number Diff line change
Expand Up @@ -32,9 +32,9 @@ require (
github.com/sirupsen/logrus v1.9.0
github.com/spf13/cobra v1.7.0
golang.org/x/exp v0.0.0-20230510235704-dd950f8aeaea
golang.org/x/mod v0.10.0
golang.org/x/sync v0.2.0
golang.org/x/sys v0.10.0
golang.org/x/mod v0.13.0
golang.org/x/sync v0.4.0
golang.org/x/sys v0.13.0
google.golang.org/genproto v0.0.0-20230410155749-daa745c078e1 // indirect
google.golang.org/grpc v1.55.0
google.golang.org/protobuf v1.30.0
Expand Down Expand Up @@ -311,13 +311,13 @@ require (
go.uber.org/atomic v1.11.0 // indirect
go.uber.org/multierr v1.11.0 // indirect
go.uber.org/zap v1.24.0 // indirect
golang.org/x/crypto v0.10.0 // indirect
golang.org/x/net v0.11.0 // indirect
golang.org/x/crypto v0.14.0 // indirect
golang.org/x/net v0.16.0 // indirect
golang.org/x/oauth2 v0.8.0 // indirect
golang.org/x/term v0.9.0 // indirect
golang.org/x/text v0.10.0 // indirect
golang.org/x/term v0.13.0 // indirect
golang.org/x/text v0.13.0 // indirect
golang.org/x/time v0.3.0 // indirect
golang.org/x/tools v0.9.1 // indirect
golang.org/x/tools v0.14.1-0.20231026192422-8b5abd452b28 // indirect
google.golang.org/api v0.122.0 // indirect
google.golang.org/appengine v1.6.7 // indirect
gopkg.in/go-jose/go-jose.v2 v2.6.1 // indirect
Expand Down
91 changes: 16 additions & 75 deletions go.sum

Large diffs are not rendered by default.

14 changes: 7 additions & 7 deletions install/install.go
Original file line number Diff line number Diff line change
Expand Up @@ -120,17 +120,17 @@ func printMessage(msg string, flag bool) int {

func checkPods(c *k8s.Client, o Options) {
cursor := [4]string{"|", "/", "—", "\\"}
fmt.Printf("😋\tChecking if KubeArmor pods are running ...")
fmt.Printf("😋\tChecking if KubeArmor pods are running ...\n")
stime := time.Now()
otime := stime.Add(600 * time.Second)
for {
time.Sleep(200 * time.Millisecond)
pods, _ := c.K8sClientset.CoreV1().Pods("").List(context.TODO(), metav1.ListOptions{LabelSelector: "kubearmor-app", FieldSelector: "status.phase!=Running"})
podno := len(pods.Items)
clearLine(90)
fmt.Printf("\r\tKUBEARMOR pods left to run : %d ... %s", podno, cursor[cursorcount])
// clearLine(90)
fmt.Printf("\r\tKubeArmor pods left to run : %d ... %s", podno, cursor[cursorcount])
cursorcount++
if cursorcount == 4 {
if cursorcount == len(cursor) {
cursorcount = 0
}
if !otime.After(time.Now()) {
Expand Down Expand Up @@ -185,15 +185,15 @@ func checkPods(c *k8s.Client, o Options) {

func checkTerminatingPods(c *k8s.Client) int {
cursor := [4]string{"|", "/", "—", "\\"}
fmt.Printf("🔴 Checking if KubeArmor pods are stopped ...")
fmt.Printf("🔴 Checking if KubeArmor pods are stopped ...\n")
stime := time.Now()
otime := stime.Add(600 * time.Second)
for {
time.Sleep(200 * time.Millisecond)
pods, _ := c.K8sClientset.CoreV1().Pods("").List(context.TODO(), metav1.ListOptions{LabelSelector: "kubearmor-app", FieldSelector: "status.phase=Running"})
podno := len(pods.Items)
clearLine(90)
fmt.Printf("\rKUBEARMOR pods left to stop : %d ... %s", podno, cursor[cursorcount])
// clearLine(90)
fmt.Printf("\rKubeArmor pods left to stop : %d ... %s", podno, cursor[cursorcount])
cursorcount++
if cursorcount == 4 {
cursorcount = 0
Expand Down

0 comments on commit 57a92f9

Please sign in to comment.