samba-in-kubernetes / samba-operator

An operator for a Samba as a service on PVCs in kubernetes
Apache License 2.0
117 stars 24 forks source link

updating SmbdContainerImage and ServiceAccountName via environment does not change the share's deployment's image #219

Open ibotty opened 2 years ago

ibotty commented 2 years ago

This is on version v0.2.

> oc logs -n samba-operator-system deploy/samba-operator-controller-manager
2022-06-15T09:33:03.716Z        INFO    setup   loaded configuration successfully       {"config": {"SmbdContainerImage":"quay.io/samba.org/samba-server:v0.2","SmbdMetricsContainerImage":"qu
ay.io/samba.org/samba-metrics:v0.2","SvcWatchContainerImage":"quay.io/samba.org/svcwatch:v0.2","SmbdContainerName":"samba","WinbindContainerName":"wb","WorkingNamespace":"samba-operator-syst
em","SambaDebugLevel":"","StatePVCSize":"1Gi","ClusterSupport":"","SmbServicePort":445,"SmbdPort":445,"ServiceAccountName":"samba","MetricsExporterMode":"disabled","PodName":"samba-operator-
controller-manager-7486c6dcf5-zq7w7","PodNamespace":"samba-operator-system","PodIP":"172.20.11.77"}}
[...]
2022-06-15T09:33:26.516Z        INFO    controllers.SmbShare    Updating state for SmbShare  {"smbshare": "namespace/my-share", "SmbShare.Namespace": "namespace", "SmbShare.Name": "myshare", "Smb
Share.UID": "f69ba631-de0b-4856-b3fb-b0cb9f2a4ca1"}
2022-06-15T09:33:31.718Z        INFO    controllers.SmbShare    Done updating SmbShare resources      {"smbshare": "namespace/my-share"}

But:

> oc get po -n namespace myshare | grep -E '(serviceAccountName|image):'
    image: quay.io/samba.org/samba-server:latest
  serviceAccountName: default
    image: quay.io/samba.org/samba-server:latest
phlogistonjohn commented 2 years ago

Odd. Is it possible that the pods with these images were created before you were using the v0.2 operator image?

If yes, that's expected, the operator doesn't yet have the ability to "upgrade" running pods. If no, I'll ask for more info such as a full yaml dump of the operator deployment and the pods/deployments exhibiting the behavior. Thanks!

ibotty commented 2 years ago

Yes, they were created before using the v0.2 operator image.