Skip to content

Commit e25f34f

Browse files
Haihui.WangRader
authored andcommitted
Add audit log for admin stop deploy and workflow
1 parent 9a40ea0 commit e25f34f

4 files changed

Lines changed: 8 additions & 0 deletions

File tree

common/types/argo_workflow.go

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -183,6 +183,8 @@ type ArgoWorkFlowDeleteReq struct {
183183
ClusterID string `json:"cluster_id"`
184184
TaskID string `json:"task_id"`
185185
Namespace string `json:"namespace"`
186+
IPAddress string `json:"-"`
187+
AuthType string `json:"-"`
186188
}
187189

188190
type ClusterWFReq struct {

common/types/enum/audit_log.go

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7,4 +7,6 @@ const (
77
AuditActionUpdate AuditAction = "update"
88
AuditActionDeletion AuditAction = "deletion"
99
AuditActionSoftDeletion AuditAction = "soft_deletion"
10+
AuditActionStopDeploy AuditAction = "stop_deploy"
11+
AuditActionStopWorkflow AuditAction = "stop_workflow"
1012
)

common/types/model.go

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -374,6 +374,8 @@ type DeployActReq struct {
374374
InstanceName string `json:"instance_name"`
375375
Since string `json:"since,omitempty"`
376376
CommitID string `json:"commit_id"`
377+
IPAddress string `json:"-"`
378+
AuthType string `json:"-"`
377379
}
378380

379381
type DeployUpdateReq struct {

component/cluster.go

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -59,6 +59,7 @@ func NewClusterComponent(config *config.Config) (ClusterComponent, error) {
5959
c.resStore = database.NewSpaceResourceStore()
6060
c.workflowStore = database.NewArgoWorkFlowStore()
6161
c.namespaceStore = database.NewNamespaceStore()
62+
c.auditLog = database.NewAuditLogStore()
6263
return c, nil
6364
}
6465

@@ -72,6 +73,7 @@ type clusterComponentImpl struct {
7273
workflowStore database.ArgoWorkFlowStore
7374
usrClient rpc.UserSvcClient
7475
namespaceStore database.NamespaceStore
76+
auditLog database.AuditLogStore
7577
}
7678

7779
func (c *clusterComponentImpl) Index(ctx context.Context) ([]types.ClusterRes, error) {

0 commit comments

Comments
 (0)