Documentation ¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func BuildRole ¶
func BuildRole(ctx context.Context, manifestStr string, opt BuildRoleOptions) ([]runtime.Object, error)
BuildRole parses the manifest and generates Role/ClusterRole objects for manipulating them.
func ResourceFromKind ¶
ResourceFromKind returns the resource name for the given kind. Because we don't require a cluster, it assumes the kind -> resource mapping follows normal conventions.
Types ¶
type BuildRoleOptions ¶
type BuildRoleOptions struct { Name string Namespace string ServiceAccountName string Supervisory bool // CRD is the name of the CRD to generate permissions for. CRD string // LimitResourceNames specifies that RBAC permissions should restrict to resource names in the manifest. LimitResourceNames bool // LimitNamespaces specifies that RBAC permissions should restrict to resource names in the manifest. LimitNamespaces bool // Format specifies the format we should write in (yaml or kubebuilder) Format string }
type KubebuilderConverter ¶
type KubebuilderConverter struct { // Rules holds the generated kubebuilder rules Rules []string }
KubebuilderConverter converts Role/Cluster objects to kubebuilder directives. These can then be copied and pasted into the code.
func (*KubebuilderConverter) VisitObjects ¶
func (c *KubebuilderConverter) VisitObjects(objects []runtime.Object) error
VisitObjects iterates over the provided Role/ClusterRule objects, generating equivalent kubebuilder statements.
Click to show internal directories.
Click to hide internal directories.