-
Notifications
You must be signed in to change notification settings - Fork 1.8k
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
Improve operator logs by adding the possibility to get the full Ansible logs on it #2589
Improve operator logs by adding the possibility to get the full Ansible logs on it #2589
Conversation
pkg/ansible/runner/fake/runner.go
Outdated
@@ -28,6 +28,7 @@ type Runner struct { | |||
Finalizer string | |||
ReconcilePeriod time.Duration | |||
ManageStatus bool | |||
AnsibleDebugLogs bool |
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.
I don't think I'd add this argument to the watches.yaml, I'd make it a cli flag/environment variable, since I assume this is something users would want to set after their operator is deployed in the cluster rather than at container build time
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 sense. I will change it.
…nsible based-operators configurable by environment variable
pkg/ansible/run.go
Outdated
val := false | ||
if envVal, ok := os.LookupEnv(envVar); ok { | ||
if i, err := strconv.ParseBool(envVal); err != nil { | ||
log.Info("Could not parse environment variable as an integer; using default value", |
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.
s/integer/bool/
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.
Ops. Tks for the good catch. Solved.
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.
/lgtm
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.
/lgtm
Description of the change:
Motivation for the change:
Allow users to have the same full information that can be obtained until the version 0.15.x with the Ansible sidecar container in the operator logs.
Note that we deprecated the inotify-tools and we will no longer scaffold the sidecar container. See #2586. Also, we have been improving the operator logs in order to attend all needs. See: #2580 and #2321.
Local Test
Image: quay.io/camilamacedo86/ansible-operator:logs
See the output with the ENV VAR: