Skip to content

Commit

Permalink
Merge pull request #332 from daemon1024/add-viz-option
Browse files Browse the repository at this point in the history
  • Loading branch information
DelusionalOptimist authored Jun 20, 2023
2 parents c17fdff + cd010a1 commit 3eaffba
Show file tree
Hide file tree
Showing 4 changed files with 8 additions and 3 deletions.
1 change: 1 addition & 0 deletions cmd/install.go
Original file line number Diff line number Diff line change
Expand Up @@ -38,6 +38,7 @@ func init() {
installCmd.Flags().StringVarP(&installOptions.Tag, "tag", "t", "", "Change image tag/version for default kubearmor images (This will overwrite the tags provided in --image/--init-image)")
installCmd.Flags().StringVarP(&installOptions.Audit, "audit", "a", "", "Kubearmor Audit Posture Context [all,file,network,capabilities]")
installCmd.Flags().StringVarP(&installOptions.Block, "block", "b", "", "Kubearmor Block Posture Context [all,file,network,capabilities]")
installCmd.Flags().StringVarP(&installOptions.Visibility, "viz", "", "", "Kubearmor Telemetry Visibility [process,file,network,none]")
installCmd.Flags().BoolVar(&installOptions.Save, "save", false, "Save KubeArmor Manifest ")
installCmd.Flags().BoolVar(&installOptions.Local, "local", false, "Use Local KubeArmor Images (sets ImagePullPolicy to 'IfNotPresent') ")
installCmd.Flags().StringVarP(&installOptions.Env.Environment, "env", "e", "", "Supported KubeArmor Environment [k3s,microK8s,minikube,gke,bottlerocket,eks,docker,oke,generic]")
Expand Down
2 changes: 1 addition & 1 deletion go.mod
Original file line number Diff line number Diff line change
Expand Up @@ -54,7 +54,7 @@ require (
github.com/google/go-github v17.0.0+incompatible
github.com/kubearmor/KVMService/src/types v0.0.0-20220714130113-b0eba8c9ff34
github.com/kubearmor/KubeArmor/KubeArmor v0.0.0-20230519075515-e8b45043a53d
github.com/kubearmor/KubeArmor/deployments v0.0.0-20230519075515-e8b45043a53d
github.com/kubearmor/KubeArmor/deployments v0.0.0-20230616113436-0f9e047493a0
github.com/kubearmor/KubeArmor/pkg/KubeArmorController v0.0.0-20230519075515-e8b45043a53d
github.com/kyverno/kyverno v1.9.2
github.com/mgutz/ansi v0.0.0-20200706080929-d51e80ef957d
Expand Down
4 changes: 2 additions & 2 deletions go.sum
Original file line number Diff line number Diff line change
Expand Up @@ -941,8 +941,8 @@ github.com/kubearmor/KVMService/src/types v0.0.0-20220714130113-b0eba8c9ff34 h1:
github.com/kubearmor/KVMService/src/types v0.0.0-20220714130113-b0eba8c9ff34/go.mod h1:jH95bvc6gzdHxVdyUAx/MM9q27P9EPQUl13HkBO5mr4=
github.com/kubearmor/KubeArmor/KubeArmor v0.0.0-20230519075515-e8b45043a53d h1:Xo4Hu+N0qtuL6nRyNVY63/N8dJ9fAXsUt9hgiQliCTA=
github.com/kubearmor/KubeArmor/KubeArmor v0.0.0-20230519075515-e8b45043a53d/go.mod h1:cxd9uwX/DRTrohxEmFjFfc6sGYnKv/UJAChZAcXE0w8=
github.com/kubearmor/KubeArmor/deployments v0.0.0-20230519075515-e8b45043a53d h1:gv2p/a6ktJd+muN2S7w/QHH3Gb7vLxBPTJ4eDk5G2WU=
github.com/kubearmor/KubeArmor/deployments v0.0.0-20230519075515-e8b45043a53d/go.mod h1:olZd5dg62Q2tDM+9kDzONb17y8jUgC4AQDERLeGKlU0=
github.com/kubearmor/KubeArmor/deployments v0.0.0-20230616113436-0f9e047493a0 h1:eJplbQJ2l/7QJG0uKZc02rVM4yaH6EeFC66lN/Bt81c=
github.com/kubearmor/KubeArmor/deployments v0.0.0-20230616113436-0f9e047493a0/go.mod h1:olZd5dg62Q2tDM+9kDzONb17y8jUgC4AQDERLeGKlU0=
github.com/kubearmor/KubeArmor/pkg/KubeArmorController v0.0.0-20230519075515-e8b45043a53d h1:XkdaQfg47aarvppbWfk5IS0UkeUYxqMOlvsauAWY5QI=
github.com/kubearmor/KubeArmor/pkg/KubeArmorController v0.0.0-20230519075515-e8b45043a53d/go.mod h1:e8Jy4rDPf+O/H+ThAlCILTLkAVy3WgKW3SssLQat+RY=
github.com/kubearmor/KubeArmor/protobuf v0.0.0-20230515155803-35434b6407a5 h1:x/YB29Jgv342DvDwyjCt9kYfUlUaRc2C+QHuaLPrgVY=
Expand Down
4 changes: 4 additions & 0 deletions install/install.go
Original file line number Diff line number Diff line change
Expand Up @@ -36,6 +36,7 @@ type Options struct {
Tag string
Audit string
Block string
Visibility string
Force bool
Local bool
Save bool
Expand Down Expand Up @@ -423,6 +424,9 @@ func K8sInstaller(c *k8s.Client, o Options) error {
}

kubearmorConfigMap := deployments.GetKubearmorConfigMap(o.Namespace, deployments.KubeArmorConfigMapName)
if o.Visibility != "" && o.Visibility != kubearmorConfigMap.Data["visibility"] {
kubearmorConfigMap.Data["visibility"] = o.Visibility
}
if !o.Save {
printMessage("🚀 KubeArmor ConfigMap Creation ", true)
if _, err := c.K8sClientset.CoreV1().ConfigMaps(o.Namespace).Create(context.Background(), kubearmorConfigMap, metav1.CreateOptions{}); err != nil {
Expand Down

0 comments on commit 3eaffba

Please sign in to comment.