mirror of
https://github.com/yunionio/cloudpods.git
synced 2026-10-29 17:58:36 +08:00
climc: add k8s fed resource sync action
This commit is contained in:
@@ -28,6 +28,7 @@ func init() {
|
||||
AttachCluster(new(options.FedResourceJointClusterAttachOptions)).
|
||||
DetachCluster(new(options.FedResourceJointClusterDetachOptions)).
|
||||
SyncCluster(new(options.FedResourceJointClusterDetachOptions)).
|
||||
Sync(new(options.FedResourceIdOptions)).
|
||||
ShowEvent()
|
||||
|
||||
cmd.ClassShow(new(options.FedApiResourecesOptions))
|
||||
|
||||
@@ -27,5 +27,7 @@ func init() {
|
||||
Delete(new(options.IdentOptions)).
|
||||
AttachCluster(new(options.FedResourceJointClusterAttachOptions)).
|
||||
DetachCluster(new(options.FedResourceJointClusterDetachOptions)).
|
||||
SyncCluster(new(options.FedResourceJointClusterDetachOptions))
|
||||
SyncCluster(new(options.FedResourceJointClusterDetachOptions)).
|
||||
Sync(new(options.FedResourceIdOptions)).
|
||||
ShowEvent()
|
||||
}
|
||||
|
||||
@@ -64,3 +64,8 @@ func (c *fedResourceCmd) SyncCluster(args shell.IPerformOpt) *fedResourceCmd {
|
||||
c.K8sResourceCmd.Perform("sync-cluster", args)
|
||||
return c
|
||||
}
|
||||
|
||||
func (c *fedResourceCmd) Sync(args shell.IPerformOpt) *fedResourceCmd {
|
||||
c.K8sResourceCmd.Perform("sync", args)
|
||||
return c
|
||||
}
|
||||
|
||||
@@ -29,5 +29,6 @@ func init() {
|
||||
AttachCluster(new(options.FedResourceJointClusterAttachOptions)).
|
||||
DetachCluster(new(options.FedResourceJointClusterDetachOptions)).
|
||||
SyncCluster(new(options.FedResourceJointClusterDetachOptions)).
|
||||
Sync(new(options.IdentOptions)).
|
||||
ShowEvent()
|
||||
}
|
||||
|
||||
@@ -28,6 +28,7 @@ func init() {
|
||||
AttachCluster(new(options.FedResourceJointClusterAttachOptions)).
|
||||
DetachCluster(new(options.FedResourceJointClusterDetachOptions)).
|
||||
SyncCluster(new(options.FedResourceJointClusterDetachOptions)).
|
||||
Sync(new(options.IdentOptions)).
|
||||
ShowEvent()
|
||||
|
||||
cmd.ClassShow(new(options.FedApiResourecesOptions))
|
||||
|
||||
@@ -29,5 +29,6 @@ func init() {
|
||||
AttachCluster(new(options.FedResourceJointClusterAttachOptions)).
|
||||
DetachCluster(new(options.FedResourceJointClusterDetachOptions)).
|
||||
SyncCluster(new(options.FedResourceJointClusterDetachOptions)).
|
||||
Sync(new(options.IdentOptions)).
|
||||
ShowEvent()
|
||||
}
|
||||
|
||||
@@ -15,17 +15,12 @@
|
||||
package k8s
|
||||
|
||||
import (
|
||||
//"yunion.io/x/onecloud/pkg/mcclient"
|
||||
"yunion.io/x/onecloud/pkg/mcclient/modules/k8s"
|
||||
//o "yunion.io/x/onecloud/pkg/mcclient/options/k8s"
|
||||
)
|
||||
|
||||
func initRbac() {
|
||||
//cmdRole := initK8sNamespaceResource("rbacrole", k8s.RbacRoles)
|
||||
initK8sNamespaceResource("rbac-role", k8s.RbacRoles)
|
||||
initK8sNamespaceResource("rbac-rolebinding", k8s.RbacRoleBindings)
|
||||
initK8sClusterResource("rbac-clusterrole", k8s.RbacClusterRoles)
|
||||
initK8sClusterResource("rbac-clusterrolebinding", k8s.RbacClusterRoleBindings)
|
||||
initK8sNamespaceResource("serviceaccount", k8s.ServiceAccounts)
|
||||
//cmdRoleN := cmdRole.CommandNameFactory
|
||||
}
|
||||
|
||||
@@ -22,6 +22,7 @@ import (
|
||||
func init() {
|
||||
cmd := NewK8sResourceCmd(k8s.RbacRoles).SetKeyword("role")
|
||||
cmd.Create(new(options.RoleCreateOpt))
|
||||
cmd.Update(new(options.RoleUpdateOpt))
|
||||
cmd.List(new(options.NamespaceResourceListOptions))
|
||||
cmd.Show(new(options.NamespaceResourceGetOptions))
|
||||
cmd.BatchDelete(new(options.ResourceIdsOptions))
|
||||
|
||||
Reference in New Issue
Block a user