Skip to content

Commit e9c3b11

Browse files
authored
refactor(grafanaplane): split modules into directories and add new ProviderConfig helpers (#105)
* refactor(grafanaplane): split oss.libsonnet into oss/ directory Split the monolithic oss.libsonnet into separate files per top-level group, matching the established pattern from oncall/ and alerting/: - oss/main.libsonnet (entry point) - oss/team.libsonnet - oss/folder.libsonnet - oss/folderpermission.libsonnet - oss/dashboard.libsonnet - oss/datasource.libsonnet * refactor(grafanaplane): split enterprise.libsonnet into enterprise/ directory Split the monolithic enterprise.libsonnet into separate files per top-level group, matching the established pattern: - enterprise/main.libsonnet (entry point) - enterprise/role.libsonnet - enterprise/roleassignment.libsonnet The doc headings now use fully qualified package names (enterprise.role, enterprise.roleAssignment) consistent with other split modules. * refactor(grafanaplane): split cloud.libsonnet into cloud/ directory Split the monolithic cloud.libsonnet into separate files per top-level group, matching the established pattern: - cloud/main.libsonnet (entry point) - cloud/stack.libsonnet - cloud/stackserviceaccount.libsonnet - cloud/stackserviceaccounttoken.libsonnet - cloud/accesspolicy.libsonnet - cloud/accesspolicytoken.libsonnet Cross-references that previously used 'local root = self' now use 'local main = import ./main.libsonnet' to access sibling groups. * refactor(grafanaplane): split sm.libsonnet into sm/ directory Split the monolithic sm.libsonnet into separate files per top-level group, matching the established pattern: - sm/main.libsonnet (entry point) - sm/check.libsonnet (with nested settings.http and settings.grpc) * feat(grafanaplane): add namespaced and cluster ProviderConfig helpers Split global.libsonnet into global/ directory (matching the pattern used by cloud/, oss/, etc.) and add ClusterProviderConfig and namespaced ProviderConfig helpers using the crossplane-provider-grafana-libsonnet vendored library.
1 parent 2f65611 commit e9c3b11

51 files changed

Lines changed: 1662 additions & 1415 deletions

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

docs/README.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -24,10 +24,10 @@ local grafanaplane = import 'github.com/grafana/grafana-crossplane-libsonnet/gra
2424
## Subpackages
2525

2626
* [alerting](alerting/index.md)
27-
* [cloud](cloud.md)
27+
* [cloud](cloud/index.md)
2828
* [configurations](configurations.md)
2929
* [enterprise](enterprise/index.md)
30-
* [global](global.md)
30+
* [global](global/index.md)
3131
* [oncall](oncall/index.md)
3232
* [oss](oss/index.md)
3333
* [raw](raw/index.md)

docs/cloud.md

Lines changed: 0 additions & 199 deletions
This file was deleted.

docs/cloud/accessPolicy.md

Lines changed: 89 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,89 @@
1+
# cloud.accessPolicy
2+
3+
4+
5+
## Index
6+
7+
* [`fn addToken(secretName, secretNamespace)`](#fn-addtoken)
8+
* [`fn forOrg(name, namespace, scopes)`](#fn-fororg)
9+
* [`fn forStackResource(stackResource, namespace)`](#fn-forstackresource)
10+
* [`fn new(name, namespace, scopes)`](#fn-new)
11+
* [`fn withStack(id, region)`](#fn-withstack)
12+
13+
## Fields
14+
15+
### fn addToken
16+
17+
```jsonnet
18+
addToken(secretName, secretNamespace)
19+
```
20+
21+
PARAMETERS:
22+
23+
* **secretName** (`string`)
24+
* **secretNamespace** (`string`)
25+
26+
`addToken` creates a new Access Policy Token under this Access Policy, the token will be available in the provider secret.
27+
28+
### fn forOrg
29+
30+
```jsonnet
31+
forOrg(name, namespace, scopes)
32+
```
33+
34+
PARAMETERS:
35+
36+
* **name** (`string`)
37+
* **namespace** (`string`)
38+
* **scopes** (`array`)
39+
40+
`forOrg` configures the `realm` to an org `slug`.
41+
42+
### fn forStackResource
43+
44+
```jsonnet
45+
forStackResource(stackResource, namespace)
46+
```
47+
48+
PARAMETERS:
49+
50+
* **stackResource** (`string`)
51+
* **namespace** (`string`)
52+
53+
`forStackResource` configures the `realm` for a `stackResource`.
54+
55+
The `stackResource` is in the `stack` key returned by `cloud.stack.new()`.
56+
57+
### fn new
58+
59+
```jsonnet
60+
new(name, namespace, scopes)
61+
```
62+
63+
PARAMETERS:
64+
65+
* **name** (`string`)
66+
* **namespace** (`string`)
67+
* **scopes** (`array`)
68+
69+
`new` creates a new Access Policy.
70+
71+
For `scopes`, see https://grafana.com/docs/grafana-cloud/account-management/authentication-and-permissions/access-policies/#scopes for possible values.
72+
73+
A valid Access Policy also needs a `realm`, use one of the following functions:
74+
- `withStack`: reference a stack by its identifier (id).
75+
- `forStackResource`: reference a stack by a Crossplane resource.
76+
- `forOrg`: set realm to org level
77+
78+
### fn withStack
79+
80+
```jsonnet
81+
withStack(id, region)
82+
```
83+
84+
PARAMETERS:
85+
86+
* **id** (`string`)
87+
* **region** (`string`)
88+
89+
`withStack` configures the `realm` to a stack `id`.

docs/cloud/accessPolicyToken.md

Lines changed: 56 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,56 @@
1+
# cloud.accessPolicyToken
2+
3+
4+
5+
## Index
6+
7+
* [`fn forAccessPolicyResource(accessPolicyResource)`](#fn-foraccesspolicyresource)
8+
* [`fn new(secretName, secretNamespace)`](#fn-new)
9+
* [`fn withAccessPolicyId(id)`](#fn-withaccesspolicyid)
10+
11+
## Fields
12+
13+
### fn forAccessPolicyResource
14+
15+
```jsonnet
16+
forAccessPolicyResource(accessPolicyResource)
17+
```
18+
19+
PARAMETERS:
20+
21+
* **accessPolicyResource** (`object`)
22+
23+
`forAccessPolicyResource` configures the Access Policy` for a `accessPolicyResource`.
24+
25+
The `accessPolicyResource` is in the `accessPolicy` key returned by `cloud.accessPolicy.new()`.
26+
27+
### fn new
28+
29+
```jsonnet
30+
new(secretName, secretNamespace)
31+
```
32+
33+
PARAMETERS:
34+
35+
* **secretName** (`string`)
36+
* **secretNamespace** (`string`)
37+
38+
`new` creates a new Access Policy Token.
39+
40+
Tip: use `accessPolicy.addToken()` to automatically link the token to the right Access Policy.
41+
42+
A valid Access Policy Token also needs an Access Policy, use one of the following functions:
43+
- `withAccessPolicyId`: reference a policy by its identifier (id)
44+
- `forAccessPolicyResource`: reference a policy by a Crossplane resource.
45+
46+
### fn withAccessPolicyId
47+
48+
```jsonnet
49+
withAccessPolicyId(id)
50+
```
51+
52+
PARAMETERS:
53+
54+
* **id** (`string`)
55+
56+
`withAccessPolicyId` configures the Access Policy to a policy `id`.

docs/cloud/index.md

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
# cloud
2+
3+
4+
5+
## Subpackages
6+
7+
* [accessPolicy](accessPolicy.md)
8+
* [accessPolicyToken](accessPolicyToken.md)
9+
* [stack](stack.md)
10+
* [stackServiceAccount](stackServiceAccount.md)
11+
* [stackServiceAccountToken](stackServiceAccountToken.md)

0 commit comments

Comments
 (0)