Skip to content
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

Skip RedisClusterSpec conversion for sentinel and standalone mode #1257

Merged
merged 3 commits into from
Jul 15, 2024

Conversation

Neaj-Morshad-101
Copy link
Contributor

@Neaj-Morshad-101 Neaj-Morshad-101 commented Jul 15, 2024

if out.Cluster == nil {
			out.Cluster = &RedisClusterSpec{}
}
if err := Convert_v1_RedisClusterSpec_To_v1alpha2_RedisClusterSpec(in.Cluster, out.Cluster, s); err != nil {
			return err
}


func Convert_v1_RedisClusterSpec_To_v1alpha2_RedisClusterSpec(in *v1.RedisClusterSpec, out *RedisClusterSpec, s conversion.Scope) error {
	if in.Shards != nil { // HERE in IS NIL IF MODE IS NOT CLUSTER. THAT'S WHY PANIC.... 
		out.Master = (*int32)(unsafe.Pointer(in.Shards))
	} else {
		out.Master = nil
	}
}

@ArnobKumarSaha ArnobKumarSaha merged commit 8447502 into master Jul 15, 2024
14 checks passed
@ArnobKumarSaha ArnobKumarSaha deleted the fix-conv branch July 15, 2024 11:33
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants