Skip to content
New issue

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

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

Already on GitHub? Sign in to your account

Deleting the API objects related to /operations #4150

Merged
merged 1 commit into from
Feb 5, 2015
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
6 changes: 0 additions & 6 deletions pkg/api/register.go
Original file line number Diff line number Diff line change
Expand Up @@ -35,8 +35,6 @@ func init() {
&NodeList{},
&Node{},
&Status{},
&OperationList{},
&Operation{},
&Endpoints{},
&EndpointsList{},
&Binding{},
Expand All @@ -56,8 +54,6 @@ func init() {
// Legacy names are supported
Scheme.AddKnownTypeWithName("", "Minion", &Node{})
Scheme.AddKnownTypeWithName("", "MinionList", &NodeList{})
Scheme.AddKnownTypeWithName("", "ServerOp", &Operation{})
Scheme.AddKnownTypeWithName("", "ServerOpList", &OperationList{})
}

func (*Pod) IsAnAPIObject() {}
Expand All @@ -73,8 +69,6 @@ func (*Node) IsAnAPIObject() {}
func (*NodeList) IsAnAPIObject() {}
func (*Binding) IsAnAPIObject() {}
func (*Status) IsAnAPIObject() {}
func (*Operation) IsAnAPIObject() {}
func (*OperationList) IsAnAPIObject() {}
func (*Event) IsAnAPIObject() {}
func (*EventList) IsAnAPIObject() {}
func (*ContainerManifest) IsAnAPIObject() {}
Expand Down
14 changes: 0 additions & 14 deletions pkg/api/types.go
Original file line number Diff line number Diff line change
Expand Up @@ -1028,20 +1028,6 @@ const (
CauseTypeFieldValueNotSupported CauseType = "FieldValueNotSupported"
)

// Operation is an operation delivered to API clients.
type Operation struct {
TypeMeta `json:",inline"`
ObjectMeta `json:"metadata,omitempty"`
}

// OperationList is a list of operations, as delivered to API clients.
type OperationList struct {
TypeMeta `json:",inline"`
ListMeta `json:"metadata,omitempty"`

Items []Operation `json:"items"`
}

// ObjectReference contains enough information to let you inspect or modify the referred object.
type ObjectReference struct {
Kind string `json:"kind,omitempty"`
Expand Down
6 changes: 0 additions & 6 deletions pkg/api/v1beta1/register.go
Original file line number Diff line number Diff line change
Expand Up @@ -39,8 +39,6 @@ func init() {
&MinionList{},
&Binding{},
&Status{},
&ServerOp{},
&ServerOpList{},
&Event{},
&EventList{},
&ContainerManifest{},
Expand All @@ -57,8 +55,6 @@ func init() {
// Future names are supported
api.Scheme.AddKnownTypeWithName("v1beta1", "Node", &Minion{})
api.Scheme.AddKnownTypeWithName("v1beta1", "NodeList", &MinionList{})
api.Scheme.AddKnownTypeWithName("v1beta1", "Operation", &ServerOp{})
api.Scheme.AddKnownTypeWithName("v1beta1", "OperationList", &ServerOpList{})
}

func (*Pod) IsAnAPIObject() {}
Expand All @@ -74,8 +70,6 @@ func (*Minion) IsAnAPIObject() {}
func (*MinionList) IsAnAPIObject() {}
func (*Binding) IsAnAPIObject() {}
func (*Status) IsAnAPIObject() {}
func (*ServerOp) IsAnAPIObject() {}
func (*ServerOpList) IsAnAPIObject() {}
func (*Event) IsAnAPIObject() {}
func (*EventList) IsAnAPIObject() {}
func (*ContainerManifest) IsAnAPIObject() {}
Expand Down
11 changes: 0 additions & 11 deletions pkg/api/v1beta1/types.go
Original file line number Diff line number Diff line change
Expand Up @@ -808,17 +808,6 @@ const (
CauseTypeFieldValueNotSupported CauseType = "FieldValueNotSupported"
)

// ServerOp is an operation delivered to API clients.
type ServerOp struct {
TypeMeta `json:",inline"`
}

// ServerOpList is a list of operations, as delivered to API clients.
type ServerOpList struct {
TypeMeta `json:",inline"`
Items []ServerOp `json:"items" description:"list of operations"`
}

// ObjectReference contains enough information to let you inspect or modify the referred object.
type ObjectReference struct {
Kind string `json:"kind,omitempty" description:"kind of the referent"`
Expand Down
6 changes: 0 additions & 6 deletions pkg/api/v1beta2/register.go
Original file line number Diff line number Diff line change
Expand Up @@ -39,8 +39,6 @@ func init() {
&MinionList{},
&Binding{},
&Status{},
&ServerOp{},
&ServerOpList{},
&Event{},
&EventList{},
&ContainerManifest{},
Expand All @@ -57,8 +55,6 @@ func init() {
// Future names are supported
api.Scheme.AddKnownTypeWithName("v1beta2", "Node", &Minion{})
api.Scheme.AddKnownTypeWithName("v1beta2", "NodeList", &MinionList{})
api.Scheme.AddKnownTypeWithName("v1beta2", "Operation", &ServerOp{})
api.Scheme.AddKnownTypeWithName("v1beta2", "OperationList", &ServerOpList{})
}

func (*Pod) IsAnAPIObject() {}
Expand All @@ -74,8 +70,6 @@ func (*Minion) IsAnAPIObject() {}
func (*MinionList) IsAnAPIObject() {}
func (*Binding) IsAnAPIObject() {}
func (*Status) IsAnAPIObject() {}
func (*ServerOp) IsAnAPIObject() {}
func (*ServerOpList) IsAnAPIObject() {}
func (*Event) IsAnAPIObject() {}
func (*EventList) IsAnAPIObject() {}
func (*ContainerManifest) IsAnAPIObject() {}
Expand Down
11 changes: 0 additions & 11 deletions pkg/api/v1beta2/types.go
Original file line number Diff line number Diff line change
Expand Up @@ -782,17 +782,6 @@ const (
CauseTypeFieldValueNotSupported CauseType = "FieldValueNotSupported"
)

// ServerOp is an operation delivered to API clients.
type ServerOp struct {
TypeMeta `json:",inline"`
}

// ServerOpList is a list of operations, as delivered to API clients.
type ServerOpList struct {
TypeMeta `json:",inline"`
Items []ServerOp `json:"items" description:"list of operations"`
}

// ObjectReference contains enough information to let you inspect or modify the referred object.
type ObjectReference struct {
Kind string `json:"kind,omitempty" description:"kind of the referent"`
Expand Down
6 changes: 0 additions & 6 deletions pkg/api/v1beta3/register.go
Original file line number Diff line number Diff line change
Expand Up @@ -43,8 +43,6 @@ func init() {
&NodeList{},
&Binding{},
&Status{},
&Operation{},
&OperationList{},
&Event{},
&EventList{},
&List{},
Expand All @@ -57,8 +55,6 @@ func init() {
// Legacy names are supported
api.Scheme.AddKnownTypeWithName("v1beta3", "Minion", &Node{})
api.Scheme.AddKnownTypeWithName("v1beta3", "MinionList", &NodeList{})
api.Scheme.AddKnownTypeWithName("v1beta3", "ServerOp", &Operation{})
api.Scheme.AddKnownTypeWithName("v1beta3", "ServerOpList", &OperationList{})
}

func (*Pod) IsAnAPIObject() {}
Expand All @@ -78,8 +74,6 @@ func (*Node) IsAnAPIObject() {}
func (*NodeList) IsAnAPIObject() {}
func (*Binding) IsAnAPIObject() {}
func (*Status) IsAnAPIObject() {}
func (*Operation) IsAnAPIObject() {}
func (*OperationList) IsAnAPIObject() {}
func (*Event) IsAnAPIObject() {}
func (*EventList) IsAnAPIObject() {}
func (*List) IsAnAPIObject() {}
Expand Down
16 changes: 0 additions & 16 deletions pkg/api/v1beta3/types.go
Original file line number Diff line number Diff line change
Expand Up @@ -1008,22 +1008,6 @@ const (
CauseTypeFieldValueNotSupported CauseType = "FieldValueNotSupported"
)

// Operation is a request from a client that has not yet been satisfied. The name of an
// Operation is assigned by the server when an operation is started, and can be used by
// clients to retrieve the final result of the operation at a later time.
type Operation struct {
TypeMeta `json:",inline"`
ObjectMeta `json:"metadata"`
}

// OperationList is a list of operations, as delivered to API clients.
type OperationList struct {
TypeMeta `json:",inline"`
ListMeta `json:"metadata,omitempty"`

Items []Operation `json:"items"`
}

// ObjectReference contains enough information to let you inspect or modify the referred object.
type ObjectReference struct {
Kind string `json:"kind,omitempty"`
Expand Down
18 changes: 0 additions & 18 deletions pkg/apiserver/operation.go
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,6 @@ limitations under the License.
package apiserver

import (
"sort"
"strconv"
"sync"
"sync/atomic"
Expand Down Expand Up @@ -79,23 +78,6 @@ func (ops *Operations) insert(op *Operation) {
ops.ops[op.ID] = op
}

// List lists operations for an API client.
func (ops *Operations) List() *api.OperationList {
ops.lock.Lock()
defer ops.lock.Unlock()

ids := []string{}
for id := range ops.ops {
ids = append(ids, id)
}
sort.StringSlice(ids).Sort()
ol := &api.OperationList{}
for _, id := range ids {
ol.Items = append(ol.Items, api.Operation{ObjectMeta: api.ObjectMeta{Name: id}})
}
return ol
}

// Get returns the operation with the given ID, or nil.
func (ops *Operations) Get(id string) *Operation {
ops.lock.Lock()
Expand Down