kubeslice / kubeslice/worker-operator

Bug: `istiov1beta1.AddToScheme` called twice in `main.go`

Open
#472 0 comments 0 reactions 4 assignees Claimed by @richiesebastian View on GitHub
bug
Dominant language
Go
Stars
62
Forks
33
Avg merge
3d 10h
Merged PRs (30d)
3

Description

### 📜 Description

`main.go` lines 85–88:

```go
utilruntime.Must(istiov1beta1.AddToScheme(scheme))
utilruntime.Must(kubeslicev1beta1.AddToScheme(scheme))
utilruntime.Must(istiov1beta1.AddToScheme(scheme)) // duplicate
```

`istiov1beta1.AddToScheme` is registered twice. While `controller-runtime` deduplicates scheme registrations, the duplicate call is dead code that misleads readers and could mask a bug where the intended second registration (e.g., a different API group) was accidentally omitted.

### 👟 Reproduction steps

Read `main.go` lines 83–89.

### 👍 Expected behavior

Each scheme is registered exactly once.

### 👎 Actual Behavior

`istiov1beta1.AddToScheme` appears twice; one call is a no-op.

### 🐚 Relevant log output

```shell

```

### Version

_No response_

### 🖥️ What operating system are you seeing the problem on?

_No response_

### ✅ Proposed Solution

Remove the second `utilruntime.Must(istiov1beta1.AddToScheme(scheme))` call.

### 👀 Have you spent some time to check if this issue has been raised before?

- [x] I checked and didn't find any similar issue

### Code of Conduct

- [x] I agree to follow this project's Code of Conduct

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.