Skip to content
Open
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 6 additions & 1 deletion pkg/resource/cluster.go
Original file line number Diff line number Diff line change
Expand Up @@ -347,7 +347,12 @@ func (cluster Cluster) IsLoggingAPIEnabled() bool {
if cluster.Spec().CockroachDBVersion != "" {
version = cluster.Spec().CockroachDBVersion
} else if cluster.Spec().Image != nil && cluster.Spec().Image.Name != "" {
version = strings.Split(cluster.Spec().Image.Name, ":")[1]
split_result := strings.Split(cluster.Spec().Image.Name, ":")
if len(split_result) > 1 {
version = split_result[1]
} else {
return false
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Should we add a log line here or something? I'm just thinking that if this condition is hit (no semi-colon in the image name), how would the end user know?

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We have tried to add the log line before, but it seems that a parameter that defines the logger needs to be passed to this function. However, this parameter is currently not available in this function.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think it would be sufficient to add an else branch here that lets the user know that logging is not enabled.

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Okay, I have added it in the latest commit.

}
} else {
return false
}
Expand Down