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

creating multiple pools with the same spec should be forbidden #2

Closed
bavarianbidi opened this issue Sep 15, 2023 · 0 comments · Fixed by #5
Closed

creating multiple pools with the same spec should be forbidden #2

bavarianbidi opened this issue Sep 15, 2023 · 0 comments · Fixed by #5
Assignees

Comments

@bavarianbidi
Copy link
Member

What steps did you take and what happened?

Creating two pool objects with different names (but same spec) will result in one pool on garm-side.
On Kubernetes booth pools will have the same status.id

apiVersion: garm-operator.mercedes-benz.com/v1alpha1
kind: Pool
metadata:
  name: openstack-default-runner-os01
  namespace: garm-prod
spec:
  githubScopeRef:
    apiGroup: garm-operator.mercedes-benz.com
    kind: Enterprise
    name: mercedes-benz-group-ag
  enabled: true
  extraSpecs: '{"garm_image_type":"runner-default","garm_stage":"prod"}'
  flavor: m1.large
  githubRunnerGroup: ""
  imageName: runner-roadkit
  maxRunners: 10
  minIdleRunners: 1
  osArch: amd64
  osType: linux
  providerName: os01.fra-prod3
  runnerBootstrapTimeout: 20
  runnerPrefix: "road-runner-os013"
  tags:
  - ubuntu
---
apiVersion: garm-operator.mercedes-benz.com/v1alpha1
kind: Pool
metadata:
  name: openstack-default-runner-os02
  namespace: garm-prod
spec:
  githubScopeRef:
    apiGroup: garm-operator.mercedes-benz.com
    kind: Enterprise
    name: mercedes-benz-group-ag
  enabled: true
  extraSpecs: '{"garm_image_type":"runner-default","garm_stage":"prod"}'
  flavor: m1.large
  githubRunnerGroup: ""
  imageName: runner-roadkit
  maxRunners: 10
  minIdleRunners: 1
  osArch: amd64
  osType: linux
  providerName: os01.fra-prod3
  runnerBootstrapTimeout: 20
  runnerPrefix: "road-runner-os013"
  tags:
  - ubuntu

What did you expect to happen?

pool webhook should reject the creation of objects with the same spec if already one object exist.

The current implementation already forse this behavior but doesn't block the second creation request (https://github.com/mercedes-benz/garm-operator/blob/main/api/v1alpha1/pool_webhook.go#L71-L82)

garm version

v0.1.3

garm-operator version

v0.1.0

Kubernetes version

Kubernetes 1.25.5

Anything else you would like to add?

No response

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 a pull request may close this issue.

1 participant