-
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.
- Loading branch information
1 parent
daa50c9
commit 85cace3
Showing
11 changed files
with
737 additions
and
57 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,52 @@ | ||
package v1 | ||
|
||
import metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" | ||
|
||
// EDIT THIS FILE! THIS IS SCAFFOLDING FOR YOU TO OWN! | ||
// NOTE: json tags are required. Any new fields you add must have json tags for the fields to be serialized. | ||
|
||
// UserSpec defines the desired state of User | ||
type UserSpec struct { | ||
// Important: Run "make" to regenerate code after modifying this file | ||
|
||
Url string `json:"url"` | ||
Admin *GrafanaAdmin `json:"admin,omitempty"` | ||
Users []User `json:"users,omitempty"` | ||
} | ||
|
||
type User struct { | ||
Name string `json:"name,omitempty"` | ||
Login string `json:"login"` | ||
Email string `json:"email,omitempty"` | ||
} | ||
|
||
// UserStatus defines the observed state of User | ||
type UserStatus struct { | ||
// INSERT ADDITIONAL STATUS FIELD - define observed state of cluster | ||
// Important: Run "make" to regenerate code after modifying this file | ||
} | ||
|
||
//+kubebuilder:object:root=true | ||
//+kubebuilder:subresource:status | ||
|
||
// Users is the Schema for the users API | ||
type Users struct { | ||
metav1.TypeMeta `json:",inline"` | ||
metav1.ObjectMeta `json:"metadata,omitempty"` | ||
|
||
Spec UserSpec `json:"spec,omitempty"` | ||
Status UserStatus `json:"status,omitempty"` | ||
} | ||
|
||
//+kubebuilder:object:root=true | ||
|
||
// UsersList contains a list of User | ||
type UsersList struct { | ||
metav1.TypeMeta `json:",inline"` | ||
metav1.ListMeta `json:"metadata,omitempty"` | ||
Items []Users `json:"items"` | ||
} | ||
|
||
func init() { | ||
SchemeBuilder.Register(&Users{}, &UsersList{}) | ||
} |
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
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
125 changes: 125 additions & 0 deletions
125
config/crd/bases/grafana.abergmeier.github.io_users.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,125 @@ | ||
--- | ||
apiVersion: apiextensions.k8s.io/v1 | ||
kind: CustomResourceDefinition | ||
metadata: | ||
annotations: | ||
controller-gen.kubebuilder.io/version: v0.11.3 | ||
creationTimestamp: null | ||
name: users.grafana.abergmeier.github.io | ||
spec: | ||
group: grafana.abergmeier.github.io | ||
names: | ||
kind: Users | ||
listKind: UsersList | ||
plural: users | ||
singular: users | ||
scope: Namespaced | ||
versions: | ||
- name: v1 | ||
schema: | ||
openAPIV3Schema: | ||
description: Users is the Schema for the users API | ||
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: | ||
description: UserSpec defines the desired state of User | ||
properties: | ||
admin: | ||
properties: | ||
password: | ||
properties: | ||
valueFrom: | ||
description: 'Optional: Specifies a source the value should | ||
come from.' | ||
properties: | ||
secretKeyRef: | ||
description: SecretKeySelector selects a key of a Secret. | ||
properties: | ||
key: | ||
description: The key of the secret to select from. Must | ||
be a valid secret key. | ||
type: string | ||
name: | ||
description: 'Name of the referent. More info: https://kubernetes.io/docs/concepts/overview/working-with-objects/names/#names | ||
TODO: Add other useful fields. apiVersion, kind, | ||
uid?' | ||
type: string | ||
optional: | ||
description: Specify whether the Secret or its key | ||
must be defined | ||
type: boolean | ||
required: | ||
- key | ||
type: object | ||
x-kubernetes-map-type: atomic | ||
type: object | ||
type: object | ||
username: | ||
properties: | ||
valueFrom: | ||
description: 'Optional: Specifies a source the value should | ||
come from.' | ||
properties: | ||
secretKeyRef: | ||
description: SecretKeySelector selects a key of a Secret. | ||
properties: | ||
key: | ||
description: The key of the secret to select from. Must | ||
be a valid secret key. | ||
type: string | ||
name: | ||
description: 'Name of the referent. More info: https://kubernetes.io/docs/concepts/overview/working-with-objects/names/#names | ||
TODO: Add other useful fields. apiVersion, kind, | ||
uid?' | ||
type: string | ||
optional: | ||
description: Specify whether the Secret or its key | ||
must be defined | ||
type: boolean | ||
required: | ||
- key | ||
type: object | ||
x-kubernetes-map-type: atomic | ||
type: object | ||
type: object | ||
required: | ||
- password | ||
- username | ||
type: object | ||
url: | ||
type: string | ||
users: | ||
items: | ||
properties: | ||
email: | ||
type: string | ||
login: | ||
type: string | ||
name: | ||
type: string | ||
required: | ||
- login | ||
type: object | ||
type: array | ||
required: | ||
- url | ||
type: object | ||
status: | ||
description: UserStatus defines the observed state of User | ||
type: object | ||
type: object | ||
served: true | ||
storage: true | ||
subresources: | ||
status: {} |
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
Oops, something went wrong.