mirror of
https://github.com/k3s-io/kubernetes.git
synced 2025-09-22 18:37:15 +00:00
kubectl: API changes to support --subresource in kubectl
Signed-off-by: Madhav Jivrajani <madhav.jiv@gmail.com> Co-authored-by: Nikhita Raghunath <nikitaraghunath@gmail.com> Co-authored-by: Yuvaraj Kakaraparthi <kakaraparthy@vmware.com>
This commit is contained in:
committed by
Madhav Jivrajani
parent
08bf54678e
commit
801c39b478
@@ -111,3 +111,7 @@ func (r *StatusREST) Update(ctx context.Context, name string, objInfo rest.Updat
|
||||
func (r *StatusREST) GetResetFields() map[fieldpath.APIVersion]*fieldpath.Set {
|
||||
return r.store.GetResetFields()
|
||||
}
|
||||
|
||||
func (r *StatusREST) ConvertToTable(ctx context.Context, object runtime.Object, tableOptions runtime.Object) (*metav1.Table, error) {
|
||||
return r.store.ConvertToTable(ctx, object, tableOptions)
|
||||
}
|
||||
|
@@ -164,6 +164,10 @@ func (r *StatusREST) GetResetFields() map[fieldpath.APIVersion]*fieldpath.Set {
|
||||
return r.store.GetResetFields()
|
||||
}
|
||||
|
||||
func (r *StatusREST) ConvertToTable(ctx context.Context, object runtime.Object, tableOptions runtime.Object) (*metav1.Table, error) {
|
||||
return r.store.ConvertToTable(ctx, object, tableOptions)
|
||||
}
|
||||
|
||||
// RollbackREST implements the REST endpoint for initiating the rollback of a deployment
|
||||
type RollbackREST struct {
|
||||
store *genericregistry.Store
|
||||
@@ -322,6 +326,10 @@ func (r *ScaleREST) Update(ctx context.Context, name string, objInfo rest.Update
|
||||
return newScale, false, nil
|
||||
}
|
||||
|
||||
func (r *ScaleREST) ConvertToTable(ctx context.Context, object runtime.Object, tableOptions runtime.Object) (*metav1.Table, error) {
|
||||
return r.store.ConvertToTable(ctx, object, tableOptions)
|
||||
}
|
||||
|
||||
func toScaleCreateValidation(f rest.ValidateObjectFunc) rest.ValidateObjectFunc {
|
||||
return func(ctx context.Context, obj runtime.Object) error {
|
||||
scale, err := scaleFromDeployment(obj.(*apps.Deployment))
|
||||
|
@@ -160,6 +160,10 @@ func (r *StatusREST) GetResetFields() map[fieldpath.APIVersion]*fieldpath.Set {
|
||||
return r.store.GetResetFields()
|
||||
}
|
||||
|
||||
func (r *StatusREST) ConvertToTable(ctx context.Context, object runtime.Object, tableOptions runtime.Object) (*metav1.Table, error) {
|
||||
return r.store.ConvertToTable(ctx, object, tableOptions)
|
||||
}
|
||||
|
||||
// ScaleREST implements a Scale for ReplicaSet.
|
||||
type ScaleREST struct {
|
||||
store *genericregistry.Store
|
||||
@@ -224,6 +228,10 @@ func (r *ScaleREST) Update(ctx context.Context, name string, objInfo rest.Update
|
||||
return newScale, false, err
|
||||
}
|
||||
|
||||
func (r *ScaleREST) ConvertToTable(ctx context.Context, object runtime.Object, tableOptions runtime.Object) (*metav1.Table, error) {
|
||||
return r.store.ConvertToTable(ctx, object, tableOptions)
|
||||
}
|
||||
|
||||
func toScaleCreateValidation(f rest.ValidateObjectFunc) rest.ValidateObjectFunc {
|
||||
return func(ctx context.Context, obj runtime.Object) error {
|
||||
scale, err := scaleFromReplicaSet(obj.(*apps.ReplicaSet))
|
||||
|
@@ -141,6 +141,10 @@ func (r *StatusREST) GetResetFields() map[fieldpath.APIVersion]*fieldpath.Set {
|
||||
return r.store.GetResetFields()
|
||||
}
|
||||
|
||||
func (r *StatusREST) ConvertToTable(ctx context.Context, object runtime.Object, tableOptions runtime.Object) (*metav1.Table, error) {
|
||||
return r.store.ConvertToTable(ctx, object, tableOptions)
|
||||
}
|
||||
|
||||
// Implement ShortNamesProvider
|
||||
var _ rest.ShortNamesProvider = &REST{}
|
||||
|
||||
@@ -211,6 +215,10 @@ func (r *ScaleREST) Update(ctx context.Context, name string, objInfo rest.Update
|
||||
return newScale, false, err
|
||||
}
|
||||
|
||||
func (r *ScaleREST) ConvertToTable(ctx context.Context, object runtime.Object, tableOptions runtime.Object) (*metav1.Table, error) {
|
||||
return r.store.ConvertToTable(ctx, object, tableOptions)
|
||||
}
|
||||
|
||||
func toScaleCreateValidation(f rest.ValidateObjectFunc) rest.ValidateObjectFunc {
|
||||
return func(ctx context.Context, obj runtime.Object) error {
|
||||
scale, err := scaleFromStatefulSet(obj.(*apps.StatefulSet))
|
||||
|
Reference in New Issue
Block a user