forked from kubernetes-csi/csi-lib-iscsi
-
Notifications
You must be signed in to change notification settings - Fork 1
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
Refactor/klogs #8
Open
jskazinski
wants to merge
34
commits into
main
Choose a base branch
from
refactor/klogs
base: main
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Open
Conversation
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Build issue# vendor/github.com/kubernetes-csi/csi-lib-iscsi/iscsi/iscsi.go:379:7: no new variables on left side of := Building iscsiplugin for GOOS= GOARCH= failed, see error(s) above. make: *** [release-tools/build.make:81: build-iscsiplugin] Error 1 Signed-off-by: Humble Chirammal <[email protected]>
example/main.go:36:3: unknown field 'TargetIqn' in struct literal of type iscsi.Connector example/main.go:38:3: unknown field 'TargetPortals' in struct literal of type iscsi.Connector example/main.go:74:20: c.TargetIqn undefined (type iscsi.Connector has no field or method TargetIqn) example/main.go:74:33: c.TargetPortals undefined (type iscsi.Connector has no field or method TargetPortals) make: *** [Makefile:11: build] Error 2 Signed-off-by: Humble Chirammal <[email protected]>
Signed-off-by: Humble Chirammal <[email protected]>
Signed-off-by: Humble Chirammal <[email protected]>
Fix unknown struct field reference and variable assignment in iscsi library
- fix example/main.go - add go.mod to simplify local development
Following Red Hat Customer Portal recommendations: https://access.redhat.com/documentation/en-us/red_hat_enterprise_linux/7/html/storage_administration_guide/removing_devices
- always control devices through the Device class - add checks on devices - store all used devices instead of mounted one only - filter device by transport to keep iSCSI devices only
- refactor connector's functions to use it as a receiver - refactor waitForPathToExists - refactor Connect to make it smaller and more readable
- include error code - remove unused properties - retrieve specific columns including device size - always output as JSON
Fix/disconnect volume
Signed-off-by: Humble Chirammal <[email protected]>
This commit use error wrapping checkfunctions in error comparison Handle error conditions in iscsi admin functions. Also, remove path,pathgroup structs which are unused Signed-off-by: Humble Chirammal <[email protected]>
update OWNERS file
Do error checking and error wrapping in the connector functions.
…y change Signed-off-by: Joe Skazinski <[email protected]>
Signed-off-by: Joe Skazinski <[email protected]>
Signed-off-by: Joe Skazinski <[email protected]>
…nternal calls Signed-off-by: Joe Skazinski <[email protected]>
Signed-off-by: Joe Skazinski <[email protected]>
seagate-chris
approved these changes
Aug 5, 2022
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Related to https://kubernetes.io/blog/2022/05/25/contextual-logging/ and https://github.com/kubernetes/enhancements/blob/master/keps/sig-instrumentation/1602-structured-logging/README.md
The main reason for this change is to allow drivers and libraries to use the same klog logging package, and to switch to using structured logging throughout the library. From my understanding, klog is the most common Kubernetes logger and this allows consistent log output for CSI drivers and the iSCSI library.
Signed-off-by: Joe Skazinski [email protected]
What type of PR is this?
/kind feature
What this PR does / why we need it:
Converts the library to using "k8s.io/klog/v2" and specifically structured logging.
Addresses one issue allowing the code to work with older and newer versions of lsblk.
Which issue(s) this PR fixes:
Special notes for your reviewer:
This change does not disable logging by default, but does allow the user to set their own io.Writer. This is a change from the prior default behavior. This change uses structured logging and captures the same information with no loss, but with the possibility of additional information being provided where it proves useful in the particular context.
Does this PR introduce a user-facing change?:
Yes, the structure of the log information is presented in the klog format versus the prior formatting. Each log entry contains the same relevant information, such as timestamp and level (Info vs Error), and library values, but the the text outline is changed and will affect any scripts scraping the logs.
Refactored to use klog/v2 and structured logging.
View rendered README.md