// DecreaseTargetSize decreases the target size of the node group. This function
// doesn't permit to delete any existing node and can be used only to reduce the
// request for new nodes that have not been yet fulfilled. Delta should be negative.
DecreaseTargetSize decreases the target size of the node group. This function
doesn't permit to delete any existing node and can be used only to reduce the
request for new nodes that have not been yet fulfilled. Delta should be negative.
// DecreaseTargetSize decreases the target size of the node group . This function // doesn ' t permit to delete any existing node and can be used only to reduce the // request for new nodes that have not been yet fulfilled . Delta should be negative .
func (mig *GkeMig) DecreaseTargetSize(delta int) error {
	if delta >= 0 {
		return fmt.Errorf("size decrease must be negative")
	}
	size, err := mig.gkeManager.GetMigSize(mig)
	if err != nil {
		return err
	}
	nodes, err := mig.gkeManager.GetMigNodes(mig)
	if err != nil {
		return err
	}
	if int(size)+delta < len(nodes) {
		return fmt.Errorf("attempt to delete existing nodes targetSize:%d delta:%d existingNodes: %d",
			size, delta, len(nodes))
	}
	return mig.gkeManager.SetMigSize(mig, size+int64(delta))
}
func ( mig * GkeMig ) DecreaseTargetSize ( delta int ) error { if delta >= 0 { return fmt . Errorf ( " " ) } size , err := mig . gkeManager . GetMigSize ( mig ) if err != nil { return err } nodes , err := mig . gkeManager . GetMigNodes ( mig ) if err != nil { return err } if int ( size ) + delta < len ( nodes ) { return fmt . Errorf ( " " , size , delta , len ( nodes ) ) } return mig . gkeManager . SetMigSize ( mig , size + int64 ( delta ) ) }
DecreaseTargetSize decreases the target size of the node group.
DecreaseTargetSize decreases the target size of the node group .