这是indexloc提供的服务,不要输入任何密码
Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions api/v1alpha1/humiogroup_types.go
Original file line number Diff line number Diff line change
Expand Up @@ -26,12 +26,12 @@ type HumioGroupSpec struct {
// This conflicts with ManagedClusterName.
ExternalClusterName string `json:"externalClusterName,omitempty"`
// Name is the display name of the HumioGroup
// +kubebuilder:validation:MinLength=1
// +kubebuilder:validation:MinLength=2
// +kubebuilder:validation:XValidation:rule="self == oldSelf",message="Value is immutable"
// +kubebuilder:validation:Required
Name string `json:"name"`
// ExternalMappingName is the mapping name from the external provider that will assign the user to this HumioGroup
// +kubebuilder:validation:MinLength=2
// +kubebuilder:validation:MinLength=1
// +kubebuilder:validation:Optional
ExternalMappingName *string `json:"externalMappingName,omitempty"`
}
Expand Down
8 changes: 6 additions & 2 deletions api/v1alpha1/humioorganizationpermissionrole_types.go
Original file line number Diff line number Diff line change
Expand Up @@ -53,8 +53,12 @@ type HumioOrganizationPermissionRoleSpec struct {
// +kubebuilder:validation:items:MinLength=1
// +listType=set
Permissions []string `json:"permissions"`
// TODO: Add support for assigning the role to groups
// Groups *string `json:"groups,omitempty"`
// RoleAssignmentGroupNames lists the names of LogScale groups that this role is assigned to.
// It is optional to specify the list of role assignments. If not specified, the role will not be assigned to any groups.
// +kubebuilder:validation:Optional
// +kubebuilder:validation:items:MinLength=1
// +listType=set
RoleAssignmentGroupNames []string `json:"roleAssignmentGroupNames,omitempty"`
}

// HumioOrganizationPermissionRoleStatus defines the observed state of HumioOrganizationPermissionRole.
Expand Down
8 changes: 6 additions & 2 deletions api/v1alpha1/humiosystempermissionrole_types.go
Original file line number Diff line number Diff line change
Expand Up @@ -53,8 +53,12 @@ type HumioSystemPermissionRoleSpec struct {
// +kubebuilder:validation:items:MinLength=1
// +listType=set
Permissions []string `json:"permissions"`
// TODO: Add support for assigning the role to groups
// Groups *string `json:"groups,omitempty"`
// RoleAssignmentGroupNames lists the names of LogScale groups that this role is assigned to.
// It is optional to specify the list of role assignments. If not specified, the role will not be assigned to any groups.
// +kubebuilder:validation:Optional
// +kubebuilder:validation:items:MinLength=1
// +listType=set
RoleAssignmentGroupNames []string `json:"roleAssignmentGroupNames,omitempty"`
}

// HumioSystemPermissionRoleStatus defines the observed state of HumioSystemPermissionRole.
Expand Down
18 changes: 16 additions & 2 deletions api/v1alpha1/humioviewpermissionrole_types.go
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,18 @@ const (
HumioViewPermissionRoleStateConfigError = "ConfigError"
)

// HumioViewPermissionRoleAssignment specifies a view or repo and a group to assign it to.
type HumioViewPermissionRoleAssignment struct {
// RepoOrViewName specifies the name of the view or repo to assign the view permission role.
// +kubebuilder:validation:MinLength=1
// +kubebuilder:validation:Required
RepoOrViewName string `json:"repoOrViewName"`
// GroupName specifies the name of the group to assign the view permission role to.
// +kubebuilder:validation:MinLength=1
// +kubebuilder:validation:Required
GroupName string `json:"groupName"`
}

