-
Notifications
You must be signed in to change notification settings - Fork 15
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Allow creation of ProviderConfig from SA token (#164)
Closes #138 Also adds more OSS tests!
- Loading branch information
1 parent
0f9fb07
commit b2e4928
Showing
7 changed files
with
191 additions
and
4 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,82 @@ | ||
# Note: Resources are inverted in this file so that the dashboard is deleted first, | ||
# it will fail to delete if the SA token is deleted first. | ||
# Creation order doesn't matter because Crossplane is eventually consistent | ||
|
||
# Create a new dashboard using the new provider | ||
apiVersion: oss.grafana.crossplane.io/v1alpha1 | ||
kind: Dashboard | ||
metadata: | ||
annotations: | ||
meta.upbound.io/example-id: oss/v1alpha1/serviceaccounttoken | ||
labels: | ||
testing.upbound.io/example-name: test-sa-token | ||
name: test-dashboard-from-sa | ||
spec: | ||
forProvider: | ||
configJson: |- | ||
{ | ||
"title" : "My Dashboard From SA Token", | ||
"uid" : "dashboard-from-sa" | ||
} | ||
providerConfigRef: | ||
name: sa-grafana-provider | ||
|
||
--- | ||
|
||
# Create a new provider from the created secret | ||
apiVersion: grafana.crossplane.io/v1beta1 | ||
kind: ProviderConfig | ||
metadata: | ||
annotations: | ||
meta.upbound.io/example-id: oss/v1alpha1/serviceaccounttoken | ||
labels: | ||
testing.upbound.io/example-name: test-sa-token | ||
name: sa-grafana-provider | ||
spec: | ||
url: http://grafana.grafana.svc.cluster.local # Same as the grafana-provider URL | ||
credentials: | ||
source: Secret | ||
secretRef: | ||
name: test-sa-token | ||
namespace: upbound-system | ||
key: instanceCredentials | ||
|
||
--- | ||
|
||
apiVersion: oss.grafana.crossplane.io/v1alpha1 | ||
kind: ServiceAccountToken | ||
metadata: | ||
annotations: | ||
meta.upbound.io/example-id: oss/v1alpha1/serviceaccounttoken | ||
uptest.upbound.io/disable-import: "true" | ||
labels: | ||
testing.upbound.io/example-name: test-sa-token | ||
name: test-sa-token | ||
spec: | ||
forProvider: | ||
name: test-sa-token | ||
serviceAccountSelector: | ||
matchLabels: | ||
testing.upbound.io/example-name: test-sa-token | ||
writeConnectionSecretToRef: | ||
name: test-sa-token | ||
namespace: upbound-system | ||
providerConfigRef: | ||
name: grafana-provider | ||
|
||
--- | ||
|
||
apiVersion: oss.grafana.crossplane.io/v1alpha1 | ||
kind: ServiceAccount | ||
metadata: | ||
annotations: | ||
meta.upbound.io/example-id: oss/v1alpha1/serviceaccounttoken | ||
labels: | ||
testing.upbound.io/example-name: test-sa-token | ||
name: test-sa | ||
spec: | ||
forProvider: | ||
name: test-sa | ||
role: Admin | ||
providerConfigRef: | ||
name: grafana-provider |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,52 @@ | ||
apiVersion: oss.grafana.crossplane.io/v1alpha1 | ||
kind: Team | ||
metadata: | ||
annotations: | ||
meta.upbound.io/example-id: oss/v1alpha1/team | ||
labels: | ||
testing.upbound.io/example-name: test-team | ||
name: test-team | ||
spec: | ||
forProvider: | ||
email: [email protected] | ||
memberRefs: | ||
- name: viewer | ||
name: Test Team | ||
providerConfigRef: | ||
name: grafana-provider | ||
|
||
--- | ||
|
||
apiVersion: v1 | ||
kind: Secret | ||
metadata: | ||
annotations: | ||
meta.upbound.io/example-id: oss/v1alpha1/team | ||
labels: | ||
testing.upbound.io/example-name: test-team | ||
name: example-secret | ||
namespace: upbound-system | ||
data: | ||
example-key: ZXhhbXBsZS1wYXNzd29yZA== | ||
|
||
--- | ||
|
||
apiVersion: oss.grafana.crossplane.io/v1alpha1 | ||
kind: User | ||
metadata: | ||
annotations: | ||
meta.upbound.io/example-id: oss/v1alpha1/team | ||
labels: | ||
testing.upbound.io/example-name: test-team | ||
name: viewer | ||
spec: | ||
forProvider: | ||
email: [email protected] | ||
login: viewer | ||
name: Viewer | ||
passwordSecretRef: | ||
name: example-secret | ||
namespace: upbound-system | ||
key: example-key | ||
providerConfigRef: | ||
name: grafana-provider |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters