`iam`: add description field to roles (#107888)

* iam: add description field to roles

* Openapi gen

* Revert launch change
pull/107772/head
Gabriel MABILLE 2 weeks ago committed by GitHub
parent 5d0f519c0d
commit 85a6a7b9c1
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
  1. 1
      apps/iam/kinds/v0alpha1/rolespec.cue
  2. 7
      apps/iam/pkg/apis/iam/v0alpha1/corerole_spec_gen.go
  3. 7
      apps/iam/pkg/apis/iam/v0alpha1/globalrole_spec_gen.go
  4. 7
      apps/iam/pkg/apis/iam/v0alpha1/role_spec_gen.go
  5. 27
      apps/iam/pkg/apis/iam/v0alpha1/zz_openapi_gen.go
  6. 15
      pkg/tests/apis/openapi_snapshots/iam.grafana.app-v0alpha1.json

@ -10,6 +10,7 @@ RoleSpec: {
// Display name of the role
title: string
description: string
version: int
group: string

@ -18,9 +18,10 @@ func NewCoreRolespecPermission() *CoreRolespecPermission {
// +k8s:openapi-gen=true
type CoreRoleSpec struct {
// Display name of the role
Title string `json:"title"`
Version int64 `json:"version"`
Group string `json:"group"`
Title string `json:"title"`
Description string `json:"description"`
Version int64 `json:"version"`
Group string `json:"group"`
// TODO:
// delegatable?: bool
// created?

@ -18,9 +18,10 @@ func NewGlobalRolespecPermission() *GlobalRolespecPermission {
// +k8s:openapi-gen=true
type GlobalRoleSpec struct {
// Display name of the role
Title string `json:"title"`
Version int64 `json:"version"`
Group string `json:"group"`
Title string `json:"title"`
Description string `json:"description"`
Version int64 `json:"version"`
Group string `json:"group"`
// TODO:
// delegatable?: bool
// created?

@ -18,9 +18,10 @@ func NewRolespecPermission() *RolespecPermission {
// +k8s:openapi-gen=true
type RoleSpec struct {
// Display name of the role
Title string `json:"title"`
Version int64 `json:"version"`
Group string `json:"group"`
Title string `json:"title"`
Description string `json:"description"`
Version int64 `json:"version"`
Group string `json:"group"`
// TODO:
// delegatable?: bool
// created?

@ -186,6 +186,13 @@ func schema_pkg_apis_iam_v0alpha1_CoreRoleSpec(ref common.ReferenceCallback) com
Format: "",
},
},
"description": {
SchemaProps: spec.SchemaProps{
Default: "",
Type: []string{"string"},
Format: "",
},
},
"version": {
SchemaProps: spec.SchemaProps{
Default: 0,
@ -215,7 +222,7 @@ func schema_pkg_apis_iam_v0alpha1_CoreRoleSpec(ref common.ReferenceCallback) com
},
},
},
Required: []string{"title", "version", "group", "permissions"},
Required: []string{"title", "description", "version", "group", "permissions"},
},
},
Dependencies: []string{
@ -740,6 +747,13 @@ func schema_pkg_apis_iam_v0alpha1_GlobalRoleSpec(ref common.ReferenceCallback) c
Format: "",
},
},
"description": {
SchemaProps: spec.SchemaProps{
Default: "",
Type: []string{"string"},
Format: "",
},
},
"version": {
SchemaProps: spec.SchemaProps{
Default: 0,
@ -769,7 +783,7 @@ func schema_pkg_apis_iam_v0alpha1_GlobalRoleSpec(ref common.ReferenceCallback) c
},
},
},
Required: []string{"title", "version", "group", "permissions"},
Required: []string{"title", "description", "version", "group", "permissions"},
},
},
Dependencies: []string{
@ -1600,6 +1614,13 @@ func schema_pkg_apis_iam_v0alpha1_RoleSpec(ref common.ReferenceCallback) common.
Format: "",
},
},
"description": {
SchemaProps: spec.SchemaProps{
Default: "",
Type: []string{"string"},
Format: "",
},
},
"version": {
SchemaProps: spec.SchemaProps{
Default: 0,
@ -1629,7 +1650,7 @@ func schema_pkg_apis_iam_v0alpha1_RoleSpec(ref common.ReferenceCallback) common.
},
},
},
Required: []string{"title", "version", "group", "permissions"},
Required: []string{"title", "description", "version", "group", "permissions"},
},
},
Dependencies: []string{

@ -2923,11 +2923,16 @@
"type": "object",
"required": [
"title",
"description",
"version",
"group",
"permissions"
],
"properties": {
"description": {
"type": "string",
"default": ""
},
"group": {
"type": "string",
"default": ""
@ -3236,11 +3241,16 @@
"type": "object",
"required": [
"title",
"description",
"version",
"group",
"permissions"
],
"properties": {
"description": {
"type": "string",
"default": ""
},
"group": {
"type": "string",
"default": ""
@ -3723,11 +3733,16 @@
"type": "object",
"required": [
"title",
"description",
"version",
"group",
"permissions"
],
"properties": {
"description": {
"type": "string",
"default": ""
},
"group": {
"type": "string",
"default": ""

Loading…
Cancel
Save