mirror of
https://github.com/k3s-io/kubernetes.git
synced 2025-08-05 18:24:07 +00:00
Merge pull request #4150 from nikhiljindal/cleanOperationAPI
Deleting the API objects related to /operations
This commit is contained in:
commit
4e0ef6fda4
@ -35,8 +35,6 @@ func init() {
|
|||||||
&NodeList{},
|
&NodeList{},
|
||||||
&Node{},
|
&Node{},
|
||||||
&Status{},
|
&Status{},
|
||||||
&OperationList{},
|
|
||||||
&Operation{},
|
|
||||||
&Endpoints{},
|
&Endpoints{},
|
||||||
&EndpointsList{},
|
&EndpointsList{},
|
||||||
&Binding{},
|
&Binding{},
|
||||||
@ -56,8 +54,6 @@ func init() {
|
|||||||
// Legacy names are supported
|
// Legacy names are supported
|
||||||
Scheme.AddKnownTypeWithName("", "Minion", &Node{})
|
Scheme.AddKnownTypeWithName("", "Minion", &Node{})
|
||||||
Scheme.AddKnownTypeWithName("", "MinionList", &NodeList{})
|
Scheme.AddKnownTypeWithName("", "MinionList", &NodeList{})
|
||||||
Scheme.AddKnownTypeWithName("", "ServerOp", &Operation{})
|
|
||||||
Scheme.AddKnownTypeWithName("", "ServerOpList", &OperationList{})
|
|
||||||
}
|
}
|
||||||
|
|
||||||
func (*Pod) IsAnAPIObject() {}
|
func (*Pod) IsAnAPIObject() {}
|
||||||
@ -73,8 +69,6 @@ func (*Node) IsAnAPIObject() {}
|
|||||||
func (*NodeList) IsAnAPIObject() {}
|
func (*NodeList) IsAnAPIObject() {}
|
||||||
func (*Binding) IsAnAPIObject() {}
|
func (*Binding) IsAnAPIObject() {}
|
||||||
func (*Status) IsAnAPIObject() {}
|
func (*Status) IsAnAPIObject() {}
|
||||||
func (*Operation) IsAnAPIObject() {}
|
|
||||||
func (*OperationList) IsAnAPIObject() {}
|
|
||||||
func (*Event) IsAnAPIObject() {}
|
func (*Event) IsAnAPIObject() {}
|
||||||
func (*EventList) IsAnAPIObject() {}
|
func (*EventList) IsAnAPIObject() {}
|
||||||
func (*ContainerManifest) IsAnAPIObject() {}
|
func (*ContainerManifest) IsAnAPIObject() {}
|
||||||
|
@ -1028,20 +1028,6 @@ const (
|
|||||||
CauseTypeFieldValueNotSupported CauseType = "FieldValueNotSupported"
|
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.
|
// ObjectReference contains enough information to let you inspect or modify the referred object.
|
||||||
type ObjectReference struct {
|
type ObjectReference struct {
|
||||||
Kind string `json:"kind,omitempty"`
|
Kind string `json:"kind,omitempty"`
|
||||||
|
@ -39,8 +39,6 @@ func init() {
|
|||||||
&MinionList{},
|
&MinionList{},
|
||||||
&Binding{},
|
&Binding{},
|
||||||
&Status{},
|
&Status{},
|
||||||
&ServerOp{},
|
|
||||||
&ServerOpList{},
|
|
||||||
&Event{},
|
&Event{},
|
||||||
&EventList{},
|
&EventList{},
|
||||||
&ContainerManifest{},
|
&ContainerManifest{},
|
||||||
@ -57,8 +55,6 @@ func init() {
|
|||||||
// Future names are supported
|
// Future names are supported
|
||||||
api.Scheme.AddKnownTypeWithName("v1beta1", "Node", &Minion{})
|
api.Scheme.AddKnownTypeWithName("v1beta1", "Node", &Minion{})
|
||||||
api.Scheme.AddKnownTypeWithName("v1beta1", "NodeList", &MinionList{})
|
api.Scheme.AddKnownTypeWithName("v1beta1", "NodeList", &MinionList{})
|
||||||
api.Scheme.AddKnownTypeWithName("v1beta1", "Operation", &ServerOp{})
|
|
||||||
api.Scheme.AddKnownTypeWithName("v1beta1", "OperationList", &ServerOpList{})
|
|
||||||
}
|
}
|
||||||
|
|
||||||
func (*Pod) IsAnAPIObject() {}
|
func (*Pod) IsAnAPIObject() {}
|
||||||
@ -74,8 +70,6 @@ func (*Minion) IsAnAPIObject() {}
|
|||||||
func (*MinionList) IsAnAPIObject() {}
|
func (*MinionList) IsAnAPIObject() {}
|
||||||
func (*Binding) IsAnAPIObject() {}
|
func (*Binding) IsAnAPIObject() {}
|
||||||
func (*Status) IsAnAPIObject() {}
|
func (*Status) IsAnAPIObject() {}
|
||||||
func (*ServerOp) IsAnAPIObject() {}
|
|
||||||
func (*ServerOpList) IsAnAPIObject() {}
|
|
||||||
func (*Event) IsAnAPIObject() {}
|
func (*Event) IsAnAPIObject() {}
|
||||||
func (*EventList) IsAnAPIObject() {}
|
func (*EventList) IsAnAPIObject() {}
|
||||||
func (*ContainerManifest) IsAnAPIObject() {}
|
func (*ContainerManifest) IsAnAPIObject() {}
|
||||||
|
@ -808,17 +808,6 @@ const (
|
|||||||
CauseTypeFieldValueNotSupported CauseType = "FieldValueNotSupported"
|
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.
|
// ObjectReference contains enough information to let you inspect or modify the referred object.
|
||||||
type ObjectReference struct {
|
type ObjectReference struct {
|
||||||
Kind string `json:"kind,omitempty" description:"kind of the referent"`
|
Kind string `json:"kind,omitempty" description:"kind of the referent"`
|
||||||
|
@ -39,8 +39,6 @@ func init() {
|
|||||||
&MinionList{},
|
&MinionList{},
|
||||||
&Binding{},
|
&Binding{},
|
||||||
&Status{},
|
&Status{},
|
||||||
&ServerOp{},
|
|
||||||
&ServerOpList{},
|
|
||||||
&Event{},
|
&Event{},
|
||||||
&EventList{},
|
&EventList{},
|
||||||
&ContainerManifest{},
|
&ContainerManifest{},
|
||||||
@ -57,8 +55,6 @@ func init() {
|
|||||||
// Future names are supported
|
// Future names are supported
|
||||||
api.Scheme.AddKnownTypeWithName("v1beta2", "Node", &Minion{})
|
api.Scheme.AddKnownTypeWithName("v1beta2", "Node", &Minion{})
|
||||||
api.Scheme.AddKnownTypeWithName("v1beta2", "NodeList", &MinionList{})
|
api.Scheme.AddKnownTypeWithName("v1beta2", "NodeList", &MinionList{})
|
||||||
api.Scheme.AddKnownTypeWithName("v1beta2", "Operation", &ServerOp{})
|
|
||||||
api.Scheme.AddKnownTypeWithName("v1beta2", "OperationList", &ServerOpList{})
|
|
||||||
}
|
}
|
||||||
|
|
||||||
func (*Pod) IsAnAPIObject() {}
|
func (*Pod) IsAnAPIObject() {}
|
||||||
@ -74,8 +70,6 @@ func (*Minion) IsAnAPIObject() {}
|
|||||||
func (*MinionList) IsAnAPIObject() {}
|
func (*MinionList) IsAnAPIObject() {}
|
||||||
func (*Binding) IsAnAPIObject() {}
|
func (*Binding) IsAnAPIObject() {}
|
||||||
func (*Status) IsAnAPIObject() {}
|
func (*Status) IsAnAPIObject() {}
|
||||||
func (*ServerOp) IsAnAPIObject() {}
|
|
||||||
func (*ServerOpList) IsAnAPIObject() {}
|
|
||||||
func (*Event) IsAnAPIObject() {}
|
func (*Event) IsAnAPIObject() {}
|
||||||
func (*EventList) IsAnAPIObject() {}
|
func (*EventList) IsAnAPIObject() {}
|
||||||
func (*ContainerManifest) IsAnAPIObject() {}
|
func (*ContainerManifest) IsAnAPIObject() {}
|
||||||
|
@ -782,17 +782,6 @@ const (
|
|||||||
CauseTypeFieldValueNotSupported CauseType = "FieldValueNotSupported"
|
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.
|
// ObjectReference contains enough information to let you inspect or modify the referred object.
|
||||||
type ObjectReference struct {
|
type ObjectReference struct {
|
||||||
Kind string `json:"kind,omitempty" description:"kind of the referent"`
|
Kind string `json:"kind,omitempty" description:"kind of the referent"`
|
||||||
|
@ -43,8 +43,6 @@ func init() {
|
|||||||
&NodeList{},
|
&NodeList{},
|
||||||
&Binding{},
|
&Binding{},
|
||||||
&Status{},
|
&Status{},
|
||||||
&Operation{},
|
|
||||||
&OperationList{},
|
|
||||||
&Event{},
|
&Event{},
|
||||||
&EventList{},
|
&EventList{},
|
||||||
&List{},
|
&List{},
|
||||||
@ -57,8 +55,6 @@ func init() {
|
|||||||
// Legacy names are supported
|
// Legacy names are supported
|
||||||
api.Scheme.AddKnownTypeWithName("v1beta3", "Minion", &Node{})
|
api.Scheme.AddKnownTypeWithName("v1beta3", "Minion", &Node{})
|
||||||
api.Scheme.AddKnownTypeWithName("v1beta3", "MinionList", &NodeList{})
|
api.Scheme.AddKnownTypeWithName("v1beta3", "MinionList", &NodeList{})
|
||||||
api.Scheme.AddKnownTypeWithName("v1beta3", "ServerOp", &Operation{})
|
|
||||||
api.Scheme.AddKnownTypeWithName("v1beta3", "ServerOpList", &OperationList{})
|
|
||||||
}
|
}
|
||||||
|
|
||||||
func (*Pod) IsAnAPIObject() {}
|
func (*Pod) IsAnAPIObject() {}
|
||||||
@ -78,8 +74,6 @@ func (*Node) IsAnAPIObject() {}
|
|||||||
func (*NodeList) IsAnAPIObject() {}
|
func (*NodeList) IsAnAPIObject() {}
|
||||||
func (*Binding) IsAnAPIObject() {}
|
func (*Binding) IsAnAPIObject() {}
|
||||||
func (*Status) IsAnAPIObject() {}
|
func (*Status) IsAnAPIObject() {}
|
||||||
func (*Operation) IsAnAPIObject() {}
|
|
||||||
func (*OperationList) IsAnAPIObject() {}
|
|
||||||
func (*Event) IsAnAPIObject() {}
|
func (*Event) IsAnAPIObject() {}
|
||||||
func (*EventList) IsAnAPIObject() {}
|
func (*EventList) IsAnAPIObject() {}
|
||||||
func (*List) IsAnAPIObject() {}
|
func (*List) IsAnAPIObject() {}
|
||||||
|
@ -1008,22 +1008,6 @@ const (
|
|||||||
CauseTypeFieldValueNotSupported CauseType = "FieldValueNotSupported"
|
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.
|
// ObjectReference contains enough information to let you inspect or modify the referred object.
|
||||||
type ObjectReference struct {
|
type ObjectReference struct {
|
||||||
Kind string `json:"kind,omitempty"`
|
Kind string `json:"kind,omitempty"`
|
||||||
|
@ -17,7 +17,6 @@ limitations under the License.
|
|||||||
package apiserver
|
package apiserver
|
||||||
|
|
||||||
import (
|
import (
|
||||||
"sort"
|
|
||||||
"strconv"
|
"strconv"
|
||||||
"sync"
|
"sync"
|
||||||
"sync/atomic"
|
"sync/atomic"
|
||||||
@ -79,23 +78,6 @@ func (ops *Operations) insert(op *Operation) {
|
|||||||
ops.ops[op.ID] = op
|
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.
|
// Get returns the operation with the given ID, or nil.
|
||||||
func (ops *Operations) Get(id string) *Operation {
|
func (ops *Operations) Get(id string) *Operation {
|
||||||
ops.lock.Lock()
|
ops.lock.Lock()
|
||||||
|
Loading…
Reference in New Issue
Block a user