canonical / canonical/github-profiles-automator

Old keys don't get removed from profiles.

Open
#68 1 comment 0 reactions 0 assignees View on GitHub
bug
Dominant language
Python
Stars
1
Forks
2
Avg merge
1d 11h
Merged PRs (30d)
4

Description

### Bug Description

When updating profile information, old keys to not get removed. I had a profile with
```yaml
resources:
hard:
limits.cpu: "128"
limits.memory: "1.5Ti"
limits.requests.storage: "1Ti"
nvidia.com/gpu: "4"
```
This was synced as expected. Then I prepended `limits.` to the profile:
```yaml
resources:
hard:
limits.cpu: "128"
limits.memory: "1.5Ti"
limits.requests.storage: "1Ti"
limits.nvidia.com/gpu: "4"
```
Now the profile has both keys and looks like this:
```yaml
resourceQuotaSpec:
hard:
limits.cpu: "128"
limits.memory: 1.5Ti
limits.nvidia.com/gpu: "4"
limits.requests.storage: 1Ti
nvidia.com/gpu: "4"
```
I believe the `nvidia.com/gpu` should be removed.

### To Reproduce

1. put the first profile from above into git and run sync
2. verify `kubectl get profiles -o yaml`
3. change the profile to the second one from above
4. check `kubectl get profiles -o yaml` again

### Environment

App Version Status Scale Charm Channel Rev Address Exposed Message
github-profiles-automator active 1 github-profiles-automator latest/edge 230 10.152.43.67 no

### Relevant Log Output

```shell
.
```

### Additional Context

_No response_

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.