Skip to content

Commit

Permalink
Change api versionto v1alpha1 (#60)
Browse files Browse the repository at this point in the history
  • Loading branch information
tamalsaha authored Jun 14, 2017
1 parent a823025 commit 22eba5c
Show file tree
Hide file tree
Showing 41 changed files with 4,718 additions and 46 deletions.
2 changes: 1 addition & 1 deletion docs/example/elastic/elastic-init-from-snapshot.yaml
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
apiVersion: kubedb.com/v1beta1
apiVersion: kubedb.com/v1alpha1
kind: Elastic
metadata:
name: elasticsearch-db
Expand Down
2 changes: 1 addition & 1 deletion docs/example/elastic/elastic-with-monitoring.yaml
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
apiVersion: kubedb.com/v1beta1
apiVersion: kubedb.com/v1alpha1
kind: Elastic
metadata:
name: elasticsearch-db
Expand Down
2 changes: 1 addition & 1 deletion docs/example/elastic/elastic-with-scheduled-backup.yaml
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
apiVersion: kubedb.com/v1beta1
apiVersion: kubedb.com/v1alpha1
kind: Elastic
metadata:
name: elasticsearch-db
Expand Down
2 changes: 1 addition & 1 deletion docs/example/elastic/elastic-with-storage.yaml
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
apiVersion: kubedb.com/v1beta1
apiVersion: kubedb.com/v1alpha1
kind: Elastic
metadata:
name: elasticsearch-db
Expand Down
2 changes: 1 addition & 1 deletion docs/example/elastic/elastic.yaml
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
apiVersion: kubedb.com/v1beta1
apiVersion: kubedb.com/v1alpha1
kind: Elastic
metadata:
name: elasticsearch-db
Expand Down
2 changes: 1 addition & 1 deletion docs/example/elastic/snapshot.yaml
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
apiVersion: kubedb.com/v1beta1
apiVersion: kubedb.com/v1alpha1
kind: Snapshot
metadata:
name: snapshot-xyz
Expand Down
2 changes: 1 addition & 1 deletion docs/example/postgres/postgres-init-from-script.yaml
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
apiVersion: kubedb.com/v1beta1
apiVersion: kubedb.com/v1alpha1
kind: Postgres
metadata:
name: postgres-db
Expand Down
2 changes: 1 addition & 1 deletion docs/example/postgres/postgres-init-from-snapshot.yaml
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
apiVersion: kubedb.com/v1beta1
apiVersion: kubedb.com/v1alpha1
kind: Postgres
metadata:
name: postgres-db
Expand Down
2 changes: 1 addition & 1 deletion docs/example/postgres/postgres-with-monitoring.yaml
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
apiVersion: kubedb.com/v1beta1
apiVersion: kubedb.com/v1alpha1
kind: Postgres
metadata:
name: postgres-db
Expand Down
2 changes: 1 addition & 1 deletion docs/example/postgres/postgres-with-scheduled-backup.yaml
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
apiVersion: kubedb.com/v1beta1
apiVersion: kubedb.com/v1alpha1
kind: Postgres
metadata:
name: postgres-db
Expand Down
2 changes: 1 addition & 1 deletion docs/example/postgres/postgres-with-storage.yaml
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
apiVersion: kubedb.com/v1beta1
apiVersion: kubedb.com/v1alpha1
kind: Postgres
metadata:
name: postgres-db
Expand Down
2 changes: 1 addition & 1 deletion docs/example/postgres/postgres.yaml
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
apiVersion: kubedb.com/v1beta1
apiVersion: kubedb.com/v1alpha1
kind: Postgres
metadata:
name: postgres-db
Expand Down
2 changes: 1 addition & 1 deletion docs/example/postgres/snapshot.yaml
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
apiVersion: kubedb.com/v1beta1
apiVersion: kubedb.com/v1alpha1
kind: Snapshot
metadata:
name: snapshot-xyz
Expand Down
2 changes: 1 addition & 1 deletion docs/user-guide/database/backup.md
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ We need to create a Snapshot object to initiate backup process.
Here is a template of Snapshot object

```yaml
apiVersion: kubedb.com/v1beta1
apiVersion: kubedb.com/v1alpha1
kind: Snapshot
metadata:
name: "snapshot-xyz"
Expand Down
2 changes: 1 addition & 1 deletion docs/user-guide/database/elastic/create.md
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
**L**ets create a simple elasticsearch database using following yaml.

```yaml
apiVersion: kubedb.com/v1beta1
apiVersion: kubedb.com/v1alpha1
kind: Elastic
metadata:
name: elasticsearch-db
Expand Down
2 changes: 1 addition & 1 deletion docs/user-guide/database/postgres/create.md
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
**L**ets create a simple postgres database using following yaml.

```yaml
apiVersion: kubedb.com/v1beta1
apiVersion: kubedb.com/v1alpha1
kind: Postgres
metadata:
name: postgres-db
Expand Down
2 changes: 1 addition & 1 deletion docs/user-guide/task/get.md
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ To get YAML of an object, we can provide `--output=yaml` flag
```bash
$ kubedb get postgres postgres-demo --output=yaml

apiVersion: kubedb.com/v1beta1
apiVersion: kubedb.com/v1alpha1
kind: Postgres
metadata:
name: postgres-demo
Expand Down
2 changes: 1 addition & 1 deletion docs/user-guide/tutorial.md
Original file line number Diff line number Diff line change
Expand Up @@ -78,7 +78,7 @@ $ kubedb delete <pg|es> database-demo
For deleting this Postgres object, operator will create a DormantDatabase object `database-demo`.

```yaml
apiVersion: kubedb.com/v1beta1
apiVersion: kubedb.com/v1alpha1
kind: DormantDatabase
metadata:
labels:
Expand Down
7 changes: 5 additions & 2 deletions glide.lock

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

2 changes: 1 addition & 1 deletion glide.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ import:
- package: github.com/spf13/pflag
version: master
- package: github.com/k8sdb/apimachinery
version: master
version: release-0.1
- package: github.com/graymeta/stow
repo: https://github.com/appscode/stow.git
version: master
Expand Down
18 changes: 9 additions & 9 deletions pkg/cmd/util/resource.go
Original file line number Diff line number Diff line change
Expand Up @@ -20,19 +20,19 @@ func GetSupportedResource(resource string) (string, error) {
case strings.ToLower(tapi.ResourceKindElastic),
strings.ToLower(tapi.ResourceTypeElastic),
strings.ToLower(tapi.ResourceCodeElastic):
return tapi.ResourceKindElastic + "." + tapi.V1beta1SchemeGroupVersion.Group, nil
return tapi.ResourceKindElastic + "." + tapi.V1alpha1SchemeGroupVersion.Group, nil
case strings.ToLower(tapi.ResourceKindPostgres),
strings.ToLower(tapi.ResourceTypePostgres),
strings.ToLower(tapi.ResourceCodePostgres):
return tapi.ResourceKindPostgres + "." + tapi.V1beta1SchemeGroupVersion.Group, nil
return tapi.ResourceKindPostgres + "." + tapi.V1alpha1SchemeGroupVersion.Group, nil
case strings.ToLower(tapi.ResourceKindSnapshot),
strings.ToLower(tapi.ResourceTypeSnapshot),
strings.ToLower(tapi.ResourceCodeSnapshot):
return tapi.ResourceKindSnapshot + "." + tapi.V1beta1SchemeGroupVersion.Group, nil
return tapi.ResourceKindSnapshot + "." + tapi.V1alpha1SchemeGroupVersion.Group, nil
case strings.ToLower(tapi.ResourceKindDormantDatabase),
strings.ToLower(tapi.ResourceTypeDormantDatabase),
strings.ToLower(tapi.ResourceCodeDormantDatabase):
return tapi.ResourceKindDormantDatabase + "." + tapi.V1beta1SchemeGroupVersion.Group, nil
return tapi.ResourceKindDormantDatabase + "." + tapi.V1alpha1SchemeGroupVersion.Group, nil
default:
return "", fmt.Errorf(`kubedb doesn't support a resource type "%v"`, resource)
}
Expand Down Expand Up @@ -78,10 +78,10 @@ func CheckSupportedResource(kind string) error {
func GetAllSupportedResources(f cmdutil.Factory) ([]string, error) {

resources := map[string]string{
tapi.ResourceNameElastic: tapi.ResourceKindElastic + "." + tapi.V1beta1SchemeGroupVersion.Group,
tapi.ResourceNamePostgres: tapi.ResourceKindPostgres + "." + tapi.V1beta1SchemeGroupVersion.Group,
tapi.ResourceNameSnapshot: tapi.ResourceKindSnapshot + "." + tapi.V1beta1SchemeGroupVersion.Group,
tapi.ResourceNameDormantDatabase: tapi.ResourceKindDormantDatabase + "." + tapi.V1beta1SchemeGroupVersion.Group,
tapi.ResourceNameElastic: tapi.ResourceKindElastic + "." + tapi.V1alpha1SchemeGroupVersion.Group,
tapi.ResourceNamePostgres: tapi.ResourceKindPostgres + "." + tapi.V1alpha1SchemeGroupVersion.Group,
tapi.ResourceNameSnapshot: tapi.ResourceKindSnapshot + "." + tapi.V1alpha1SchemeGroupVersion.Group,
tapi.ResourceNameDormantDatabase: tapi.ResourceKindDormantDatabase + "." + tapi.V1alpha1SchemeGroupVersion.Group,
}

clientset, err := f.ClientSet()
Expand All @@ -91,7 +91,7 @@ func GetAllSupportedResources(f cmdutil.Factory) ([]string, error) {

availableResources := make([]string, 0)
for key, val := range resources {
_, err := clientset.ThirdPartyResources().Get(key + "." + tapi.V1beta1SchemeGroupVersion.Group)
_, err := clientset.ThirdPartyResources().Get(key + "." + tapi.V1alpha1SchemeGroupVersion.Group)
if err != nil {
if k8serr.IsNotFound(err) {
continue
Expand Down
Loading

0 comments on commit 22eba5c

Please sign in to comment.