mirror of
https://github.com/labring/sealos.git
synced 2026-09-24 15:46:19 +08:00
feat: refactor metering ,support Third-party resource access and idempotent (#2258)
* feat:design metering、podresource、resource api type * metering watch user ns and create * feat:add e2e test about metering watch ns * feat:metering watch extensionResourcePrice * feat:pod-controller create resurce CR logic * feat:metering watch Resource create by resource-Controller and update Metering * feat:metering create AccountBalance and account will watch it and deduction balancde * feat:add infra calculate test * feat:add deploy.yaml and temporary ci * feat:change account ns to sealos-system * fix:update resourceName * feat:add deduction info to account chargelist * fix:payment error * fix:update resource name * Modify inappropriate places in the code by github Comment Signed-off-by: 晓杰 <2561589453@qq.com>
This commit is contained in:
@@ -0,0 +1,29 @@
|
||||
// Copyright © 2022 sealos.
|
||||
//
|
||||
// Licensed under the Apache License, Version 2.0 (the "License");
|
||||
// you may not use this file except in compliance with the License.
|
||||
// You may obtain a copy of the License at
|
||||
//
|
||||
// http://www.apache.org/licenses/LICENSE-2.0
|
||||
//
|
||||
// Unless required by applicable law or agreed to in writing, software
|
||||
// distributed under the License is distributed on an "AS IS" BASIS,
|
||||
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
// See the License for the specific language governing permissions and
|
||||
// limitations under the License.
|
||||
|
||||
package metering
|
||||
|
||||
import (
|
||||
"context"
|
||||
|
||||
"sigs.k8s.io/controller-runtime/pkg/client"
|
||||
)
|
||||
|
||||
type ResourceControllerInterface interface {
|
||||
// CreateOrUpdateExtensionResourcesPrice need to create a ExtensionResourcesPrice to make metering-quota know this resource
|
||||
CreateOrUpdateExtensionResourcesPrice(ctx context.Context, obj client.Object) error
|
||||
|
||||
// UpdateResourceUsed update metering-quota resource used
|
||||
UpdateResourceUsed(ctx context.Context, obj client.Object) error
|
||||
}
|
||||
Reference in New Issue
Block a user