Skip to content

Commit 32dd981

Browse files
committed
Add useful API version and Kind constants
1 parent 8f39e15 commit 32dd981

9 files changed

Lines changed: 79 additions & 0 deletions

File tree

.cog/resources/dashboardv2beta1/schema.transforms.yaml

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,19 @@
11
# yaml-language-server: $schema=https://raw.githubusercontent.com/grafana/cog/main/schemas/compiler_passes.json
22

33
passes:
4+
# Add a few useful constants
5+
- add_object:
6+
object: dashboardv2beta1.DashboardV2Beta1
7+
as:
8+
kind: scalar
9+
scalar: { scalar_kind: string, value: "dashboard.grafana.app/v2beta1" }
10+
11+
- add_object:
12+
object: dashboardv2beta1.DashboardKind
13+
as:
14+
kind: scalar
15+
scalar: { scalar_kind: string, value: "Dashboard" }
16+
417
######################
518
# Dashboard v2beta1 #
619
######################

.cog/resources/folderv1beta1/config.yaml

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -15,5 +15,8 @@ inputs:
1515
# resource name unless told otherwise.
1616
forced_envelope: Folder
1717

18+
transformations:
19+
- '%__config_dir%/schema.transforms.yaml'
20+
1821
builder_transformations:
1922
- '%__config_dir%/common.builder.transforms.yaml'
Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,15 @@
1+
# yaml-language-server: $schema=https://raw.githubusercontent.com/grafana/cog/main/schemas/compiler_passes.json
2+
3+
passes:
4+
# Add a few useful constants
5+
- add_object:
6+
object: folderv1beta1.FolderV1Beta1
7+
as:
8+
kind: scalar
9+
scalar: { scalar_kind: string, value: "folder.grafana.app/v1beta1" }
10+
11+
- add_object:
12+
object: folderv1beta1.FolderKind
13+
as:
14+
kind: scalar
15+
scalar: { scalar_kind: string, value: "Folder" }

.cog/resources/playlistv0alpha1/config.yaml

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -15,5 +15,8 @@ inputs:
1515
# unless told otherwise. Playlist is a better name here.
1616
forced_envelope: Playlist
1717

18+
transformations:
19+
- '%__config_dir%/schema.transforms.yaml'
20+
1821
builder_transformations:
1922
- '%__config_dir%/common.builder.transforms.yaml'
Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,15 @@
1+
# yaml-language-server: $schema=https://raw.githubusercontent.com/grafana/cog/main/schemas/compiler_passes.json
2+
3+
passes:
4+
# Add a few useful constants
5+
- add_object:
6+
object: playlistv0alpha1.PlaylistV0Alpha1
7+
as:
8+
kind: scalar
9+
scalar: { scalar_kind: string, value: "playlist.grafana.app/playlistv0alpha1" }
10+
11+
- add_object:
12+
object: playlistv0alpha1.PlaylistKind
13+
as:
14+
kind: scalar
15+
scalar: { scalar_kind: string, value: "Playlist" }

.cog/resources/preferencesv1alpha1/config.yaml

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -14,3 +14,6 @@ inputs:
1414
# The schema is defined under the `spec` field, which cog will use as
1515
# resource name unless told otherwise. Preferences is a better name here.
1616
forced_envelope: Preferences
17+
18+
transformations:
19+
- '%__config_dir%/schema.transforms.yaml'
Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,15 @@
1+
# yaml-language-server: $schema=https://raw.githubusercontent.com/grafana/cog/main/schemas/compiler_passes.json
2+
3+
passes:
4+
# Add a few useful constants
5+
- add_object:
6+
object: preferencesv1alpha1.PreferencesV1Alpha1
7+
as:
8+
kind: scalar
9+
scalar: { scalar_kind: string, value: "preferences.grafana.app/v1alpha1" }
10+
11+
- add_object:
12+
object: preferencesv1alpha1.PreferencesKind
13+
as:
14+
kind: scalar
15+
scalar: { scalar_kind: string, value: "Preferences" }

.cog/resources/starsv1alpha1/config.yaml

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -15,5 +15,8 @@ inputs:
1515
# resource name unless told otherwise. Stars is a better name here.
1616
forced_envelope: Stars
1717

18+
transformations:
19+
- '%__config_dir%/schema.transforms.yaml'
20+
1821
builder_transformations:
1922
- '%__config_dir%/common.builder.transforms.yaml'
Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
# yaml-language-server: $schema=https://raw.githubusercontent.com/grafana/cog/main/schemas/compiler_passes.json
2+
3+
passes:
4+
# Add a few useful constants
5+
- add_object:
6+
object: starsv1alpha1.StarsKind
7+
as:
8+
kind: scalar
9+
scalar: { scalar_kind: string, value: "Stars" }

0 commit comments

Comments
 (0)