-
Notifications
You must be signed in to change notification settings - Fork 0
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
Added users graceful creation during OpenSearch cluster creation phase #483
Added users graceful creation during OpenSearch cluster creation phase #483
Conversation
} | ||
|
||
if o.Status.State != models.RunningStatus { | ||
return fmt.Errorf("cluster is not is the running state") |
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.
please make it a log info message and add the word "yet" at the end
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.
fixed
err := r.Get(ctx, types.NamespacedName{ | ||
Namespace: o.Namespace, | ||
Name: o.Name, | ||
}, o) | ||
if err != nil { | ||
return 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.
please remove the job if a resource is not found
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.
fixed
for _, ref := range o.Spec.UserRefs { | ||
err = r.createUser(ctx, logger, o, ref) | ||
if err != nil { | ||
return 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.
please add here an error log and event
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.
fixed
1de7821
to
cb13b26
Compare
cb13b26
to
f9d725d
Compare
}, o) | ||
if err != nil { | ||
if k8serrors.IsNotFound(err) { | ||
logger.Info("OpenSearch cluster resource is not found. Closing user creation job...") |
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.
Closing user creation job...
-> Removing/Stopping user creation job...
, wdyt?
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.
fixed
for _, ref := range o.Spec.UserRefs { | ||
err = r.createUser(ctx, logger, o, ref) | ||
if err != nil { | ||
logger.Info("Failed to create user on the cluster", |
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.
Failed to create a user on the cluster
-> Failed to create a user for the cluster
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.
fixed
f9d725d
to
c81bc1e
Compare
c81bc1e
to
244885d
Compare
Implemented graceful creation of users when the OpenSearch cluster is not in the running state. Now it starts a job that checks if a cluster is in the running state and then creates users and removes itself.