-
Notifications
You must be signed in to change notification settings - Fork 2k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. Weβll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Community edition dev #3712
Community edition dev #3712
Conversation
π€ Generated by lychee actionSummary
Full action output |
Codecov ReportPatch and project coverage have no change.
Additional details and impacted files@@ Coverage Diff @@
## main #3712 +/- ##
=======================================
Coverage 66.36% 66.36%
=======================================
Files 8 8
Lines 654 654
=======================================
Hits 434 434
Misses 173 173
Partials 47 47 β View full report in Codecov by Sentry. |
c01e91f
to
fdc2e71
Compare
fdc2e71
to
33343d4
Compare
err = presetRootUser(context.Background(), options) | ||
fmt.Println("failed to preset root user, retrying...") | ||
if err != nil { | ||
time.Sleep(time.Minute) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
to long for sleep?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It is ok by testing
|
||
const ( | ||
// pre-defined user name and password | ||
defaultuser = "root" |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
rename to defaultUser
.
|
||
// kubernetes default user cr is admin | ||
// it is corresponding to the root account | ||
defaultK8sUser = "admin" |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
rename to defaultCloudUser
.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
it not a good idear to rename this
defaultDB = "test" | ||
defaultCollection = "user" |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
make this chanageable.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
or just use mongoURI to connect db, do not set this.
passwd := hashPassword(defaultPassword, o.GetEnvOptions().SaltKey) | ||
user := newUser(uuid, defaultuser, defaultuser, passwd, defaultK8sUser) | ||
|
||
collection := client.Database(defaultDB).Collection(defaultCollection) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
fix this.
} | ||
err = client.Ping(ctx, nil) | ||
if err != nil { | ||
fmt.Println("failed to ping mongo", err) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
use log.
1cd7d81
to
65dcc7b
Compare
65dcc7b
to
cc39413
Compare
π€ Generated by Copilot at 348745f
Summary
πππ οΈ
This pull request refactors and updates the license issuer controller to use a new command, a new license key mechanism, and new RBAC permissions. It also adds two new binaries,
preset
andlauncher
, to simplify the MongoDB initialization and the controller execution. It modifies themanager.yaml
,deploy.yaml
,license_controller.go
,init.go
,Makefile
,role.yaml
,configmaps.yaml
,Dockerfile
,const.go
,main.go
files, and the.github/workflows/controllers.yml
workflow.Walkthrough
launcher
binary to runpreset
andmanager
binaries in sequence (link, link, link, link, link)preset
binary to preset the root user for MongoDB (link, link, link, link, link, link)LICENSE_KEY
environment variable (link, link, link)namespaces
,nodes
, andpersistentvolumes
resources for the controller (link, link, link)Launcher
CRD and related logic from the controller (link, link, link)imagePullPolicy: Always
to the manager deployment manifest (link, link)key
andname
fields ofsecretKeyRef
for consistency (link, link)init.go
file (link)license_controller.go
file (link)