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

Add deprecate description #127

Merged
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.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
234 changes: 119 additions & 115 deletions docs/api.md

Large diffs are not rendered by default.

4 changes: 2 additions & 2 deletions docs/how-it-works.md
Original file line number Diff line number Diff line change
Expand Up @@ -25,11 +25,11 @@ Users can create resources below.
- Storage Classes
- Priority Classes

When users request to create resources, the simulator server will create it with requesting kube-apiserver.
When users request to create resources, the simulator's frontend will create it with requesting kube-apiserver.

## 2. the scheduler schedules a new pod.

When a new pod is created through kube-apiserver by the simulator server, the scheduler will notice that the pod has been created and start scheduling.
When a new pod is created through kube-apiserver, the scheduler will notice that the pod has been created and start scheduling.

## 3. the results of score/filter plugins are recorded.

Expand Down
15 changes: 15 additions & 0 deletions server/handler/node.go
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,9 @@ import (
)

// NodeHandler is handler for manage nodes.
//
// Deprecated: NodeHandler exists only for backward compatibility.
// It is not maintained now and will be deleted soon.
type NodeHandler struct {
service di.NodeService
}
Expand All @@ -22,6 +25,9 @@ func NewNodeHandler(s di.NodeService) *NodeHandler {
}

// ApplyNode handles the endpoint for applying node.
//
// Deprecated: ApplyNode exists only for backward compatibility.
// It is not maintained now and will be deleted soon.
func (h *NodeHandler) ApplyNode(c echo.Context) error {
ctx := c.Request().Context()

Expand All @@ -41,6 +47,9 @@ func (h *NodeHandler) ApplyNode(c echo.Context) error {
}

// GetNode handles the endpoint for getting node.
//
// Deprecated: GetNode exists only for backward compatibility.
// It is not maintained now and will be deleted soon.
func (h *NodeHandler) GetNode(c echo.Context) error {
ctx := c.Request().Context()

Expand All @@ -59,6 +68,9 @@ func (h *NodeHandler) GetNode(c echo.Context) error {
}

// ListNode handles the endpoint for listing node.
//
// Deprecated: ListNode exists only for backward compatibility.
// It is not maintained now and will be deleted soon.
func (h *NodeHandler) ListNode(c echo.Context) error {
ctx := c.Request().Context()

Expand All @@ -72,6 +84,9 @@ func (h *NodeHandler) ListNode(c echo.Context) error {
}

// DeleteNode handles the endpoint for deleting node.
//
// Deprecated: DeleteNode exists only for backward compatibility.
// It is not maintained now and will be deleted soon.
func (h *NodeHandler) DeleteNode(c echo.Context) error {
ctx := c.Request().Context()

Expand Down
15 changes: 15 additions & 0 deletions server/handler/persistentvolume.go
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,9 @@ import (
)

// PersistentVolumeHandler is handler for manage persistentVolume.
//
// Deprecated: PersistentVolumeHandler exists only for backward compatibility.
// It is not maintained now and will be deleted soon.
type PersistentVolumeHandler struct {
service di.PersistentVolumeService
}
Expand All @@ -22,6 +25,9 @@ func NewPersistentVolumeHandler(s di.PersistentVolumeService) *PersistentVolumeH
}

// ApplyPersistentVolume handles the endpoint for applying persistentVolume.
//
// Deprecated: ApplyPersistentVolume exists only for backward compatibility.
// It is not maintained now and will be deleted soon.
func (h *PersistentVolumeHandler) ApplyPersistentVolume(c echo.Context) error {
ctx := c.Request().Context()

Expand All @@ -41,6 +47,9 @@ func (h *PersistentVolumeHandler) ApplyPersistentVolume(c echo.Context) error {
}

// GetPersistentVolume handles the endpoint for getting persistentVolume.
//
// Deprecated: GetPersistentVolume exists only for backward compatibility.
// It is not maintained now and will be deleted soon.
func (h *PersistentVolumeHandler) GetPersistentVolume(c echo.Context) error {
ctx := c.Request().Context()

Expand All @@ -59,6 +68,9 @@ func (h *PersistentVolumeHandler) GetPersistentVolume(c echo.Context) error {
}

// ListPersistentVolume handles the endpoint for listing persistentVolume.
//
// Deprecated: ListPersistentVolume exists only for backward compatibility.
// It is not maintained now and will be deleted soon.
func (h *PersistentVolumeHandler) ListPersistentVolume(c echo.Context) error {
ctx := c.Request().Context()

Expand All @@ -72,6 +84,9 @@ func (h *PersistentVolumeHandler) ListPersistentVolume(c echo.Context) error {
}

// DeletePersistentVolume handles the endpoint for deleting persistentVolume.
//
// Deprecated: DeletePersistentVolume exists only for backward compatibility.
// It is not maintained now and will be deleted soon.
func (h *PersistentVolumeHandler) DeletePersistentVolume(c echo.Context) error {
ctx := c.Request().Context()

Expand Down
15 changes: 15 additions & 0 deletions server/handler/persistentvolumeclaim.go
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,9 @@ import (
)

// PersistentVolumeClaimHandler is handler for manage persistentVolumeClaim.
//
// Deprecated: PersistentVolumeClaimHandler exists only for backward compatibility.
// It is not maintained now and will be deleted soon.
type PersistentVolumeClaimHandler struct {
service di.PersistentVolumeClaimService
}
Expand All @@ -22,6 +25,9 @@ func NewPersistentVolumeClaimHandler(s di.PersistentVolumeClaimService) *Persist
}

// ApplyPersistentVolumeClaim handles the endpoint for applying persistentVolumeClaim.
//
// Deprecated: ApplyPersistentVolumeClaim exists only for backward compatibility.
// It is not maintained now and will be deleted soon.
func (h *PersistentVolumeClaimHandler) ApplyPersistentVolumeClaim(c echo.Context) error {
ctx := c.Request().Context()

Expand All @@ -41,6 +47,9 @@ func (h *PersistentVolumeClaimHandler) ApplyPersistentVolumeClaim(c echo.Context
}

// GetPersistentVolumeClaim handles the endpoint for getting persistentVolumeClaim.
//
// Deprecated: GetPersistentVolumeClaim exists only for backward compatibility.
// It is not maintained now and will be deleted soon.
func (h *PersistentVolumeClaimHandler) GetPersistentVolumeClaim(c echo.Context) error {
ctx := c.Request().Context()

Expand All @@ -59,6 +68,9 @@ func (h *PersistentVolumeClaimHandler) GetPersistentVolumeClaim(c echo.Context)
}

// ListPersistentVolumeClaim handles the endpoint for listing persistentVolumeClaim.
//
// Deprecated: ListPersistentVolumeClaim exists only for backward compatibility.
// It is not maintained now and will be deleted soon.
func (h *PersistentVolumeClaimHandler) ListPersistentVolumeClaim(c echo.Context) error {
ctx := c.Request().Context()

Expand All @@ -72,6 +84,9 @@ func (h *PersistentVolumeClaimHandler) ListPersistentVolumeClaim(c echo.Context)
}

// DeletePersistentVolumeClaim handles the endpoint for deleting persistentVolumeClaim.
//
// Deprecated: DeletePersistentVolumeClaim exists only for backward compatibility.
// It is not maintained now and will be deleted soon.
func (h *PersistentVolumeClaimHandler) DeletePersistentVolumeClaim(c echo.Context) error {
ctx := c.Request().Context()

Expand Down
15 changes: 15 additions & 0 deletions server/handler/pod.go
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,9 @@ import (
)

// PodHandler is handler for manage pod.
//
// Deprecated: PodHandler exists only for backward compatibility.
// It is not maintained now and will be deleted soon.
type PodHandler struct {
service di.PodService
}
Expand All @@ -22,6 +25,9 @@ func NewPodHandler(s di.PodService) *PodHandler {
}

// ApplyPod handles the endpoint for applying pod.
//
// Deprecated: ApplyPod exists only for backward compatibility.
// It is not maintained now and will be deleted soon.
func (h *PodHandler) ApplyPod(c echo.Context) error {
ctx := c.Request().Context()

Expand All @@ -41,6 +47,9 @@ func (h *PodHandler) ApplyPod(c echo.Context) error {
}

// GetPod handles the endpoint for getting pod.
//
// Deprecated: GetPod exists only for backward compatibility.
// It is not maintained now and will be deleted soon.
func (h *PodHandler) GetPod(c echo.Context) error {
ctx := c.Request().Context()

Expand All @@ -59,6 +68,9 @@ func (h *PodHandler) GetPod(c echo.Context) error {
}

// ListPod handles the endpoint for listing pod.
//
// Deprecated: ListPod exists only for backward compatibility.
// It is not maintained now and will be deleted soon.
func (h *PodHandler) ListPod(c echo.Context) error {
ctx := c.Request().Context()

Expand All @@ -72,6 +84,9 @@ func (h *PodHandler) ListPod(c echo.Context) error {
}

// DeletePod handles the endpoint for deleting pod.
//
// Deprecated: DeletePod exists only for backward compatibility.
// It is not maintained now and will be deleted soon.
func (h *PodHandler) DeletePod(c echo.Context) error {
ctx := c.Request().Context()

Expand Down
15 changes: 15 additions & 0 deletions server/handler/priorityclass.go
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,9 @@ import (
)

// PriorityClassHandler is a handler for managing priorityClass.
//
// Deprecated: PriorityClassHandler exists only for backward compatibility.
// It is not maintained now and will be deleted soon.
type PriorityClassHandler struct {
service di.PriorityClassService
}
Expand All @@ -22,6 +25,9 @@ func NewPriorityClassHandler(s di.PriorityClassService) *PriorityClassHandler {
}

// ApplyPriorityClass handles the endpoint for applying priorityClass.
//
// Deprecated: ApplyPriorityClass exists only for backward compatibility.
// It is not maintained now and will be deleted soon.
func (h *PriorityClassHandler) ApplyPriorityClass(c echo.Context) error {
ctx := c.Request().Context()

Expand All @@ -41,6 +47,9 @@ func (h *PriorityClassHandler) ApplyPriorityClass(c echo.Context) error {
}

// GetPriorityClass handles the endpoint for getting priorityClass.
//
// Deprecated: GetPriorityClass exists only for backward compatibility.
// It is not maintained now and will be deleted soon.
func (h *PriorityClassHandler) GetPriorityClass(c echo.Context) error {
ctx := c.Request().Context()

Expand All @@ -59,6 +68,9 @@ func (h *PriorityClassHandler) GetPriorityClass(c echo.Context) error {
}

// ListPriorityClass handles the endpoint for listing priorityClass.
//
// Deprecated: ListPriorityClass exists only for backward compatibility.
// It is not maintained now and will be deleted soon.
func (h *PriorityClassHandler) ListPriorityClass(c echo.Context) error {
ctx := c.Request().Context()

Expand All @@ -72,6 +84,9 @@ func (h *PriorityClassHandler) ListPriorityClass(c echo.Context) error {
}

// DeletePriorityClass handles the endpoint for deleting priorityClass.
//
// Deprecated: DeletePriorityClass exists only for backward compatibility.
// It is not maintained now and will be deleted soon.
func (h *PriorityClassHandler) DeletePriorityClass(c echo.Context) error {
ctx := c.Request().Context()

Expand Down
15 changes: 15 additions & 0 deletions server/handler/storageclass.go
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,9 @@ import (
)

// StorageClassHandler is handler for manage storageClass.
//
// Deprecated: StorageClassHandler exists only for backward compatibility.
// It is not maintained now and will be deleted soon.
type StorageClassHandler struct {
service di.StorageClassService
}
Expand All @@ -22,6 +25,9 @@ func NewStorageClassHandler(s di.StorageClassService) *StorageClassHandler {
}

// ApplyStorageClass handles the endpoint for applying storageClass.
//
// Deprecated: ApplyStorageClass exists only for backward compatibility.
// It is not maintained now and will be deleted soon.
func (h *StorageClassHandler) ApplyStorageClass(c echo.Context) error {
ctx := c.Request().Context()

Expand All @@ -41,6 +47,9 @@ func (h *StorageClassHandler) ApplyStorageClass(c echo.Context) error {
}

// GetStorageClass handles the endpoint for getting storageClass.
//
// Deprecated: GetStorageClass exists only for backward compatibility.
// It is not maintained now and will be deleted soon.
func (h *StorageClassHandler) GetStorageClass(c echo.Context) error {
ctx := c.Request().Context()

Expand All @@ -59,6 +68,9 @@ func (h *StorageClassHandler) GetStorageClass(c echo.Context) error {
}

// ListStorageClass handles the endpoint for listing storageClass.
//
// Deprecated: ListStorageClass exists only for backward compatibility.
// It is not maintained now and will be deleted soon.
func (h *StorageClassHandler) ListStorageClass(c echo.Context) error {
ctx := c.Request().Context()

Expand All @@ -72,6 +84,9 @@ func (h *StorageClassHandler) ListStorageClass(c echo.Context) error {
}

// DeleteStorageClass handles the endpoint for deleting storageClass.
//
// Deprecated: DeleteStorageClass exists only for backward compatibility.
// It is not maintained now and will be deleted soon.
func (h *StorageClassHandler) DeleteStorageClass(c echo.Context) error {
ctx := c.Request().Context()

Expand Down
24 changes: 24 additions & 0 deletions server/server.go
Original file line number Diff line number Diff line change
Expand Up @@ -51,34 +51,58 @@ func NewSimulatorServer(cfg *config.Config, dic *di.Container) *SimulatorServer

v1.PUT("/reset", resetHandler.Reset)

//nolint: staticcheck // we need to use deprecated APIs for now.
v1.GET("/nodes", nodeHandler.ListNode)
//nolint: staticcheck // we need to use deprecated APIs for now.
v1.POST("/nodes", nodeHandler.ApplyNode)
//nolint: staticcheck // we need to use deprecated APIs for now.
v1.GET("/nodes/:name", nodeHandler.GetNode)
//nolint: staticcheck // we need to use deprecated APIs for now.
v1.DELETE("/nodes/:name", nodeHandler.DeleteNode)

//nolint: staticcheck // we need to use deprecated APIs for now.
v1.GET("/pods", podHandler.ListPod)
//nolint: staticcheck // we need to use deprecated APIs for now.
v1.POST("/pods", podHandler.ApplyPod)
//nolint: staticcheck // we need to use deprecated APIs for now.
v1.GET("/pods/:name", podHandler.GetPod)
//nolint: staticcheck // we need to use deprecated APIs for now.
v1.DELETE("/pods/:name", podHandler.DeletePod)

//nolint: staticcheck // we need to use deprecated APIs for now.
v1.GET("/persistentvolumes", pvHandler.ListPersistentVolume)
//nolint: staticcheck // we need to use deprecated APIs for now.
v1.POST("/persistentvolumes", pvHandler.ApplyPersistentVolume)
//nolint: staticcheck // we need to use deprecated APIs for now.
v1.GET("/persistentvolumes/:name", pvHandler.GetPersistentVolume)
//nolint: staticcheck // we need to use deprecated APIs for now.
v1.DELETE("/persistentvolumes/:name", pvHandler.DeletePersistentVolume)

//nolint: staticcheck // we need to use deprecated APIs for now.
v1.GET("/persistentvolumeclaims", pvcHandler.ListPersistentVolumeClaim)
//nolint: staticcheck // we need to use deprecated APIs for now.
v1.POST("/persistentvolumeclaims", pvcHandler.ApplyPersistentVolumeClaim)
//nolint: staticcheck // we need to use deprecated APIs for now.
v1.GET("/persistentvolumeclaims/:name", pvcHandler.GetPersistentVolumeClaim)
//nolint: staticcheck // we need to use deprecated APIs for now.
v1.DELETE("/persistentvolumeclaims/:name", pvcHandler.DeletePersistentVolumeClaim)

//nolint: staticcheck // we need to use deprecated APIs for now.
v1.GET("/storageclasses", storageClassHandler.ListStorageClass)
//nolint: staticcheck // we need to use deprecated APIs for now.
v1.POST("/storageclasses", storageClassHandler.ApplyStorageClass)
//nolint: staticcheck // we need to use deprecated APIs for now.
v1.GET("/storageclasses/:name", storageClassHandler.GetStorageClass)
//nolint: staticcheck // we need to use deprecated APIs for now.
v1.DELETE("/storageclasses/:name", storageClassHandler.DeleteStorageClass)

//nolint: staticcheck // we need to use deprecated APIs for now.
v1.GET("/priorityclasses", priorityClassHandler.ListPriorityClass)
//nolint: staticcheck // we need to use deprecated APIs for now.
v1.POST("/priorityclasses", priorityClassHandler.ApplyPriorityClass)
//nolint: staticcheck // we need to use deprecated APIs for now.
v1.GET("/priorityclasses/:name", priorityClassHandler.GetPriorityClass)
//nolint: staticcheck // we need to use deprecated APIs for now.
v1.DELETE("/priorityclasses/:name", priorityClassHandler.DeletePriorityClass)

v1.GET("/export", exportHandler.Export)
Expand Down