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

Operator helm not syncing on labels #6836

Open
AkhileshK8y opened this issue Sep 23, 2024 · 1 comment
Open

Operator helm not syncing on labels #6836

AkhileshK8y opened this issue Sep 23, 2024 · 1 comment

Comments

@AkhileshK8y
Copy link

AkhileshK8y commented Sep 23, 2024

Bug Report

What did you do?

I created a nginy helm operator based on the docs.
My watches yaml:

- group: demo.example.com
  version: v1alpha1
  kind: Nginy
  chart: helm-charts/nginy
  selector:
    matchLabels:
      syncMy: devOperator

I deployed 2 test object:

apiVersion: demo.example.com/v1alpha1
kind: Nginy
metadata:
  name: testa
  namespace:testa
  labels:
    syncMy: devOperator
spec:
  replicaCount: 3

and

apiVersion: demo.example.com/v1alpha1
kind: Nginy
metadata:
  name: testb
  namespace: testb
  labels:
    syncUr: devOperator
spec:
  replicaCount: 3

My Dockerfile

# Build the manager binary
FROM quay.io/operator-framework/helm-operator:v1.37.0

ENV HOME=/opt/helm
COPY watches.yaml ${HOME}/watches.yaml
COPY helm-charts  ${HOME}/helm-charts
WORKDIR ${HOME}

What did you expect to see?

I expected only testa object to get synced as only its label match. testb shouldn't sync.

What did you see instead? Under which circumstances?

However testb object is also getting synced. testb is syncing even if I change the label value. Things work fine if I change to v1.33.0 in my Dockerfile. Doesn't work with v1.35.0

Environment

Operator type:
helm operator v1.37.0

Kubernetes cluster type:
EKS

operator-sdk version: "v1.37.0", commit: "819984d4c1a51c8ff2ef6c23944554148ace0752", kubernetes version: "v1.29.0", go version: "go1.23.1", GOOS: "darwin", GOARCH: "amd64"

$ go version (if language is Go)

Client Version: v1.29.1 Kustomize Version: v5.0.4-0.20230601165947-6ce0bf390ce3 Server Version: v1.29.7-eks-a18cd3a

Possible Solution

My hunch is, it broke with below change:
1fd7f4d#diff-d47d8a84d35cfdd54322d503604e6ff0b2f5454d3f1133bfc4faa8faeb9b476d
This change went in after v1.33.0 and changes label selector code.

Additional context

https://github.com/AkhileshK8y/nginy-operator
My full code in case it helps.

@pjestin-sym
Copy link

I have the same issue, and this seems to happen when switching from version 1.16.0 to 1.36.1, so probably a regression, although that leaves a lot of versions to check 😬

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

No branches or pull requests

2 participants