Skip to content

Commit

Permalink
Change name of SqlServer operator to AzureSqlServer
Browse files Browse the repository at this point in the history
  • Loading branch information
aka-msft committed Oct 11, 2019
1 parent 099418d commit 9278fe7
Show file tree
Hide file tree
Showing 14 changed files with 171 additions and 171 deletions.
2 changes: 1 addition & 1 deletion PROJECT
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ resources:
kind: EventhubNamespace
- group: azure
version: v1alpha1
kind: SqlServer
kind: AzureSqlServer
- group: azure
version: v1alpha1
kind: SqlDatabase
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -22,16 +22,16 @@ import (
// 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.

// SqlServerSpec defines the desired state of SqlServer
type SqlServerSpec struct {
// AzureSqlServerSpec defines the desired state of AzureSqlServer
type AzureSqlServerSpec struct {
// INSERT ADDITIONAL SPEC FIELDS - desired state of cluster
// Important: Run "make" to regenerate code after modifying this file
Location string `json:"location"`
ResourceGroup string `json:"resourcegroup,omitempty"`
}

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

// +kubebuilder:object:root=true
// +kubebuilder:subresource:status
// SqlServer is the Schema for the sqlservers API
type SqlServer struct {
// AzureSqlServer is the Schema for the azuresqlservers API
type AzureSqlServer struct {
metav1.TypeMeta `json:",inline"`
metav1.ObjectMeta `json:"metadata,omitempty"`

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

// +kubebuilder:object:root=true

// SqlServerList contains a list of SqlServer
type SqlServerList struct {
// AzureSqlServerList contains a list of AzureSqlServer
type AzureSqlServerList struct {
metav1.TypeMeta `json:",inline"`
metav1.ListMeta `json:"metadata,omitempty"`
Items []SqlServer `json:"items"`
Items []AzureSqlServer `json:"items"`
}

func init() {
SchemeBuilder.Register(&SqlServer{}, &SqlServerList{})
SchemeBuilder.Register(&AzureSqlServer{}, &AzureSqlServerList{})
}

func (s *SqlServer) IsSubmitted() bool {
func (s *AzureSqlServer) IsSubmitted() bool {
return s.Status.Provisioned || s.Status.Provisioning
}

func (s *SqlServer) IsProvisioned() bool {
func (s *AzureSqlServer) IsProvisioned() 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("SqlServer", func() {
var _ = Describe("AzureSqlServer", func() {
var (
key types.NamespacedName
created, fetched *SqlServer
created, fetched *AzureSqlServer
)

BeforeEach(func() {
Expand All @@ -53,20 +53,20 @@ var _ = Describe("SqlServer", func() {
Name: "foo",
Namespace: "default",
}
created = &SqlServer{
created = &AzureSqlServer{
ObjectMeta: metav1.ObjectMeta{
Name: "foo",
Namespace: "default",
},
Spec: SqlServerSpec{
Spec: AzureSqlServerSpec{
Location: "westus",
ResourceGroup: "foo-resourcegroup",
}}

By("creating an API obj")
Expect(k8sClient.Create(context.TODO(), created)).To(Succeed())

fetched = &SqlServer{}
fetched = &AzureSqlServer{}
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 @@ -10,7 +10,7 @@ resources:
- bases/azure.microsoft.com_eventhubnamespaces.yaml
- bases/azure.microsoft.com_consumergroups.yaml
- bases/azure.microsoft.com_keyvaults.yaml
- bases/azure.microsoft.com_sqlservers.yaml
- bases/azure.microsoft.com_azuresqlservers.yaml
- bases/azure.microsoft.com_sqldatabases.yaml
- bases/azure.microsoft.com_sqlfirewallrules.yaml
- bases/azure.microsoft.com_azuresqlactions.yaml
Expand All @@ -23,7 +23,7 @@ patches:
#- patches/webhook_in_eventhubnamespaces.yaml
#- patches/webhook_in_consumergroups.yaml
#- patches/webhook_in_keyvaults.yaml
#- patches/webhook_in_sqlservers.yaml
#- patches/webhook_in_azuresqlservers.yaml
#- patches/webhook_in_sqldatabases.yaml
#- patches/webhook_in_sqlfirewallrules.yaml
#- patches/webhook_in_azuresqlactions.yaml
Expand All @@ -35,7 +35,7 @@ patches:
#- patches/cainjection_in_eventhubnamespaces.yaml
#- patches/cainjection_in_consumergroups.yaml
#- patches/cainjection_in_keyvaults.yaml
#- patches/cainjection_in_sqlservers.yaml
#- patches/cainjection_in_azuresqlservers.yaml
#- patches/cainjection_in_sqldatabases.yaml
#- patches/cainjection_in_sqlfirewallrules.yaml
#- patches/cainjection_in_azuresqlactions.yaml
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: sqlservers.azure.microsoft.com
name: azuresqlservers.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: sqlservers.azure.microsoft.com
name: azuresqlservers.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: SqlServer
kind: AzureSqlServer
metadata:
name: sqlserver-sample-777
spec:
location: "westus"
location: westus
resourcegroup: resourcegroup-azure-operators
Loading

0 comments on commit 9278fe7

Please sign in to comment.