// HumioViewPermissionRoleSpec defines the desired state of HumioViewPermissionRole.
// +kubebuilder:validation:XValidation:rule="(has(self.managedClusterName) && self.managedClusterName != \"\") != (has(self.externalClusterName) && self.externalClusterName != \"\")",message="Must specify exactly one of managedClusterName or externalClusterName"
type HumioViewPermissionRoleSpec struct {
Expand All @@ -53,8 +65,10 @@ type HumioViewPermissionRoleSpec struct {
// +kubebuilder:validation:items:MinLength=1
// +listType=set
Permissions []string `json:"permissions"`
// TODO: Add support for assigning the role to groups. These assignments do not just take a group name, but also a view for where this is assigned, so will need to adjust the field below to reflect that.
// Groups *string `json:"groups,omitempty"`
// RoleAssignments lists the names of LogScale groups that this role is assigned to and for which views/repositories.
// It is optional to specify the list of role assignments. If not specified, the role will not be assigned to any groups.
// +kubebuilder:validation:Optional
RoleAssignments []HumioViewPermissionRoleAssignment `json:"roleAssignments,omitempty"`
}

// HumioViewPermissionRoleStatus defines the observed state of HumioViewPermissionRole.
Expand Down
30 changes: 30 additions & 0 deletions api/v1alpha1/zz_generated.deepcopy.go

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

4 changes: 2 additions & 2 deletions charts/humio-operator/crds/core.humio.com_humiogroups.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -58,7 +58,7 @@ spec:
externalMappingName:
description: ExternalMappingName is the mapping name from the external
provider that will assign the user to this HumioGroup
minLength: 2
minLength: 1
type: string
managedClusterName:
description: |-
Expand All @@ -68,7 +68,7 @@ spec:
type: string
name:
description: Name is the display name of the HumioGroup
minLength: 1
minLength: 2
type: string
x-kubernetes-validations:
- message: Value is immutable
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -75,6 +75,15 @@ spec:
minItems: 1
type: array
x-kubernetes-list-type: set
roleAssignmentGroupNames:
description: |-
RoleAssignmentGroupNames lists the names of LogScale groups that this role is assigned to.
It is optional to specify the list of role assignments. If not specified, the role will not be assigned to any groups.
items:
minLength: 1
type: string
type: array
x-kubernetes-list-type: set
required:
- name
- permissions
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -75,6 +75,15 @@ spec:
minItems: 1
type: array
x-kubernetes-list-type: set
roleAssignmentGroupNames:
description: |-
RoleAssignmentGroupNames lists the names of LogScale groups that this role is assigned to.
It is optional to specify the list of role assignments. If not specified, the role will not be assigned to any groups.
items:
minLength: 1
type: string
type: array
x-kubernetes-list-type: set
required:
- name
- permissions
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -75,6 +75,29 @@ spec:
minItems: 1
type: array
x-kubernetes-list-type: set
roleAssignments:
description: |-
RoleAssignments lists the names of LogScale groups that this role is assigned to and for which views/repositories.
It is optional to specify the list of role assignments. If not specified, the role will not be assigned to any groups.
items:
description: HumioViewPermissionRoleAssignment specifies a view
or repo and a group to assign it to.
properties:
groupName:
description: GroupName specifies the name of the group to assign
the view permission role to.
minLength: 1
type: string
repoOrViewName:
description: RepoOrViewName specifies the name of the view or
repo to assign the view permission role.
minLength: 1
type: string
required:
- groupName
- repoOrViewName
type: object
type: array
required:
- name
- permissions
Expand Down
4 changes: 2 additions & 2 deletions config/crd/bases/core.humio.com_humiogroups.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -58,7 +58,7 @@ spec:
externalMappingName:
description: ExternalMappingName is the mapping name from the external
provider that will assign the user to this HumioGroup
minLength: 2
minLength: 1
type: string
managedClusterName:
description: |-
Expand All @@ -68,7 +68,7 @@ spec:
type: string
name:
description: Name is the display name of the HumioGroup
minLength: 1
minLength: 2
type: string
x-kubernetes-validations:
- message: Value is immutable
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -75,6 +75,15 @@ spec:
minItems: 1
type: array
x-kubernetes-list-type: set
roleAssignmentGroupNames:
description: |-
RoleAssignmentGroupNames lists the names of LogScale groups that this role is assigned to.
It is optional to specify the list of role assignments. If not specified, the role will not be assigned to any groups.
items:
minLength: 1
type: string
type: array
x-kubernetes-list-type: set
required:
- name
- permissions
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -75,6 +75,15 @@ spec:
minItems: 1
type: array
x-kubernetes-list-type: set
roleAssignmentGroupNames:
description: |-
RoleAssignmentGroupNames lists the names of LogScale groups that this role is assigned to.
It is optional to specify the list of role assignments. If not specified, the role will not be assigned to any groups.
items:
minLength: 1
type: string
type: array
x-kubernetes-list-type: set
required:
- name
- permissions
Expand Down
23 changes: 23 additions & 0 deletions config/crd/bases/core.humio.com_humioviewpermissionroles.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -75,6 +75,29 @@ spec:
minItems: 1
type: array
x-kubernetes-list-type: set
roleAssignments:
description: |-
RoleAssignments lists the names of LogScale groups that this role is assigned to and for which views/repositories.
It is optional to specify the list of role assignments. If not specified, the role will not be assigned to any groups.
items:
description: HumioViewPermissionRoleAssignment specifies a view
or repo and a group to assign it to.
properties:
groupName:
description: GroupName specifies the name of the group to assign
the view permission role to.
minLength: 1
type: string
repoOrViewName:
description: RepoOrViewName specifies the name of the view or
repo to assign the view permission role.
minLength: 1
type: string
required:
- groupName
- repoOrViewName
type: object
type: array
required:
- name
- permissions
Expand Down
7 changes: 2 additions & 5 deletions config/samples/core_v1alpha1_humiogroup.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -4,8 +4,5 @@ metadata:
name: example-humiogroup-managed
spec:
managedClusterName: example-humiocluster
displayName: "example-group"
lookupName: "example-group-lookup-name"
assignments:
- roleName: "example-role"
viewName: "example-view"
name: "example-group"
externalMappingName: "example-group-lookup-name"
Original file line number Diff line number Diff line change
Expand Up @@ -9,4 +9,6 @@ spec:
managedClusterName: example-humiocluster
name: example-organization-permission-role
permissions:
- CreateRepository
- CreateRepository
roleAssignmentGroupNames:
- example-group
7 changes: 6 additions & 1 deletion config/samples/core_v1alpha1_humiosystempermissionrole.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -6,4 +6,9 @@ metadata:
app.kubernetes.io/managed-by: kustomize
name: humiosystempermissionrole-sample
spec:
# TODO(user): Add fields here
managedClusterName: example-humiocluster
name: example-system-permission-role
permissions:
- ReadHealthCheck
roleAssignmentGroupNames:
- example-group
5 changes: 4 additions & 1 deletion config/samples/core_v1alpha1_humioviewpermissionrole.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -9,4 +9,7 @@ spec:
managedClusterName: example-humiocluster
name: example-view-permission-role
permissions:
- ReadAccess
- ReadAccess
roleAssignments:
- repoOrViewName: humio
groupName: example-group
Loading
Loading