-
Notifications
You must be signed in to change notification settings - Fork 33
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
676f876
commit e917e93
Showing
21 changed files
with
958 additions
and
1 deletion.
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,95 @@ | ||
/* | ||
Copyright 2020 Humio https://humio.com | ||
Licensed under the Apache License, Version 2.0 (the "License"); | ||
you may not use this file except in compliance with the License. | ||
You may obtain a copy of the License at | ||
http://www.apache.org/licenses/LICENSE-2.0 | ||
Unless required by applicable law or agreed to in writing, software | ||
distributed under the License is distributed on an "AS IS" BASIS, | ||
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. | ||
See the License for the specific language governing permissions and | ||
limitations under the License. | ||
*/ | ||
|
||
package v1alpha1 | ||
|
||
import ( | ||
metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" | ||
) | ||
|
||
const ( | ||
// HumioUserStateUnknown is the Unknown state of the user | ||
HumioUserStateUnknown = "Unknown" | ||
// HumioUserStateExists is the Exists state of the user | ||
HumioUserStateExists = "Exists" | ||
// HumioUserStateNotFound is the NotFound state of the user | ||
HumioUserStateNotFound = "NotFound" | ||
// HumioUserStateConfigError is the state of the user when user-provided specification results in configuration error, such as non-existent humio cluster | ||
HumioUserStateConfigError = "ConfigError" | ||
) | ||
|
||
// HumioUserSpec defines the desired state of HumioUser | ||
type HumioUserSpec struct { | ||
// ManagedClusterName refers to an object of type HumioCluster that is managed by the operator where the Humio | ||
// resources should be created. | ||
// This conflicts with ExternalClusterName. | ||
ManagedClusterName string `json:"managedClusterName,omitempty"` | ||
// ExternalClusterName refers to an object of type HumioExternalCluster where the Humio resources should be created. | ||
// This conflicts with ManagedClusterName. | ||
ExternalClusterName string `json:"externalClusterName,omitempty"` | ||
// Username of the user in humio | ||
Username string `json:"username,omitempty"` | ||
// User ID of the user in humio | ||
ID string `json:"id,omitempty"` | ||
// FullName is the full name of the user | ||
FullName string `json:"fullName,omitempty"` | ||
// Email is the email of the user | ||
Email string `json:"email,omitempty"` | ||
// Company is the compnay of the user | ||
Company string `json:"company,omitempty"` | ||
// CountryCode is the compnay of the user | ||
CountryCode string `json:"countryCode,omitempty"` | ||
// Picture is the url to the user's profile picture | ||
Picture string `json:"picture,omitempty"` | ||
// IsRoot is the root setting for the user | ||
IsRoot bool `json:"isRoot,omitempty"` | ||
// CreatedAt is date when the user was created | ||
CreatedAt string `json:"createdAt,omitempty"` | ||
} | ||
|
||
// HumioUserStatus defines the observed state of HumioUser | ||
type HumioUserStatus struct { | ||
// State reflects the current state of the HumioUser | ||
State string `json:"state,omitempty"` | ||
} | ||
|
||
//+kubebuilder:object:root=true | ||
//+kubebuilder:subresource:status | ||
//+kubebuilder:resource:path=humiousers,scope=Namespaced | ||
//+kubebuilder:printcolumn:name="State",type="string",JSONPath=".status.state",description="The state of the user" | ||
//+operator-sdk:gen-csv:customresourcedefinitions.displayName="Humio User" | ||
|
||
// HumioUser is the Schema for the humiousers API | ||
type HumioUser struct { | ||
metav1.TypeMeta `json:",inline"` | ||
metav1.ObjectMeta `json:"metadata,omitempty"` | ||
|
||
Spec HumioUserSpec `json:"spec,omitempty"` | ||
Status HumioUserStatus `json:"status,omitempty"` | ||
} | ||
|
||
//+kubebuilder:object:root=true | ||
|
||
// HumioUserList contains a list of HumioUser | ||
type HumioUserList struct { | ||
metav1.TypeMeta `json:",inline"` | ||
metav1.ListMeta `json:"metadata,omitempty"` | ||
Items []HumioUser `json:"items"` | ||
} | ||
|
||
func init() { | ||
SchemeBuilder.Register(&HumioUser{}, &HumioUserList{}) | ||
} |
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
105 changes: 105 additions & 0 deletions
105
charts/humio-operator/crds/core.humio.com_humiousers.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,105 @@ | ||
|
||
--- | ||
apiVersion: apiextensions.k8s.io/v1 | ||
kind: CustomResourceDefinition | ||
metadata: | ||
annotations: | ||
controller-gen.kubebuilder.io/version: v0.6.2 | ||
creationTimestamp: null | ||
name: humiousers.core.humio.com | ||
labels: | ||
app: 'humio-operator' | ||
app.kubernetes.io/name: 'humio-operator' | ||
app.kubernetes.io/instance: 'humio-operator' | ||
app.kubernetes.io/managed-by: 'Helm' | ||
helm.sh/chart: 'humio-operator-0.19.0' | ||
spec: | ||
group: core.humio.com | ||
names: | ||
kind: HumioUser | ||
listKind: HumioUserList | ||
plural: humiousers | ||
singular: humiouser | ||
scope: Namespaced | ||
versions: | ||
- additionalPrinterColumns: | ||
- description: The state of the user | ||
jsonPath: .status.state | ||
name: State | ||
type: string | ||
name: v1alpha1 | ||
schema: | ||
openAPIV3Schema: | ||
description: HumioUser is the Schema for the humiousers 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: HumioUserSpec defines the desired state of HumioUser | ||
properties: | ||
company: | ||
description: Company is the compnay of the user | ||
type: string | ||
countryCode: | ||
description: CountryCode is the compnay of the user | ||
type: string | ||
createdAt: | ||
description: CreatedAt is date when the user was created | ||
type: string | ||
email: | ||
description: Email is the email of the user | ||
type: string | ||
externalClusterName: | ||
description: ExternalClusterName refers to an object of type HumioExternalCluster | ||
where the Humio resources should be created. This conflicts with | ||
ManagedClusterName. | ||
type: string | ||
fullName: | ||
description: FullName is the full name of the user | ||
type: string | ||
id: | ||
description: User ID of the user in humio | ||
type: string | ||
isRoot: | ||
description: IsRoot is the root setting for the user | ||
type: boolean | ||
managedClusterName: | ||
description: ManagedClusterName refers to an object of type HumioCluster | ||
that is managed by the operator where the Humio resources should | ||
be created. This conflicts with ExternalClusterName. | ||
type: string | ||
picture: | ||
description: Picture is the url to the user's profile picture | ||
type: string | ||
username: | ||
description: Username of the user in humio | ||
type: string | ||
type: object | ||
status: | ||
description: HumioUserStatus defines the observed state of HumioUser | ||
properties: | ||
state: | ||
description: State reflects the current state of the HumioUser | ||
type: string | ||
type: object | ||
type: object | ||
served: true | ||
storage: true | ||
subresources: | ||
status: {} | ||
status: | ||
acceptedNames: | ||
kind: "" | ||
plural: "" | ||
conditions: [] | ||
storedVersions: [] |
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.