Skip to content

Commit

Permalink
Adding clusterrole and rolebinding
Browse files Browse the repository at this point in the history
  • Loading branch information
marccampbell committed Jan 17, 2020
1 parent fbcdc56 commit ca5fecd
Show file tree
Hide file tree
Showing 9 changed files with 1,400 additions and 668 deletions.
314 changes: 157 additions & 157 deletions config/rbac/rbac_role.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -4,160 +4,160 @@ metadata:
creationTimestamp: null
name: manager-role
rules:
- apiGroups:
- apps
resources:
- deployments
verbs:
- get
- list
- watch
- create
- update
- patch
- delete
- apiGroups:
- apps
resources:
- deployments/status
verbs:
- get
- update
- patch
- apiGroups:
- databases.schemahero.io
resources:
- databases
verbs:
- get
- list
- watch
- create
- update
- patch
- delete
- apiGroups:
- databases.schemahero.io
resources:
- databases/status
verbs:
- get
- update
- patch
- apiGroups:
- apps
resources:
- deployments
verbs:
- get
- list
- watch
- create
- update
- patch
- delete
- apiGroups:
- apps
resources:
- deployments/status
verbs:
- get
- update
- patch
- apiGroups:
- schemas.schemahero.io
resources:
- migrations
verbs:
- get
- list
- watch
- create
- update
- patch
- delete
- apiGroups:
- schemas.schemahero.io
resources:
- migrations/status
verbs:
- get
- update
- patch
- apiGroups:
- apps
resources:
- deployments
verbs:
- get
- list
- watch
- create
- update
- patch
- delete
- apiGroups:
- apps
resources:
- deployments/status
verbs:
- get
- update
- patch
- apiGroups:
- schemas.schemahero.io
resources:
- tables
verbs:
- get
- list
- watch
- create
- update
- patch
- delete
- apiGroups:
- schemas.schemahero.io
resources:
- tables/status
verbs:
- get
- update
- patch
- apiGroups:
- admissionregistration.k8s.io
resources:
- mutatingwebhookconfigurations
- validatingwebhookconfigurations
verbs:
- get
- list
- watch
- create
- update
- patch
- delete
- apiGroups:
- ""
resources:
- secrets
verbs:
- get
- list
- watch
- create
- update
- patch
- delete
- apiGroups:
- ""
resources:
- services
verbs:
- get
- list
- watch
- create
- update
- patch
- delete
- apiGroups:
- apps
resources:
- deployments
verbs:
- get
- list
- watch
- create
- update
- patch
- delete
- apiGroups:
- apps
resources:
- deployments/status
verbs:
- get
- update
- patch
- apiGroups:
- databases.schemahero.io
resources:
- databases
verbs:
- get
- list
- watch
- create
- update
- patch
- delete
- apiGroups:
- databases.schemahero.io
resources:
- databases/status
verbs:
- get
- update
- patch
- apiGroups:
- apps
resources:
- deployments
verbs:
- get
- list
- watch
- create
- update
- patch
- delete
- apiGroups:
- apps
resources:
- deployments/status
verbs:
- get
- update
- patch
- apiGroups:
- schemas.schemahero.io
resources:
- migrations
verbs:
- get
- list
- watch
- create
- update
- patch
- delete
- apiGroups:
- schemas.schemahero.io
resources:
- migrations/status
verbs:
- get
- update
- patch
- apiGroups:
- apps
resources:
- deployments
verbs:
- get
- list
- watch
- create
- update
- patch
- delete
- apiGroups:
- apps
resources:
- deployments/status
verbs:
- get
- update
- patch
- apiGroups:
- schemas.schemahero.io
resources:
- tables
verbs:
- get
- list
- watch
- create
- update
- patch
- delete
- apiGroups:
- schemas.schemahero.io
resources:
- tables/status
verbs:
- get
- update
- patch
- apiGroups:
- admissionregistration.k8s.io
resources:
- mutatingwebhookconfigurations
- validatingwebhookconfigurations
verbs:
- get
- list
- watch
- create
- update
- patch
- delete
- apiGroups:
- ""
resources:
- secrets
verbs:
- get
- list
- watch
- create
- update
- patch
- delete
- apiGroups:
- ""
resources:
- services
verbs:
- get
- list
- watch
- create
- update
- patch
- delete
1 change: 1 addition & 0 deletions go.sum
Original file line number Diff line number Diff line change
Expand Up @@ -534,6 +534,7 @@ k8s.io/apimachinery v0.0.0-20190404173353-6a84e37a896d/go.mod h1:ccL7Eh7zubPUSh9
k8s.io/apimachinery v0.0.0-20190913080033-27d36303b655/go.mod h1:nL6pwRT8NgfF8TT68DBI8uEePRt89cSvoXUVqbkWHq4=
k8s.io/apimachinery v0.17.0 h1:xRBnuie9rXcPxUkDizUsGvPf1cnlZCFu210op7J7LJo=
k8s.io/apimachinery v0.17.0/go.mod h1:b9qmWdKlLuU9EBh+06BtLcSf/Mu89rWL33naRxs1uZg=
k8s.io/apimachinery v0.17.1 h1:zUjS3szTxoUjTDYNvdFkYt2uMEXLcthcbp+7uZvWhYM=
k8s.io/apiserver v0.0.0-20190918160949-bfa5e2e684ad/go.mod h1:XPCXEwhjaFN29a8NldXA901ElnKeKLrLtREO9ZhFyhg=
k8s.io/cli-runtime v0.17.0 h1:XEuStbJBHCQlEKFyTQmceDKEWOSYHZkcYWKp3SsQ9Hk=
k8s.io/cli-runtime v0.17.0/go.mod h1:1E5iQpMODZq2lMWLUJELwRu2MLWIzwvMgDBpn3Y81Qo=
Expand Down
18 changes: 18 additions & 0 deletions pkg/cli/schemaherokubectlcli/install.go
Original file line number Diff line number Diff line change
@@ -1,6 +1,8 @@
package schemaherokubectlcli

import (
"fmt"

"github.com/schemahero/schemahero/pkg/installer"
"github.com/spf13/cobra"
"github.com/spf13/viper"
Expand All @@ -16,13 +18,29 @@ func InstallCmd() *cobra.Command {
viper.BindPFlags(cmd.Flags())
},
RunE: func(cmd *cobra.Command, args []string) error {
v := viper.GetViper()

if v.GetBool("yaml") {
manifests, err := installer.GenerateOperatorYAML()
if err != nil {
fmt.Printf("Error: %s\n", err.Error())
return err
}

fmt.Printf("%s\n", manifests)
return nil
}
if err := installer.InstallOperator(); err != nil {
fmt.Printf("Error: %s\n", err.Error())
return err
}

fmt.Println("The SchemaHero operator has been installed to the cluster")
return nil
},
}

cmd.Flags().Bool("yaml", false, "Is present, don't install the operator, just generate the yaml")

return cmd
}

0 comments on commit ca5fecd

Please sign in to comment.