Skip to content

Commit ee84d7d

Browse files
authored
Refactor to folderRef and Namespace (#2)
* remove orgid from kinds and push that information in to the providerconfig secrets * remove prefix
1 parent 569ea54 commit ee84d7d

File tree

4 files changed

+12
-12
lines changed

4 files changed

+12
-12
lines changed

Makefile

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -37,7 +37,7 @@ docker-snyk: ## Run local snyk scan, SNYK_TOKEN environment variable must be set
3737

3838
.PHONY: docker
3939
docker:
40-
@docker build --build-arg GIT_COMMIT=${GIT_COMMIT} -t $(CMD_NAME):latest .
40+
@docker build --build-arg TAG=${PACKAGE_NAME} -t $(PACKAGE_NAME):latest .
4141

4242
.PHONY: docker-run
4343
docker-run: docker ## Build and run the application in a local docker container

config/composition.yaml

Lines changed: 6 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -26,13 +26,14 @@ spec:
2626
policy:
2727
fromFieldPath: Required
2828
- type: FromCompositeFieldPath
29-
fromFieldPath: spec.orgID
30-
toFieldPath: spec.forProvider.orgId
29+
fromFieldPath: spec.folderRef
30+
toFieldPath: spec.forProvider.folderRef.name
31+
- type: FromCompositeFieldPath
32+
fromFieldPath: spec.namespace
33+
toFieldPath: spec.providerConfigRef.name
3134
policy:
3235
fromFieldPath: Required
33-
- type: FromCompositeFieldPath
34-
fromFieldPath: spec.folderID
35-
toFieldPath: spec.forProvider.folder
36+
...
3637
---
3738
apiVersion: apiextensions.crossplane.io/v1
3839
kind: Composition

config/grafana.kanopy-platform.github.io_provisioneddashboards.yaml

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -36,14 +36,13 @@ spec:
3636
properties:
3737
config:
3838
type: string
39-
folderID:
39+
folderRef:
4040
type: string
41-
orgID:
41+
namespace:
4242
type: string
4343
required:
4444
- config
45-
- orgID
45+
- namespace
4646
type: object
4747
type: object
4848
served: true
49-
...

pkg/apis/dashboard/v1beta1/types.go

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -25,10 +25,10 @@ type ProvisionedDashboard struct {
2525
}
2626

2727
type ProvisionedDashboardSpec struct {
28-
FolderID string `json:"folderID,omitempty"`
28+
FolderRef string `json:"folderRef,omitempty"`
2929

3030
// +kubebuilder:validation:Required
3131
Config string `json:"config,omitempty"`
3232
// +kubebuilder:validation:Required
33-
OrgID string `json:"orgID,omitempty"`
33+
Namespace string `json:"namespace,omitempty"`
3434
}

0 commit comments

Comments
 (0)