Skip to content
New issue

Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? # to your account

Creating a central Status Struct #411

Merged
merged 3 commits into from
Oct 24, 2019
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
23 changes: 23 additions & 0 deletions api/v1alpha1/aso_types.go
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
/*
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

// AzureServiceOperatorsStatus (ASOStatus) defines the observed state of resource actions
type ASOStatus struct {
// INSERT ADDITIONAL STATUS FIELD - define observed state of cluster
// Important: Run "make" to regenerate code after modifying this file
Provisioning bool `json:"provisioning,omitempty"`
Provisioned bool `json:"provisioned,omitempty"`
State string `json:"state,omitempty"`
Message string `json:"message,omitempty"`
}
11 changes: 1 addition & 10 deletions api/v1alpha1/azuresqlaction_types.go
Original file line number Diff line number Diff line change
Expand Up @@ -31,15 +31,6 @@ type AzureSqlActionSpec struct {
ServerName string `json:"servername"`
}

// AzureSqlActionStatus defines the observed state of AzureSqlAction
type AzureSqlActionStatus struct {
// INSERT ADDITIONAL STATUS FIELD - define observed state of cluster
// Important: Run "make" to regenerate code after modifying this file
Provisioning bool `json:"provisioning,omitempty"`
Provisioned bool `json:"provisioned,omitempty"`
Message string `json:"state,omitempty"`
}

// +kubebuilder:object:root=true
// +kubebuilder:subresource:status

Expand All @@ -49,7 +40,7 @@ type AzureSqlAction struct {
metav1.ObjectMeta `json:"metadata,omitempty"`

Spec AzureSqlActionSpec `json:"spec,omitempty"`
Status AzureSqlActionStatus `json:"status,omitempty"`
Status ASOStatus `json:"status,omitempty"`
}

// +kubebuilder:object:root=true
Expand Down
10 changes: 1 addition & 9 deletions api/v1alpha1/azuresqldatabase_types.go
Original file line number Diff line number Diff line change
Expand Up @@ -32,14 +32,6 @@ type AzureSqlDatabaseSpec struct {
Edition sql.DBEdition `json:"edition"`
}

// AzureSqlDatabaseStatus defines the observed state of AzureSqlDatabase
type AzureSqlDatabaseStatus struct {
// INSERT ADDITIONAL STATUS FIELD - define observed state of cluster
// Important: Run "make" to regenerate code after modifying this file
Provisioning bool `json:"provisioning,omitempty"`
Provisioned bool `json:"provisioned,omitempty"`
}

// +kubebuilder:object:root=true
// +kubebuilder:subresource:status
// AzureSqlDatabase is the Schema for the azuresqldatabases API
Expand All @@ -48,7 +40,7 @@ type AzureSqlDatabase struct {
metav1.ObjectMeta `json:"metadata,omitempty"`

Spec AzureSqlDatabaseSpec `json:"spec,omitempty"`
Status AzureSqlDatabaseStatus `json:"status,omitempty"`
Status ASOStatus `json:"status,omitempty"`
}

// +kubebuilder:object:root=true
Expand Down
11 changes: 1 addition & 10 deletions api/v1alpha1/azuresqlfirewallrule_types.go
Original file line number Diff line number Diff line change
Expand Up @@ -32,15 +32,6 @@ type AzureSqlFirewallRuleSpec struct {
EndIPAddress string `json:"endipaddress,omitempty"`
}

// AzureSqlFirewallRuleStatus defines the observed state of AzureSqlFirewallRule
type AzureSqlFirewallRuleStatus struct {
// INSERT ADDITIONAL STATUS FIELD - define observed state of cluster
// Important: Run "make" to regenerate code after modifying this file
Provisioning bool `json:"provisioning,omitempty"`
Provisioned bool `json:"provisioned,omitempty"`
Message string `json:"message,omitempty"`
}

// +kubebuilder:object:root=true
// +kubebuilder:subresource:status
// AzureSqlFirewallRule is the Schema for the azuresqlfirewallrules API
Expand All @@ -49,7 +40,7 @@ type AzureSqlFirewallRule struct {
metav1.ObjectMeta `json:"metadata,omitempty"`

Spec AzureSqlFirewallRuleSpec `json:"spec,omitempty"`
Status AzureSqlFirewallRuleStatus `json:"status,omitempty"`
Status ASOStatus `json:"status,omitempty"`
}

// +kubebuilder:object:root=true
Expand Down
12 changes: 1 addition & 11 deletions api/v1alpha1/azuresqlserver_types.go
Original file line number Diff line number Diff line change
Expand Up @@ -30,16 +30,6 @@ type AzureSqlServerSpec struct {
ResourceGroup string `json:"resourcegroup,omitempty"`
}

// AzureSqlServerStatus defines the observed state of AzureSqlServer
type AzureSqlServerStatus struct {
// INSERT ADDITIONAL STATUS FIELD - define observed state of cluster
// Important: Run "make" to regenerate code after modifying this file
Provisioning bool `json:"provisioning,omitempty"`
Provisioned bool `json:"provisioned,omitempty"`
State string `json:"state,omitempty"`
Message string `json:"message,omitempty"`
}

// +kubebuilder:object:root=true
// +kubebuilder:subresource:status
// AzureSqlServer is the Schema for the azuresqlservers API
Expand All @@ -48,7 +38,7 @@ type AzureSqlServer struct {
metav1.ObjectMeta `json:"metadata,omitempty"`

Spec AzureSqlServerSpec `json:"spec,omitempty"`
Status AzureSqlServerStatus `json:"status,omitempty"`
Status ASOStatus `json:"status,omitempty"`
}

// +kubebuilder:object:root=true
Expand Down
10 changes: 1 addition & 9 deletions api/v1alpha1/consumergroup_types.go
Original file line number Diff line number Diff line change
Expand Up @@ -33,14 +33,6 @@ type ConsumerGroupSpec struct {
AzureConsumerGroupName string `json:"consumerGroupName,omitempty"`
}

// ConsumerGroupStatus defines the observed state of ConsumerGroup
type ConsumerGroupStatus struct {
// INSERT ADDITIONAL STATUS FIELD - define observed state of cluster
// Important: Run "make" to regenerate code after modifying this file
Provisioning bool `json:"provisioning,omitempty"`
Provisioned bool `json:"provisioned,omitempty"`
}

// +kubebuilder:object:root=true

// ConsumerGroup is the Schema for the consumergroups API
Expand All @@ -49,7 +41,7 @@ type ConsumerGroup struct {
metav1.ObjectMeta `json:"metadata,omitempty"`

Spec ConsumerGroupSpec `json:"spec,omitempty"`
Status ConsumerGroupStatus `json:"status,omitempty"`
Status ASOStatus `json:"status,omitempty"`
}

// +kubebuilder:object:root=true
Expand Down
14 changes: 1 addition & 13 deletions api/v1alpha1/cosmosdb_types.go
Original file line number Diff line number Diff line change
Expand Up @@ -78,18 +78,6 @@ type CosmosDBLocation struct {
}
*/

