Skip to content

Commit

Permalink
Camelcase EventHub (#176)
Browse files Browse the repository at this point in the history
* Removed ports from docker-compose.

* Updated CRD - camelcase over lowercase.

* Updated example manifests.

* Role thing.

* Camelcase new changes to EventHub types.

* Camelcase example.

* Removed old file.
  • Loading branch information
JasonTheDeveloper authored and Azadehkhojandi committed Sep 2, 2019
1 parent 75d088e commit db46a0d
Show file tree
Hide file tree
Showing 13 changed files with 79 additions and 110 deletions.
2 changes: 0 additions & 2 deletions .devcontainer/docker-compose.yml
Original file line number Diff line number Diff line change
Expand Up @@ -5,8 +5,6 @@ services:
context: ../
dockerfile: .devcontainer/Dockerfile
network_mode: "host"
ports:
- 5002:5001
volumes:
# Update this to wherever you want VS Code to mount the folder of your project
- ..:/workspace
Expand Down
4 changes: 2 additions & 2 deletions api/v1/consumergroup_types.go
Original file line number Diff line number Diff line change
Expand Up @@ -27,9 +27,9 @@ import (
type ConsumerGroupSpec struct {
// INSERT ADDITIONAL SPEC FIELDS - desired state of cluster
// Important: Run "make" to regenerate code after modifying this file
ResourceGroupName string `json:"resourcegroup,omitempty"`
ResourceGroupName string `json:"resourceGroup,omitempty"`
NamespaceName string `json:"namespace,omitempty"`
EventhubName string `json:"eventhub,omitempty"`
EventhubName string `json:"eventHub,omitempty"`
}

// ConsumerGroupStatus defines the observed state of ConsumerGroup
Expand Down
28 changes: 14 additions & 14 deletions api/v1/eventhub_types.go
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ type EventhubNamespaceResource struct {
Location string `json:"location"`
Sku EventhubNamespaceSku `json:"sku,omitempty"`
Properties EventhubNamespaceProperties `json:"properties,omitempty"`
ResourceGroupName string `json:"resourcegroup,omitempty"`
ResourceGroupName string `json:"resourceGroup,omitempty"`
}

// EventhubSpec defines the desired state of Eventhub
Expand All @@ -39,10 +39,10 @@ type EventhubSpec struct {
Location string `json:"location"`
Namespace string `json:"namespace,omitempty"`
Properties EventhubProperties `json:"properties,omitempty"`
ResourceGroup string `json:"resourcegroup,omitempty"`
AuthorizationRule EventhubAuthorizationRule `json:"authorizationrule,omitempty"`
ResourceGroup string `json:"resourceGroup,omitempty"`
AuthorizationRule EventhubAuthorizationRule `json:"authorizationRule,omitempty"`
// SecretName - Used to specify the name of the secret. Defaults to Event Hub name if omitted.
SecretName string `json:"secretname,omitempty"`
SecretName string `json:"secretName,omitempty"`
}

// EventhubStatus defines the observed state of Eventhub
Expand All @@ -64,25 +64,25 @@ type EventhubAuthorizationRule struct {
type StorageAccount struct {
// ResourceGroup - Name of the storage account resource group
// +kubebuilder:validation:Pattern=^[-\w\._\(\)]+$
ResourceGroup string `json:"resourcegroup,omitempty"`
ResourceGroup string `json:"resourceGroup,omitempty"`
// AccountName - Name of the storage account
// +kubebuilder:validation:MaxLength=24
// +kubebuilder:validation:MinLength=3
// +kubebuilder:validation:Pattern=^[a-z0-9]+$
AccountName string `json:"accountname,omitempty"`
AccountName string `json:"accountName,omitempty"`
}

//Destination for capture (blob storage etc)
type Destination struct {
// ArchiveNameFormat - Blob naming convention for archive, e.g. {Namespace}/{EventHub}/{PartitionId}/{Year}/{Month}/{Day}/{Hour}/{Minute}/{Second}. Here all the parameters (Namespace,EventHub .. etc) are mandatory irrespective of order
ArchiveNameFormat string `json:"archivenameformat,omitempty"`
ArchiveNameFormat string `json:"archiveNameFormat,omitempty"`
// BlobContainer - Blob container Name
BlobContainer string `json:"blobcontainer,omitempty"`
BlobContainer string `json:"blobContainer,omitempty"`
// Name - Name for capture destination
// +kubebuilder:validation:Enum=EventHubArchive.AzureBlockBlob;EventHubArchive.AzureDataLake
Name string `json:"name,omitempty"`
// StorageAccount - Details of the storage account
StorageAccount StorageAccount `json:"storageaccount,omitempty"`
StorageAccount StorageAccount `json:"storageAccount,omitempty"`
}

//CaptureDescription defines the properties required for eventhub capture
Expand All @@ -94,25 +94,25 @@ type CaptureDescription struct {
// SizeLimitInBytes - The size window defines the amount of data built up in your Event Hub before an capture operation
// +kubebuilder:validation:Maximum=524288000
// +kubebuilder:validation:Minimum=10485760
SizeLimitInBytes int32 `json:"sizelimitinbytes,omitempty"`
SizeLimitInBytes int32 `json:"sizeLimitInBytes,omitempty"`
// IntervalInSeconds - The time window allows you to set the frequency with which the capture to Azure Blobs will happen
// +kubebuilder:validation:Maximum=900
// +kubebuilder:validation:Minimum=60
IntervalInSeconds int32 `json:"intervalinseconds,omitempty"`
IntervalInSeconds int32 `json:"intervalInSeconds,omitempty"`
}

//EventhubProperties defines the namespace properties
type EventhubProperties struct {
// +kubebuilder:validation:Maximum=7
// +kubebuilder:validation:Minimum=1
// MessageRetentionInDays - Number of days to retain the events for this Event Hub, value should be 1 to 7 days
MessageRetentionInDays int32 `json:"messageretentionindays,omitempty"`
MessageRetentionInDays int32 `json:"messageRetentionInDays,omitempty"`
// +kubebuilder:validation:Maximum=32
// +kubebuilder:validation:Minimum=1
// PartitionCount - Number of partitions created for the Event Hub, allowed values are from 1 to 32 partitions.
PartitionCount int32 `json:"partitioncount,omitempty"`
PartitionCount int32 `json:"partitionCount,omitempty"`
// CaptureDescription - Details specifying EventHub capture to persistent storage
CaptureDescription CaptureDescription `json:"capturedescription,omitempty"`
CaptureDescription CaptureDescription `json:"captureDescription,omitempty"`
}

// +kubebuilder:object:root=true
Expand Down
8 changes: 4 additions & 4 deletions api/v1/eventhubnamespace_types.go
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ type EventhubNamespaceSpec struct {
Location string `json:"location"`
Sku EventhubNamespaceSku `json:"sku,omitempty"`
Properties EventhubNamespaceProperties `json:"properties,omitempty"`
ResourceGroup string `json:"resourcegroup,omitempty"`
ResourceGroup string `json:"resourceGroup,omitempty"`
}

// EventhubNamespaceStatus defines the observed state of EventhubNamespace
Expand Down Expand Up @@ -70,9 +70,9 @@ type EventhubNamespaceSku struct {

//EventhubNamespaceProperties defines the namespace properties
type EventhubNamespaceProperties struct {
IsAutoInflateEnabled bool `json:"isautoinflateenabled,omitempty"`
MaximumThroughputUnits int32 `json:"maximumthroughputunits,omitempty"`
KafkaEnabled bool `json:"kafkaenabled,omitempty"`
IsAutoInflateEnabled bool `json:"isAutoInflateEnabled,omitempty"`
MaximumThroughputUnits int32 `json:"maximumThroughputUnits,omitempty"`
KafkaEnabled bool `json:"kafkaEnabled,omitempty"`
}

func init() {
Expand Down
4 changes: 2 additions & 2 deletions config/crd/bases/azure.microsoft.com_consumergroups.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -399,11 +399,11 @@ spec:
spec:
description: ConsumerGroupSpec defines the desired state of ConsumerGroup
properties:
eventhub:
eventHub:
type: string
namespace:
type: string
resourcegroup:
resourceGroup:
description: 'INSERT ADDITIONAL SPEC FIELDS - desired state of cluster
Important: Run "make" to regenerate code after modifying this file'
type: string
Expand Down
8 changes: 4 additions & 4 deletions config/crd/bases/azure.microsoft.com_eventhubnamespaces.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -406,15 +406,15 @@ spec:
properties:
description: EventhubNamespaceProperties defines the namespace properties
properties:
isautoinflateenabled:
isAutoInflateEnabled:
type: boolean
kafkaenabled:
kafkaEnabled:
type: boolean
maximumthroughputunits:
maximumThroughputUnits:
format: int32
type: integer
type: object
resourcegroup:
resourceGroup:
type: string
sku:
description: EventhubNamespaceSku defines the sku
Expand Down
26 changes: 13 additions & 13 deletions config/crd/bases/azure.microsoft.com_eventhubs.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -399,7 +399,7 @@ spec:
spec:
description: EventhubSpec defines the desired state of Eventhub
properties:
authorizationrule:
authorizationRule:
description: EventhubAuthorizationRule defines the name and rights of
the access policy
properties:
Expand All @@ -421,21 +421,21 @@ spec:
properties:
description: EventhubProperties defines the namespace properties
properties:
capturedescription:
captureDescription:
description: CaptureDescription - Details specifying EventHub capture
to persistent storage
properties:
destination:
description: Destination - Resource id of the storage account
to be used to create the blobs
properties:
archivenameformat:
archiveNameFormat:
description: ArchiveNameFormat - Blob naming convention
for archive, e.g. {Namespace}/{EventHub}/{PartitionId}/{Year}/{Month}/{Day}/{Hour}/{Minute}/{Second}.
Here all the parameters (Namespace,EventHub .. etc) are
mandatory irrespective of order
type: string
blobcontainer:
blobContainer:
description: BlobContainer - Blob container Name
type: string
name:
Expand All @@ -444,16 +444,16 @@ spec:
- EventHubArchive.AzureBlockBlob
- EventHubArchive.AzureDataLake
type: string
storageaccount:
storageAccount:
description: StorageAccount - Details of the storage account
properties:
accountname:
accountName:
description: AccountName - Name of the storage account
maxLength: 24
minLength: 3
pattern: ^[a-z0-9]+$
type: string
resourcegroup:
resourceGroup:
description: ResourceGroup - Name of the storage account
resource group
pattern: ^[-\w\._\(\)]+$
Expand All @@ -463,15 +463,15 @@ spec:
enabled:
description: Enabled - indicates whether capture is enabled
type: boolean
intervalinseconds:
intervalInSeconds:
description: IntervalInSeconds - The time window allows you
to set the frequency with which the capture to Azure Blobs
will happen
format: int32
maximum: 900
minimum: 60
type: integer
sizelimitinbytes:
sizeLimitInBytes:
description: SizeLimitInBytes - The size window defines the
amount of data built up in your Event Hub before an capture
operation
Expand All @@ -482,24 +482,24 @@ spec:
required:
- enabled
type: object
messageretentionindays:
messageRetentionInDays:
description: MessageRetentionInDays - Number of days to retain the
events for this Event Hub, value should be 1 to 7 days
format: int32
maximum: 7
minimum: 1
type: integer
partitioncount:
partitionCount:
description: PartitionCount - Number of partitions created for the
Event Hub, allowed values are from 1 to 32 partitions.
format: int32
maximum: 32
minimum: 1
type: integer
type: object
resourcegroup:
resourceGroup:
type: string
secretname:
secretName:
description: SecretName - Used to specify the name of the secret. Defaults
to Event Hub name if omitted.
type: string
Expand Down
36 changes: 0 additions & 36 deletions config/default/manager_image_patch.yaml-e

This file was deleted.

27 changes: 17 additions & 10 deletions config/rbac/role.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -57,7 +57,7 @@ rules:
- apiGroups:
- ""
resources:
- secrets
- eventhubnamespaces
verbs:
- create
- delete
Expand All @@ -67,12 +67,13 @@ rules:
- update
- watch
- apiGroups:
- ""
- azure.microsoft.com
resources:
- events
- eventhubnamespaces/status
verbs:
- create
- watch
- get
- patch
- update
- apiGroups:
- azure.microsoft.com
resources:
Expand All @@ -93,6 +94,13 @@ rules:
- get
- patch
- update
- apiGroups:
- apps
resources:
- deployments
verbs:
- create
- patch
- apiGroups:
- apps
resources:
Expand Down Expand Up @@ -146,9 +154,13 @@ rules:
resources:
- consumergroups/status
verbs:
- create
- delete
- get
- list
- patch
- update
- watch
- apiGroups:
- service.azure
resources:
Expand Down Expand Up @@ -198,11 +210,6 @@ rules:
- storages
verbs:
- create
- delete
- get
- list
- patch
- update
- watch
- apiGroups:
- service.azure
Expand Down
4 changes: 2 additions & 2 deletions config/samples/azure_v1_consumergroup.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,6 @@ metadata:
name: consumergroup-sample-1
spec:
# Add fields here
resourcegroup: "resourcegroup-sample-1"
resourceGroup: "resourcegroup-sample-1"
namespace: "eventhubnamespace-sample-1"
eventhub: "eventhub-sample-2"
eventHub: "eventhub-sample-2"
10 changes: 5 additions & 5 deletions config/samples/azure_v1_eventhub.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -4,15 +4,15 @@ metadata:
name: eventhub-sample-2307-09
spec:
location: "westus"
resourcegroup: "resourcegroup-sample-1907"
resourceGroup: "resourcegroup-sample-1907"
namespace: "eventhubnamespace-sample-6"
properties:
messageretentionindays: 7
partitioncount: 1
authorizationrule:
messageRetentionInDays: 7
partitionCount: 1
authorizationRule:
name : "RootManageSharedAccessKey"
rights:
- "Listen"
- "Manage"
- "Send"
secretname: "secret-stream-eventhub-sample"
secretName: "secret-stream-eventhub-sample"
Loading

0 comments on commit db46a0d

Please sign in to comment.