Skip to content

Commit

Permalink
fix(core): fix oss cr name of app (#455)
Browse files Browse the repository at this point in the history
Signed-off-by: maslow <wangfugen@126.com>
  • Loading branch information
maslow authored Nov 30, 2022
1 parent 12b1587 commit 5c766d7
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 3 deletions.
2 changes: 1 addition & 1 deletion core/controllers/application/resourcer/database.go
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@ func GetDatabase(ctx context.Context, c client.Client, app *appv1.Application) (

// Get the database
var db v1.Database
err := c.Get(ctx, client.ObjectKey{Namespace: app.Namespace, Name: "mongodb"}, &db)
err := c.Get(ctx, client.ObjectKey{Namespace: app.Namespace, Name: app.Spec.AppId}, &db)
return &db, err
}

Expand Down
4 changes: 2 additions & 2 deletions core/controllers/application/resourcer/oss.go
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ func CreateObjectStorageUser(ctx context.Context, c client.Client, schema *runti
// Create a new oss user
var oss v1.User
oss.Namespace = app.Namespace
oss.Name = "oss"
oss.Name = app.Spec.AppId
oss.Labels = map[string]string{
"laf.dev/appid": app.Spec.AppId,
}
Expand All @@ -37,6 +37,6 @@ func CreateObjectStorageUser(ctx context.Context, c client.Client, schema *runti
func GetObjectStorageUser(ctx context.Context, c client.Client, app *appv1.Application) (*v1.User, error) {
// Get the oss user
var oss v1.User
err := c.Get(ctx, client.ObjectKey{Namespace: app.Namespace, Name: "oss"}, &oss)
err := c.Get(ctx, client.ObjectKey{Namespace: app.Namespace, Name: app.Spec.AppId}, &oss)
return &oss, err
}

0 comments on commit 5c766d7

Please sign in to comment.