From bd77d484a6cbe3c1d94432d0b40bae4eb9e580f6 Mon Sep 17 00:00:00 2001 From: tamal Date: Wed, 17 May 2017 08:12:50 -0700 Subject: [PATCH] Rename DatabaseSnapshot to Snapshot --- docs/kubedb/describe.md | 2 +- docs/kubedb/get.md | 6 +- glide.lock | 6 +- pkg/cmd/decoder/decode.go | 8 +- pkg/cmd/describer/describer.go | 2 +- pkg/cmd/describer/k8sdb_describer.go | 8 +- pkg/cmd/get.go | 6 +- pkg/cmd/printer/resource_printer.go | 12 +- pkg/cmd/util/resource.go | 14 +-- .../k8sdb/apimachinery/api/register.go | 10 +- .../apimachinery/api/register_v1beta1.go | 6 +- ...se_snapshot_types.go => snapshot_types.go} | 32 +++--- .../k8sdb/apimachinery/api/types.go | 6 +- .../client/clientset/database_snapshot.go | 107 ------------------ .../client/clientset/extensions.go | 6 +- .../apimachinery/client/clientset/snapshot.go | 107 ++++++++++++++++++ vendor/k8s.io/kubernetes/pkg/version/base.go | 6 +- 17 files changed, 172 insertions(+), 172 deletions(-) rename vendor/github.com/k8sdb/apimachinery/api/{database_snapshot_types.go => snapshot_types.go} (51%) delete mode 100644 vendor/github.com/k8sdb/apimachinery/client/clientset/database_snapshot.go create mode 100644 vendor/github.com/k8sdb/apimachinery/client/clientset/snapshot.go diff --git a/docs/kubedb/describe.md b/docs/kubedb/describe.md index 83ba6ff17..60e012357 100644 --- a/docs/kubedb/describe.md +++ b/docs/kubedb/describe.md @@ -13,7 +13,7 @@ description of a given resource or group of resources.Valid resource types inclu * all * elastic * postgres - * databasesnapshot + * snapshot * deleteddatabase Examples: diff --git a/docs/kubedb/get.md b/docs/kubedb/get.md index 94143628f..b71e3f9ae 100644 --- a/docs/kubedb/get.md +++ b/docs/kubedb/get.md @@ -14,7 +14,7 @@ Valid resource types include: * all * elastic * postgres - * databasesnapshot + * snapshot * deleteddatabase Examples: @@ -27,8 +27,8 @@ Examples: # List a single postgres with specified NAME in ps output format. kubedb get postgres database - # List a single databasesnapshot in JSON output format. - kubedb get -o json databasesnapshot snapshot-xyz + # List a single snapshot in JSON output format. + kubedb get -o json snapshot snapshot-xyz # List all postgreses and elastics together in ps output format. kubedb get postgreses,elastics diff --git a/glide.lock b/glide.lock index 7194daf49..ae396a61e 100644 --- a/glide.lock +++ b/glide.lock @@ -1,5 +1,5 @@ hash: 3bdc093bab543738c2fe4fba8cbc716c75d52206086eca445e718503a0d5a96e -updated: 2017-05-17T17:47:20.030495408+06:00 +updated: 2017-05-17T08:05:26.811191297-07:00 imports: - name: cloud.google.com/go version: 3b1ae45394a234c385be014e9a488f2bb6eef821 @@ -150,7 +150,7 @@ imports: - name: github.com/juju/ratelimit version: 77ed1c8a01217656d2080ad51981f6e99adaa177 - name: github.com/k8sdb/apimachinery - version: d12e4bc9500d1d3e6bbb818534dd5590cbbbeda0 + version: 0cdd788893b395daa0138ce33c6ac0f9cffe2900 subpackages: - api - api/install @@ -252,7 +252,7 @@ imports: - name: gopkg.in/yaml.v2 version: 53feefa2559fb8dfa8d81baad31be332c97d6c77 - name: k8s.io/kubernetes - version: f07eea23494be1e7c11a8e2cf51bd96d1ec9fdf1 + version: 8eb75a5810cba92ccad845ca360cf924f2385881 subpackages: - federation/apis/federation - federation/apis/federation/install diff --git a/pkg/cmd/decoder/decode.go b/pkg/cmd/decoder/decode.go index 3f833f529..c6e0d7c19 100644 --- a/pkg/cmd/decoder/decode.go +++ b/pkg/cmd/decoder/decode.go @@ -23,12 +23,12 @@ func Decode(kind string, data []byte) (runtime.Object, error) { } return postgres, nil - case tapi.ResourceKindDatabaseSnapshot: - var dbSnapshot *tapi.DatabaseSnapshot - if err := yaml.Unmarshal(data, &dbSnapshot); err != nil { + case tapi.ResourceKindSnapshot: + var snapshot *tapi.Snapshot + if err := yaml.Unmarshal(data, &snapshot); err != nil { return nil, err } - return dbSnapshot, nil + return snapshot, nil case tapi.ResourceKindDeletedDatabase: var deletedDb *tapi.DeletedDatabase if err := yaml.Unmarshal(data, &deletedDb); err != nil { diff --git a/pkg/cmd/describer/describer.go b/pkg/cmd/describer/describer.go index e1e46fdcb..1398976c1 100644 --- a/pkg/cmd/describer/describer.go +++ b/pkg/cmd/describer/describer.go @@ -45,7 +45,7 @@ func newHumanReadableDescriber(f cmdutil.Factory) *humanReadableDescriber { func (h *humanReadableDescriber) addDefaultHandlers() { h.Handler(h.describeElastic) h.Handler(h.describePostgres) - h.Handler(h.describeDatabaseSnapshot) + h.Handler(h.describeSnapshot) h.Handler(h.describeDeletedDatabase) } diff --git a/pkg/cmd/describer/k8sdb_describer.go b/pkg/cmd/describer/k8sdb_describer.go index 96628738b..503bf9377 100644 --- a/pkg/cmd/describer/k8sdb_describer.go +++ b/pkg/cmd/describer/k8sdb_describer.go @@ -23,7 +23,7 @@ func (d *humanReadableDescriber) describeElastic(item *tapi.Elastic, describerSe return "", err } - snapshots, err := d.extensionsClient.DatabaseSnapshots(item.Namespace).List( + snapshots, err := d.extensionsClient.Snapshots(item.Namespace).List( kapi.ListOptions{ LabelSelector: labels.SelectorFromSet( map[string]string{ @@ -89,7 +89,7 @@ func (d *humanReadableDescriber) describePostgres(item *tapi.Postgres, describer return "", err } - snapshots, err := d.extensionsClient.DatabaseSnapshots(item.Namespace).List( + snapshots, err := d.extensionsClient.Snapshots(item.Namespace).List( kapi.ListOptions{ LabelSelector: labels.SelectorFromSet( map[string]string{ @@ -151,7 +151,7 @@ func (d *humanReadableDescriber) describePostgres(item *tapi.Postgres, describer }) } -func (d *humanReadableDescriber) describeDatabaseSnapshot(item *tapi.DatabaseSnapshot, describerSettings *kubectl.DescriberSettings) (string, error) { +func (d *humanReadableDescriber) describeSnapshot(item *tapi.Snapshot, describerSettings *kubectl.DescriberSettings) (string, error) { clientSet, err := d.ClientSet() if err != nil { return "", err @@ -263,7 +263,7 @@ func describeStorage(storage *tapi.StorageSpec, out io.Writer) { fmt.Fprintf(out, " Access Modes:\t%s\n", accessModes) } -func listSnapshots(snapshotList *tapi.DatabaseSnapshotList, out io.Writer) { +func listSnapshots(snapshotList *tapi.SnapshotList, out io.Writer) { fmt.Fprint(out, "\n") if len(snapshotList.Items) == 0 { diff --git a/pkg/cmd/get.go b/pkg/cmd/get.go index 874ca0380..74bd9a10f 100644 --- a/pkg/cmd/get.go +++ b/pkg/cmd/get.go @@ -36,8 +36,8 @@ var ( # List a single postgres with specified NAME in ps output format. kubedb get postgres database - # List a single databasesnapshot in JSON output format. - kubedb get -o json databasesnapshot snapshot-xyz + # List a single snapshot in JSON output format. + kubedb get -o json snapshot snapshot-xyz # List all postgreses and elastics together in ps output format. kubedb get postgreses,elastics @@ -68,7 +68,7 @@ const ( * all * elastic * postgres - * databasesnapshot + * snapshot * deleteddatabase ` ) diff --git a/pkg/cmd/printer/resource_printer.go b/pkg/cmd/printer/resource_printer.go index 87e24aeea..e8bd6b51b 100644 --- a/pkg/cmd/printer/resource_printer.go +++ b/pkg/cmd/printer/resource_printer.go @@ -81,8 +81,8 @@ func (h *HumanReadablePrinter) addDefaultHandlers() { h.Handler(h.printElastic) h.Handler(h.printPostgresList) h.Handler(h.printPostgres) - h.Handler(h.printDatabaseSnapshotList) - h.Handler(h.printDatabaseSnapshot) + h.Handler(h.printSnapshotList) + h.Handler(h.printSnapshot) h.Handler(h.printDeletedDatabaseList) h.Handler(h.printDeletedDatabase) } @@ -226,7 +226,7 @@ func (h *HumanReadablePrinter) printPostgresList(itemList *tapi.PostgresList, w return nil } -func (h *HumanReadablePrinter) printDatabaseSnapshot(item *tapi.DatabaseSnapshot, w io.Writer, options PrintOptions) error { +func (h *HumanReadablePrinter) printSnapshot(item *tapi.Snapshot, w io.Writer, options PrintOptions) error { name := formatResourceName(options.Kind, item.Name, options.WithKind) namespace := item.Namespace @@ -260,9 +260,9 @@ func (h *HumanReadablePrinter) printDatabaseSnapshot(item *tapi.DatabaseSnapshot return err } -func (h *HumanReadablePrinter) printDatabaseSnapshotList(itemList *tapi.DatabaseSnapshotList, w io.Writer, options PrintOptions) error { +func (h *HumanReadablePrinter) printSnapshotList(itemList *tapi.SnapshotList, w io.Writer, options PrintOptions) error { for _, item := range itemList.Items { - if err := h.printDatabaseSnapshot(&item, w, options); err != nil { + if err := h.printSnapshot(&item, w, options); err != nil { return err } } @@ -423,7 +423,7 @@ func formatWideHeaders(wide bool, t reflect.Type) []string { if t.String() == "*api.Postgres" || t.String() == "*api.PostgresList" { return []string{"VERSION"} } - if t.String() == "*api.DatabaseSnapshot" || t.String() == "*api.DatabaseSnapshotList" { + if t.String() == "*api.Snapshot" || t.String() == "*api.SnapshotList" { return []string{"BUCKET"} } } diff --git a/pkg/cmd/util/resource.go b/pkg/cmd/util/resource.go index d9f420040..d1b587e31 100644 --- a/pkg/cmd/util/resource.go +++ b/pkg/cmd/util/resource.go @@ -19,10 +19,10 @@ func GetSupportedResourceKind(resource string) (string, error) { case strings.ToLower(tapi.ResourceTypePostgres): case strings.ToLower(tapi.ResourceCodePostgres): return tapi.ResourceKindPostgres, nil - case strings.ToLower(tapi.ResourceKindDatabaseSnapshot): - case strings.ToLower(tapi.ResourceTypeDatabaseSnapshot): - case strings.ToLower(tapi.ResourceCodeDatabaseSnapshot): - return tapi.ResourceKindDatabaseSnapshot, nil + case strings.ToLower(tapi.ResourceKindSnapshot): + case strings.ToLower(tapi.ResourceTypeSnapshot): + case strings.ToLower(tapi.ResourceCodeSnapshot): + return tapi.ResourceKindSnapshot, nil case strings.ToLower(tapi.ResourceKindDeletedDatabase): case strings.ToLower(tapi.ResourceTypeDeletedDatabase): case strings.ToLower(tapi.ResourceCodeDeletedDatabase): @@ -37,7 +37,7 @@ func CheckSupportedResource(kind string) error { switch kind { case tapi.ResourceKindElastic: case tapi.ResourceKindPostgres: - case tapi.ResourceKindDatabaseSnapshot: + case tapi.ResourceKindSnapshot: case tapi.ResourceKindDeletedDatabase: return nil default: @@ -51,7 +51,7 @@ func GetAllSupportedResources(f cmdutil.Factory) ([]string, error) { resources := map[string]string{ tapi.ResourceNameElastic: tapi.ResourceTypeElastic, tapi.ResourceNamePostgres: tapi.ResourceTypePostgres, - tapi.ResourceNameDatabaseSnapshot: tapi.ResourceTypeDatabaseSnapshot, + tapi.ResourceNameSnapshot: tapi.ResourceTypeSnapshot, tapi.ResourceNameDeletedDatabase: tapi.ResourceTypeDeletedDatabase, } @@ -78,7 +78,7 @@ func GetAllSupportedResources(f cmdutil.Factory) ([]string, error) { var ShortForms = map[string]string{ tapi.ResourceCodeElastic: tapi.ResourceTypeElastic, tapi.ResourceCodePostgres: tapi.ResourceTypePostgres, - tapi.ResourceCodeDatabaseSnapshot: tapi.ResourceTypeDatabaseSnapshot, + tapi.ResourceCodeSnapshot: tapi.ResourceTypeSnapshot, tapi.ResourceCodeDeletedDatabase: tapi.ResourceTypeDeletedDatabase, } diff --git a/vendor/github.com/k8sdb/apimachinery/api/register.go b/vendor/github.com/k8sdb/apimachinery/api/register.go index 85f40c78a..d0f21fc1d 100644 --- a/vendor/github.com/k8sdb/apimachinery/api/register.go +++ b/vendor/github.com/k8sdb/apimachinery/api/register.go @@ -30,9 +30,9 @@ var ( // Adds the list of known types to api.Scheme. func addKnownTypes(scheme *runtime.Scheme) error { scheme.AddKnownTypes(SchemeGroupVersion, - // DatabaseSnapshot - &DatabaseSnapshot{}, - &DatabaseSnapshotList{}, + // Snapshot + &Snapshot{}, + &SnapshotList{}, // DeletedDatabase &DeletedDatabase{}, &DeletedDatabaseList{}, @@ -48,8 +48,8 @@ func addKnownTypes(scheme *runtime.Scheme) error { return nil } -func (obj *DatabaseSnapshot) GetObjectKind() schema.ObjectKind { return &obj.TypeMeta } -func (obj *DatabaseSnapshotList) GetObjectKind() schema.ObjectKind { return &obj.TypeMeta } +func (obj *Snapshot) GetObjectKind() schema.ObjectKind { return &obj.TypeMeta } +func (obj *SnapshotList) GetObjectKind() schema.ObjectKind { return &obj.TypeMeta } func (obj *DeletedDatabase) GetObjectKind() schema.ObjectKind { return &obj.TypeMeta } func (obj *DeletedDatabaseList) GetObjectKind() schema.ObjectKind { return &obj.TypeMeta } diff --git a/vendor/github.com/k8sdb/apimachinery/api/register_v1beta1.go b/vendor/github.com/k8sdb/apimachinery/api/register_v1beta1.go index 10b335ca7..54017fb63 100644 --- a/vendor/github.com/k8sdb/apimachinery/api/register_v1beta1.go +++ b/vendor/github.com/k8sdb/apimachinery/api/register_v1beta1.go @@ -18,9 +18,9 @@ var ( // Adds the list of known types to api.Scheme. func v1addKnownTypes(scheme *runtime.Scheme) error { scheme.AddKnownTypes(V1beta1SchemeGroupVersion, - // DatabaseSnapshot - &DatabaseSnapshot{}, - &DatabaseSnapshotList{}, + // Snapshot + &Snapshot{}, + &SnapshotList{}, // DeletedDatabase &DeletedDatabase{}, &DeletedDatabaseList{}, diff --git a/vendor/github.com/k8sdb/apimachinery/api/database_snapshot_types.go b/vendor/github.com/k8sdb/apimachinery/api/snapshot_types.go similarity index 51% rename from vendor/github.com/k8sdb/apimachinery/api/database_snapshot_types.go rename to vendor/github.com/k8sdb/apimachinery/api/snapshot_types.go index 3457c0365..675b1a35c 100644 --- a/vendor/github.com/k8sdb/apimachinery/api/database_snapshot_types.go +++ b/vendor/github.com/k8sdb/apimachinery/api/snapshot_types.go @@ -6,47 +6,47 @@ import ( ) const ( - ResourceCodeDatabaseSnapshot = "snp" - ResourceKindDatabaseSnapshot = "DatabaseSnapshot" - ResourceNameDatabaseSnapshot = "database-snapshot" - ResourceTypeDatabaseSnapshot = "databasesnapshots" + ResourceCodeSnapshot = "snp" + ResourceKindSnapshot = "Snapshot" + ResourceNameSnapshot = "snapshot" + ResourceTypeSnapshot = "snapshots" ) -type DatabaseSnapshot struct { +type Snapshot struct { unversioned.TypeMeta `json:",inline,omitempty"` api.ObjectMeta `json:"metadata,omitempty"` - Spec DatabaseSnapshotSpec `json:"spec,omitempty"` - Status DatabaseSnapshotStatus `json:"status,omitempty"` + Spec SnapshotSpec `json:"spec,omitempty"` + Status SnapshotStatus `json:"status,omitempty"` } -type DatabaseSnapshotSpec struct { +type SnapshotSpec struct { // Database name DatabaseName string `json:"databaseName,omitempty"` // Snapshot Spec - SnapshotSpec `json:",inline,omitempty"` + SnapshotStorageSpec `json:",inline,omitempty"` } type SnapshotPhase string const ( - // used for DatabaseSnapshots that are currently running + // used for Snapshots that are currently running SnapshotPhaseRunning SnapshotPhase = "Running" - // used for DatabaseSnapshots that are Succeeded + // used for Snapshots that are Succeeded SnapshotPhaseSuccessed SnapshotPhase = "Succeeded" - // used for DatabaseSnapshots that are Failed + // used for Snapshots that are Failed SnapshotPhaseFailed SnapshotPhase = "Failed" ) -type DatabaseSnapshotStatus struct { +type SnapshotStatus struct { StartTime *unversioned.Time `json:"startTime,omitempty"` CompletionTime *unversioned.Time `json:"completionTime,omitempty"` Phase SnapshotPhase `json:"phase,omitempty"` Reason string `json:"reason,omitempty"` } -type DatabaseSnapshotList struct { +type SnapshotList struct { unversioned.TypeMeta `json:",inline"` unversioned.ListMeta `json:"metadata,omitempty"` - // Items is a list of DatabaseSnapshot TPR objects - Items []DatabaseSnapshot `json:"items,omitempty"` + // Items is a list of Snapshot TPR objects + Items []Snapshot `json:"items,omitempty"` } diff --git a/vendor/github.com/k8sdb/apimachinery/api/types.go b/vendor/github.com/k8sdb/apimachinery/api/types.go index be1a39444..085446b91 100644 --- a/vendor/github.com/k8sdb/apimachinery/api/types.go +++ b/vendor/github.com/k8sdb/apimachinery/api/types.go @@ -26,11 +26,11 @@ type SnapshotSourceSpec struct { } type BackupScheduleSpec struct { - CronExpression string `json:"cronExpression,omitempty"` - SnapshotSpec `json:",inline,omitempty"` + CronExpression string `json:"cronExpression,omitempty"` + SnapshotStorageSpec `json:",inline,omitempty"` } -type SnapshotSpec struct { +type SnapshotStorageSpec struct { // Snapshot storage secret StorageSecret *api.SecretVolumeSource `json:"storageSecret,omitempty"` // Cloud bucket name diff --git a/vendor/github.com/k8sdb/apimachinery/client/clientset/database_snapshot.go b/vendor/github.com/k8sdb/apimachinery/client/clientset/database_snapshot.go deleted file mode 100644 index f0f845cb3..000000000 --- a/vendor/github.com/k8sdb/apimachinery/client/clientset/database_snapshot.go +++ /dev/null @@ -1,107 +0,0 @@ -package clientset - -import ( - aci "github.com/k8sdb/apimachinery/api" - "k8s.io/kubernetes/pkg/api" - rest "k8s.io/kubernetes/pkg/client/restclient" - "k8s.io/kubernetes/pkg/watch" -) - -type DatabaseSnapshotNamespacer interface { - DatabaseSnapshots(namespace string) DatabaseSnapshotInterface -} - -type DatabaseSnapshotInterface interface { - List(opts api.ListOptions) (*aci.DatabaseSnapshotList, error) - Get(name string) (*aci.DatabaseSnapshot, error) - Create(databasesnapshot *aci.DatabaseSnapshot) (*aci.DatabaseSnapshot, error) - Update(databasesnapshot *aci.DatabaseSnapshot) (*aci.DatabaseSnapshot, error) - Delete(name string) error - Watch(opts api.ListOptions) (watch.Interface, error) - UpdateStatus(databasesnapshot *aci.DatabaseSnapshot) (*aci.DatabaseSnapshot, error) -} - -type DatabaseSnapshotImpl struct { - r rest.Interface - ns string -} - -func newDatabaseSnapshot(c *ExtensionsClient, namespace string) *DatabaseSnapshotImpl { - return &DatabaseSnapshotImpl{c.restClient, namespace} -} - -func (c *DatabaseSnapshotImpl) List(opts api.ListOptions) (result *aci.DatabaseSnapshotList, err error) { - result = &aci.DatabaseSnapshotList{} - err = c.r.Get(). - Namespace(c.ns). - Resource(aci.ResourceTypeDatabaseSnapshot). - VersionedParams(&opts, ExtendedCodec). - Do(). - Into(result) - return -} - -func (c *DatabaseSnapshotImpl) Get(name string) (result *aci.DatabaseSnapshot, err error) { - result = &aci.DatabaseSnapshot{} - err = c.r.Get(). - Namespace(c.ns). - Resource(aci.ResourceTypeDatabaseSnapshot). - Name(name). - Do(). - Into(result) - return -} - -func (c *DatabaseSnapshotImpl) Create(databasesnapshot *aci.DatabaseSnapshot) (result *aci.DatabaseSnapshot, err error) { - result = &aci.DatabaseSnapshot{} - err = c.r.Post(). - Namespace(c.ns). - Resource(aci.ResourceTypeDatabaseSnapshot). - Body(databasesnapshot). - Do(). - Into(result) - return -} - -func (c *DatabaseSnapshotImpl) Update(databasesnapshot *aci.DatabaseSnapshot) (result *aci.DatabaseSnapshot, err error) { - result = &aci.DatabaseSnapshot{} - err = c.r.Put(). - Namespace(c.ns). - Resource(aci.ResourceTypeDatabaseSnapshot). - Name(databasesnapshot.Name). - Body(databasesnapshot). - Do(). - Into(result) - return -} - -func (c *DatabaseSnapshotImpl) Delete(name string) (err error) { - return c.r.Delete(). - Namespace(c.ns). - Resource(aci.ResourceTypeDatabaseSnapshot). - Name(name). - Do(). - Error() -} - -func (c *DatabaseSnapshotImpl) Watch(opts api.ListOptions) (watch.Interface, error) { - return c.r.Get(). - Prefix("watch"). - Namespace(c.ns). - Resource(aci.ResourceTypeDatabaseSnapshot). - VersionedParams(&opts, ExtendedCodec). - Watch() -} - -func (c *DatabaseSnapshotImpl) UpdateStatus(databasesnapshot *aci.DatabaseSnapshot) (result *aci.DatabaseSnapshot, err error) { - result = &aci.DatabaseSnapshot{} - err = c.r.Put(). - Namespace(c.ns). - Resource(aci.ResourceTypeDatabaseSnapshot). - Name(databasesnapshot.Name). - SubResource("status"). - Body(databasesnapshot). - Do(). - Into(result) - return -} diff --git a/vendor/github.com/k8sdb/apimachinery/client/clientset/extensions.go b/vendor/github.com/k8sdb/apimachinery/client/clientset/extensions.go index 6e86574cd..5aae385a7 100644 --- a/vendor/github.com/k8sdb/apimachinery/client/clientset/extensions.go +++ b/vendor/github.com/k8sdb/apimachinery/client/clientset/extensions.go @@ -14,7 +14,7 @@ const ( type ExtensionInterface interface { RESTClient() rest.Interface - DatabaseSnapshotNamespacer + SnapshotNamespacer DeletedDatabaseNamespacer ElasticNamespacer PostgresNamespacer @@ -29,8 +29,8 @@ type ExtensionsClient struct { var _ ExtensionInterface = &ExtensionsClient{} -func (a *ExtensionsClient) DatabaseSnapshots(namespace string) DatabaseSnapshotInterface { - return newDatabaseSnapshot(a, namespace) +func (a *ExtensionsClient) Snapshots(namespace string) SnapshotInterface { + return newSnapshot(a, namespace) } func (a *ExtensionsClient) DeletedDatabases(namespace string) DeletedDatabaseInterface { diff --git a/vendor/github.com/k8sdb/apimachinery/client/clientset/snapshot.go b/vendor/github.com/k8sdb/apimachinery/client/clientset/snapshot.go new file mode 100644 index 000000000..389f8917d --- /dev/null +++ b/vendor/github.com/k8sdb/apimachinery/client/clientset/snapshot.go @@ -0,0 +1,107 @@ +package clientset + +import ( + aci "github.com/k8sdb/apimachinery/api" + "k8s.io/kubernetes/pkg/api" + rest "k8s.io/kubernetes/pkg/client/restclient" + "k8s.io/kubernetes/pkg/watch" +) + +type SnapshotNamespacer interface { + Snapshots(namespace string) SnapshotInterface +} + +type SnapshotInterface interface { + List(opts api.ListOptions) (*aci.SnapshotList, error) + Get(name string) (*aci.Snapshot, error) + Create(snapshot *aci.Snapshot) (*aci.Snapshot, error) + Update(snapshot *aci.Snapshot) (*aci.Snapshot, error) + Delete(name string) error + Watch(opts api.ListOptions) (watch.Interface, error) + UpdateStatus(snapshot *aci.Snapshot) (*aci.Snapshot, error) +} + +type SnapshotImpl struct { + r rest.Interface + ns string +} + +func newSnapshot(c *ExtensionsClient, namespace string) *SnapshotImpl { + return &SnapshotImpl{c.restClient, namespace} +} + +func (c *SnapshotImpl) List(opts api.ListOptions) (result *aci.SnapshotList, err error) { + result = &aci.SnapshotList{} + err = c.r.Get(). + Namespace(c.ns). + Resource(aci.ResourceTypeSnapshot). + VersionedParams(&opts, ExtendedCodec). + Do(). + Into(result) + return +} + +func (c *SnapshotImpl) Get(name string) (result *aci.Snapshot, err error) { + result = &aci.Snapshot{} + err = c.r.Get(). + Namespace(c.ns). + Resource(aci.ResourceTypeSnapshot). + Name(name). + Do(). + Into(result) + return +} + +func (c *SnapshotImpl) Create(snapshot *aci.Snapshot) (result *aci.Snapshot, err error) { + result = &aci.Snapshot{} + err = c.r.Post(). + Namespace(c.ns). + Resource(aci.ResourceTypeSnapshot). + Body(snapshot). + Do(). + Into(result) + return +} + +func (c *SnapshotImpl) Update(snapshot *aci.Snapshot) (result *aci.Snapshot, err error) { + result = &aci.Snapshot{} + err = c.r.Put(). + Namespace(c.ns). + Resource(aci.ResourceTypeSnapshot). + Name(snapshot.Name). + Body(snapshot). + Do(). + Into(result) + return +} + +func (c *SnapshotImpl) Delete(name string) (err error) { + return c.r.Delete(). + Namespace(c.ns). + Resource(aci.ResourceTypeSnapshot). + Name(name). + Do(). + Error() +} + +func (c *SnapshotImpl) Watch(opts api.ListOptions) (watch.Interface, error) { + return c.r.Get(). + Prefix("watch"). + Namespace(c.ns). + Resource(aci.ResourceTypeSnapshot). + VersionedParams(&opts, ExtendedCodec). + Watch() +} + +func (c *SnapshotImpl) UpdateStatus(snapshot *aci.Snapshot) (result *aci.Snapshot, err error) { + result = &aci.Snapshot{} + err = c.r.Put(). + Namespace(c.ns). + Resource(aci.ResourceTypeSnapshot). + Name(snapshot.Name). + SubResource("status"). + Body(snapshot). + Do(). + Into(result) + return +} diff --git a/vendor/k8s.io/kubernetes/pkg/version/base.go b/vendor/k8s.io/kubernetes/pkg/version/base.go index 6e95efe56..5e46873f9 100644 --- a/vendor/k8s.io/kubernetes/pkg/version/base.go +++ b/vendor/k8s.io/kubernetes/pkg/version/base.go @@ -39,8 +39,8 @@ var ( // them irrelevant. (Next we'll take it out, which may muck with // scripts consuming the kubectl version output - but most of // these should be looking at gitVersion already anyways.) - gitMajor string = "1" // major version, always numeric - gitMinor string = "5+" // minor version, numeric possibly followed by "+" + gitMajor string = "1" // major version, always numeric + gitMinor string = "5" // minor version, numeric possibly followed by "+" // semantic version, derived by build scripts (see // https://github.com/kubernetes/kubernetes/blob/master/docs/design/versioning.md @@ -51,7 +51,7 @@ var ( // semantic version is a git hash, but the version itself is no // longer the direct output of "git describe", but a slight // translation to be semver compliant. - gitVersion string = "v1.5.8-beta.0+$Format:%h$" + gitVersion string = "v1.5.7+$Format:%h$" gitCommit string = "$Format:%H$" // sha1 from git, output of $(git rev-parse HEAD) gitTreeState string = "not a git tree" // state of git tree, either "clean" or "dirty"