Skip to content

Commit

Permalink
Change name of SqlDatabase operator to AzureSqlDatabase
Browse files Browse the repository at this point in the history
  • Loading branch information
aka-msft committed Oct 13, 2019
1 parent 9278fe7 commit dc585ce
Show file tree
Hide file tree
Showing 10 changed files with 146 additions and 146 deletions.
2 changes: 1 addition & 1 deletion PROJECT
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ resources:
kind: AzureSqlServer
- group: azure
version: v1alpha1
kind: SqlDatabase
kind: AzureSqlDatabase
- group: azure
version: v1alpha1
kind: SqlFirewallRule
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -22,8 +22,8 @@ import (

// NOTE: json tags are required. Any new fields you add must have json tags for the fields to be serialized.

// SqlDatabaseSpec defines the desired state of SqlDatabase
type SqlDatabaseSpec struct {
// AzureSqlDatabaseSpec defines the desired state of AzureSqlDatabase
type AzureSqlDatabaseSpec struct {
// INSERT ADDITIONAL SPEC FIELDS - desired state of cluster
// Important: Run "make" to regenerate code after modifying this file
Location string `json:"location"`
Expand All @@ -32,8 +32,8 @@ type SqlDatabaseSpec struct {
Edition sql.DBEdition `json:"edition"`
}

// SqlDatabaseStatus defines the observed state of SqlDatabase
type SqlDatabaseStatus struct {
// 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"`
Expand All @@ -42,28 +42,28 @@ type SqlDatabaseStatus struct {

// +kubebuilder:object:root=true
// +kubebuilder:subresource:status
// SqlDatabase is the Schema for the sqldatabases API
type SqlDatabase struct {
// AzureSqlDatabase is the Schema for the azuresqldatabases API
type AzureSqlDatabase struct {
metav1.TypeMeta `json:",inline"`
metav1.ObjectMeta `json:"metadata,omitempty"`

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

// +kubebuilder:object:root=true

// SqlDatabaseList contains a list of SqlDatabase
type SqlDatabaseList struct {
// AzureSqlDatabaseList contains a list of AzureSqlDatabase
type AzureSqlDatabaseList struct {
metav1.TypeMeta `json:",inline"`
metav1.ListMeta `json:"metadata,omitempty"`
Items []SqlDatabase `json:"items"`
Items []AzureSqlDatabase `json:"items"`
}

func init() {
SchemeBuilder.Register(&SqlDatabase{}, &SqlDatabaseList{})
SchemeBuilder.Register(&AzureSqlDatabase{}, &AzureSqlDatabaseList{})
}

func (s *SqlDatabase) IsSubmitted() bool {
func (s *AzureSqlDatabase) IsSubmitted() bool {
return s.Status.Provisioned
}
Original file line number Diff line number Diff line change
Expand Up @@ -27,10 +27,10 @@ import (
// These tests are written in BDD-style using Ginkgo framework. Refer to
// http://onsi.github.io/ginkgo to learn more.

var _ = Describe("SqlDatabase", func() {
var _ = Describe("AzureSqlDatabase", func() {
var (
key types.NamespacedName
created, fetched *SqlDatabase
created, fetched *AzureSqlDatabase
)

BeforeEach(func() {
Expand All @@ -53,12 +53,12 @@ var _ = Describe("SqlDatabase", func() {
Name: "foo",
Namespace: "default",
}
created = &SqlDatabase{
created = &AzureSqlDatabase{
ObjectMeta: metav1.ObjectMeta{
Name: "foo",
Namespace: "default",
},
Spec: SqlDatabaseSpec{
Spec: AzureSqlDatabaseSpec{
Location: "westus",
ResourceGroup: "foo-resourcegroup",
Server: "sqlsrvsample",
Expand All @@ -68,7 +68,7 @@ var _ = Describe("SqlDatabase", func() {
By("creating an API obj")
Expect(k8sClient.Create(context.TODO(), created)).To(Succeed())

fetched = &SqlDatabase{}
fetched = &AzureSqlDatabase{}
Expect(k8sClient.Get(context.TODO(), key, fetched)).To(Succeed())
Expect(fetched).To(Equal(created))

Expand Down
178 changes: 89 additions & 89 deletions api/v1alpha1/zz_generated.deepcopy.go

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

6 changes: 3 additions & 3 deletions config/crd/kustomization.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ resources:
- bases/azure.microsoft.com_consumergroups.yaml
- bases/azure.microsoft.com_keyvaults.yaml
- bases/azure.microsoft.com_azuresqlservers.yaml
- bases/azure.microsoft.com_sqldatabases.yaml
- bases/azure.microsoft.com_azuresqldatabases.yaml
- bases/azure.microsoft.com_sqlfirewallrules.yaml
- bases/azure.microsoft.com_azuresqlactions.yaml
# +kubebuilder:scaffold:crdkustomizeresource
Expand All @@ -24,7 +24,7 @@ patches:
#- patches/webhook_in_consumergroups.yaml
#- patches/webhook_in_keyvaults.yaml
#- patches/webhook_in_azuresqlservers.yaml
#- patches/webhook_in_sqldatabases.yaml
#- patches/webhook_in_azuresqldatabases.yaml
#- patches/webhook_in_sqlfirewallrules.yaml
#- patches/webhook_in_azuresqlactions.yaml
# +kubebuilder:scaffold:crdkustomizewebhookpatch
Expand All @@ -36,7 +36,7 @@ patches:
#- patches/cainjection_in_consumergroups.yaml
#- patches/cainjection_in_keyvaults.yaml
#- patches/cainjection_in_azuresqlservers.yaml
#- patches/cainjection_in_sqldatabases.yaml
#- patches/cainjection_in_azuresqldatabases.yaml
#- patches/cainjection_in_sqlfirewallrules.yaml
#- patches/cainjection_in_azuresqlactions.yaml
# +kubebuilder:scaffold:crdkustomizecainjectionpatch
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,4 +5,4 @@ kind: CustomResourceDefinition
metadata:
annotations:
certmanager.k8s.io/inject-ca-from: $(CERTIFICATE_NAMESPACE)/$(CERTIFICATE_NAME)
name: sqldatabases.azure.microsoft.com
name: azuresqldatabases.azure.microsoft.com
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
apiVersion: apiextensions.k8s.io/v1beta1
kind: CustomResourceDefinition
metadata:
name: sqldatabases.azure.microsoft.com
name: azuresqldatabases.azure.microsoft.com
spec:
conversion:
strategy: Webhook
Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
apiVersion: azure.microsoft.com/v1alpha1
kind: SqlDatabase
kind: AzureSqlDatabase
metadata:
name: sqldatabase-sample
name: azuresqldatabase-sample
spec:
location: westus
resourcegroup: resourcegroup-azure-operators
Expand Down
Loading

0 comments on commit dc585ce

Please sign in to comment.