// CosmosDBStatus defines the observed state of CosmosDB
type CosmosDBStatus struct {
// INSERT ADDITIONAL STATUS FIELD - define observed state of cluster
// Important: Run "make" to regenerate code after modifying this file

// DeploymentName string `json:"deploymentName,omitempty"`
// ProvisioningState string `json:"provisioningState,omitempty"`
// Generation int64 `json:"generation,omitempty"`
Provisioning bool `json:"provisioning,omitempty"`
Provisioned bool `json:"provisioned,omitempty"`
}

type CosmosDBOutput struct {
CosmosDBName string `json:"cosmosDBName,omitempty"`
PrimaryMasterKey string `json:"primaryMasterKey,omitempty"`
Expand All @@ -112,7 +100,7 @@ type CosmosDB struct {
metav1.ObjectMeta `json:"metadata,omitempty"`

Spec CosmosDBSpec `json:"spec,omitempty"`
Status CosmosDBStatus `json:"status,omitempty"`
Status ASOStatus `json:"status,omitempty"`
Output CosmosDBOutput `json:"output,omitempty"`
AdditionalResources CosmosDBAdditionalResources `json:"additionalResources,omitempty"`
}
Expand Down
10 changes: 1 addition & 9 deletions api/v1alpha1/eventhub_types.go
Original file line number Diff line number Diff line change
Expand Up @@ -36,14 +36,6 @@ type EventhubSpec struct {
SecretName string `json:"secretName,omitempty"`
}

// EventhubStatus defines the observed state of Eventhub
type EventhubStatus struct {
// INSERT ADDITIONAL STATUS FIELD - define observed state of cluster
// Important: Run "make" to regenerate code after modifying this file
Provisioning bool `json:"provisioning,omitempty"`
Provisioned bool `json:"provisioned,omitempty"`
}

//EventhubAuthorizationRule defines the name and rights of the access policy
type EventhubAuthorizationRule struct {
// Name - Name of AuthorizationRule for eventhub
Expand Down Expand Up @@ -113,7 +105,7 @@ type Eventhub struct {
metav1.ObjectMeta `json:"metadata,omitempty"`

Spec EventhubSpec `json:"spec,omitempty"`
Status EventhubStatus `json:"status,omitempty"`
Status ASOStatus `json:"status,omitempty"`
}

// +kubebuilder:object:root=true
Expand Down
10 changes: 1 addition & 9 deletions api/v1alpha1/eventhubnamespace_types.go
Original file line number Diff line number Diff line change
Expand Up @@ -33,14 +33,6 @@ type EventhubNamespaceSpec struct {
ResourceGroup string `json:"resourceGroup,omitempty"`
}

// EventhubNamespaceStatus defines the observed state of EventhubNamespace
type EventhubNamespaceStatus struct {
// INSERT ADDITIONAL STATUS FIELD - define observed state of cluster
// Important: Run "make" to regenerate code after modifying this file
Provisioning bool `json:"provisioning,omitempty"`
Provisioned bool `json:"provisioned,omitempty"`
}

// +kubebuilder:object:root=true

// EventhubNamespace is the Schema for the eventhubnamespaces API
Expand All @@ -49,7 +41,7 @@ type EventhubNamespace struct {
metav1.ObjectMeta `json:"metadata,omitempty"`

Spec EventhubNamespaceSpec `json:"spec,omitempty"`
Status EventhubNamespaceStatus `json:"status,omitempty"`
Status ASOStatus `json:"status,omitempty"`
}

// +kubebuilder:object:root=true
Expand Down
14 changes: 1 addition & 13 deletions api/v1alpha1/rediscache_types.go
Original file line number Diff line number Diff line change
Expand Up @@ -76,18 +76,6 @@ const (
P RedisCacheSkuFamily = "P"
)

// RedisCacheStatus defines the observed state of RedisCache
type RedisCacheStatus struct {
// INSERT ADDITIONAL STATUS FIELD - define observed state of cluster
// Important: Run "make" to regenerate code after modifying this file

// DeploymentName string `json:"deploymentName,omitempty"`
// ProvisioningState string `json:"provisioningState,omitempty"`
// Generation int64 `json:"generation,omitempty"`
Provisioning bool `json:"provisioning,omitempty"`
Provisioned bool `json:"provisioned,omitempty"`
}

type RedisCacheOutput struct {
RedisCacheName string `json:"redisCacheName,omitempty"`
PrimaryKey string `json:"primaryKey,omitempty"`
Expand All @@ -108,7 +96,7 @@ type RedisCache struct {
metav1.ObjectMeta `json:"metadata,omitempty"`

Spec RedisCacheSpec `json:"spec,omitempty"`
Status RedisCacheStatus `json:"status,omitempty"`
Status ASOStatus `json:"status,omitempty"`
Output RedisCacheOutput `json:"output,omitempty"`
AdditionalResources RedisCacheAdditionalResources `json:"additionalResources,omitempty"`
}
Expand Down
10 changes: 1 addition & 9 deletions api/v1alpha1/resourcegroup_types.go
Original file line number Diff line number Diff line change
Expand Up @@ -30,14 +30,6 @@ type ResourceGroupSpec struct {
Location string `json:"location"`
}

// ResourceGroupStatus defines the observed state of ResourceGroup
type ResourceGroupStatus struct {
// INSERT ADDITIONAL STATUS FIELD - define observed state of cluster
// Important: Run "make" to regenerate code after modifying this file
Provisioning bool `json:"provisioning,omitempty"`
Provisioned bool `json:"provisioned,omitempty"`
}

// +kubebuilder:object:root=true

// ResourceGroup is the Schema for the resourcegroups API
Expand All @@ -47,7 +39,7 @@ type ResourceGroup struct {
metav1.ObjectMeta `json:"metadata,omitempty"`

Spec ResourceGroupSpec `json:"spec,omitempty"`
Status ResourceGroupStatus `json:"status,omitempty"`
Status ASOStatus `json:"status,omitempty"`
}

// +kubebuilder:object:root=true
Expand Down
14 changes: 1 addition & 13 deletions api/v1alpha1/storage_types.go
Original file line number Diff line number Diff line change
Expand Up @@ -78,18 +78,6 @@ type StorageKind string
// +kubebuilder:validation:Enum=Cool;Hot
type StorageAccessTier string

// StorageStatus defines the observed state of Storage
type StorageStatus struct {
// INSERT ADDITIONAL STATUS FIELD - define observed state of cluster
// Important: Run "make" to regenerate code after modifying this file

// DeploymentName string `json:"deploymentName,omitempty"`
// ProvisioningState string `json:"provisioningState,omitempty"`
// Generation int64 `json:"generation,omitempty"`
Provisioning bool `json:"provisioning,omitempty"`
Provisioned bool `json:"provisioned,omitempty"`
}

// +kubebuilder:object:root=true
// +kubebuilder:subresource:status

Expand All @@ -99,7 +87,7 @@ type Storage struct {
metav1.ObjectMeta `json:"metadata,omitempty"`

Spec StorageSpec `json:"spec,omitempty"`
Status StorageStatus `json:"status,omitempty"`
Status ASOStatus `json:"status,omitempty"`
Output StorageOutput `json:"output,omitempty"`
AdditionalResources StorageAdditionalResources `json:"additionalResources,omitempty"`
}
Expand Down