-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
* adding scheme support for folder and dashboard v1beta1 apis * refactored folder structure to combine types of the same groupName * DataSource types * define ProvisionedDataSource kinds * make accessMode optional, align composition and endorced composition * Type -> type * I cannot type * Update pkg/apis/grafana/v1beta1/datasource.go Co-authored-by: David Katz <[email protected]> * Update pkg/apis/grafana/v1beta1/datasource.go Co-authored-by: David Katz <[email protected]> * add deepcopy for spec provisioneddatasourcespec types * Update config/composition.yaml Co-authored-by: Yuzhou Liu <[email protected]> * remove terraform fields --------- Co-authored-by: David Katz <[email protected]> Co-authored-by: David Katz <[email protected]> Co-authored-by: Yuzhou Liu <[email protected]>
- Loading branch information
1 parent
5e25a3f
commit c1c9718
Showing
5 changed files
with
309 additions
and
0 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
80 changes: 80 additions & 0 deletions
80
config/grafana.kanopy-platform.github.io_provisioneddatasources.yaml
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,80 @@ | ||
--- | ||
apiVersion: apiextensions.crossplane.io/v1 | ||
kind: CompositeResourceDefinition | ||
metadata: | ||
creationTimestamp: null | ||
name: provisioneddatasources.grafana.kanopy-platform.github.io | ||
spec: | ||
enforcedCompositionRef: | ||
name: provisioneddatasources | ||
group: grafana.kanopy-platform.github.io | ||
names: | ||
kind: ProvisionedDataSource | ||
listKind: ProvisionedDataSourceList | ||
plural: provisioneddatasources | ||
singular: provisioneddatasource | ||
versions: | ||
- name: v1beta1 | ||
referenceable: true | ||
schema: | ||
openAPIV3Schema: | ||
description: infrastructure resources. | ||
properties: | ||
apiVersion: | ||
description: 'APIVersion defines the versioned schema of this representation | ||
of an object. Servers should convert recognized schemas to the latest | ||
internal value, and may reject unrecognized values. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#resources' | ||
type: string | ||
kind: | ||
description: 'Kind is a string value representing the REST resource this | ||
object represents. Servers may infer this from the endpoint the client | ||
submits requests to. Cannot be updated. In CamelCase. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#types-kinds' | ||
type: string | ||
metadata: | ||
type: object | ||
spec: | ||
properties: | ||
accessMode: | ||
enum: | ||
- proxy | ||
- direct | ||
type: string | ||
basicAuth: | ||
type: boolean | ||
basicAuthUsername: | ||
type: string | ||
config: | ||
type: string | ||
databaseName: | ||
type: string | ||
default: | ||
type: boolean | ||
name: | ||
type: string | ||
namespace: | ||
type: string | ||
secureConfigRef: | ||
properties: | ||
key: | ||
type: string | ||
name: | ||
type: string | ||
namespace: | ||
type: string | ||
required: | ||
- key | ||
- name | ||
- namespace | ||
type: object | ||
type: | ||
type: string | ||
url: | ||
type: string | ||
required: | ||
- name | ||
- namespace | ||
- type | ||
- url | ||
type: object | ||
type: object | ||
served: true |
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,70 @@ | ||
// +groupName=grafana.kanopy-platform.github.io | ||
// +versionName=v1beta1 | ||
// +kubebuilder:validation:Optional | ||
package v1beta1 | ||
|
||
import ( | ||
xpapiext "github.com/crossplane/crossplane/apis/apiextensions/v1" | ||
metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" | ||
) | ||
|
||
// infrastructure resources. | ||
// +kubebuilder:object:root=true | ||
// +kubebuilder:printcolumn:name="ESTABLISHED",type="string",JSONPath=".status.conditions[?(@.type=='Established')].status" | ||
// +kubebuilder:printcolumn:name="OFFERED",type="string",JSONPath=".status.conditions[?(@.type=='Offered')].status" | ||
// +kubebuilder:printcolumn:name="AGE",type="date",JSONPath=".metadata.creationTimestamp" | ||
// +kubebuilder:storageversion | ||
// +kubebuilder:resource:scope=Cluster,categories=crossplane,shortName=xrd;xrds | ||
// +kubebuilder:defaultcompositionref:name=provisioneddatasources,enforced=true | ||
type ProvisionedDataSource struct { | ||
metav1.TypeMeta `json:",inline"` | ||
metav1.ObjectMeta `json:"metadata,omitempty"` | ||
|
||
Spec ProvisionedDataSourceSpec `json:"spec,omitempty"` | ||
Status xpapiext.CompositeResourceDefinitionStatus `json:"status,omitempty"` | ||
} | ||
|
||
// +kubebuilder:object:generate=true | ||
type ProvisionedDataSourceSpec struct { | ||
// +kubebuilder:validation:Enum=proxy;direct | ||
AccessMode string `json:"accessMode,omitempty"` | ||
|
||
BasicAuth *bool `json:"basicAuth,omitempty"` | ||
BasicAuthUsername string `json:"basicAuthUsername,omitempty"` | ||
|
||
DatabaseName string `json:"databaseName,omitempty"` | ||
|
||
Default *bool `json:"default,omitempty"` | ||
|
||
// +kubebuilder:validation:Required | ||
Type string `json:"type,omitempty"` | ||
|
||
Config string `json:"config,omitempty"` | ||
SecureConfigRef *SecureConfigRef `json:"secureConfigRef,omitempty"` | ||
|
||
// +kubebuilder:validation:Required | ||
Name string `json:"name,omitempty"` | ||
|
||
// +kubebuilder:validation:Required | ||
Namespace string `json:"namespace,omitempty"` | ||
|
||
// +kubebuilder:validation:Required | ||
URL string `json:"url,omitempty"` | ||
} | ||
|
||
type SecureConfigRef struct { | ||
// +kubebuilder:validation:Required | ||
Key string `json:"key"` | ||
// +kubebuilder:validation:Required | ||
Name string `json:"name"` | ||
// +kubebuilder:validation:Required | ||
Namespace string `json:"namespace"` | ||
} | ||
|
||
// ProvisionedDataSourceList contains a list of ProvisionedDataSources. | ||
// +kubebuilder:object:root=true | ||
type ProvisionedDataSourceList struct { | ||
metav1.TypeMeta `json:",inline"` | ||
metav1.ListMeta `json:"metadata,omitempty"` | ||
Items []ProvisionedDataSource `json:"items"` | ||
} |
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
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.