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

Cassandra reaper deployments initContainer image version doesn't update on helm chart upgrade #1554

Open
Shivam0609 opened this issue Dec 16, 2022 · 4 comments
Labels
bug Something isn't working needs-triage

Comments

@Shivam0609
Copy link

Bug Report

Describe the bug
When upgrading k8ssandra helm chart from v1.5.0 to v1.5.2 , reaper-operator is not updating the cassandra-reaper initContainer image while main container image gets updated.

To Reproduce
Steps to reproduce the behavior:

  1. Install k8ssandra chart version v1.5.0
  2. Check cassandra-reaper deployment images version (containers & initContainers) - should be 3.1.1 for both images
  3. Upgrade chart version to v1.5.2
  4. Check cassandra-reaper deployment images version (containers & initContainers) - should be 3.2.1 for both image, but initContainers image is still on version 3.1.1 which is vulnerable image.

Expected behavior
Post upgrade to k8ssandra v1.5.2, cassandra-reaper's container and initContainer images must be on version 3.2.1

Cassandra reaper image 3.2.1 released in v1.5.2 of k8ssandra chart fixes a Critical vulnerability CVE-2022-42889 in cassandra-reaper image. But chart upgrade partially fixes this vulnerability in cassandra-reaper as initContainer image is still on vulnerable version.

Screenshots
If applicable, add screenshots to help explain your problem.

Environment (please complete the following information):

  • Helm charts version info
Upgrading from v1.5.0 to v1.5.2
  • Helm charts user-supplied values
cassandra:
  auth:
    enabled: false
  version: "3.11.12"
  cassandraLibDirVolume:
    storageClass: gp3
    size: 8Gi
  heap:
    size: 4G
  resources: {}
  loggingSidecar:
    enabled: false
  metric_filters: []
kube-prometheus-stack:
  enabled: false
stargate:
  enabled: false
  • Kubernetes version information:
(root:~) kubectl version --short
 Client Version: v1.23.9
 Server Version: v1.23.13-eks-fb459a0
  • Kubernetes cluster kind:
Amazon EKS 

Additional context

@Shivam0609 Shivam0609 added bug Something isn't working needs-triage labels Dec 16, 2022
@Shivam0609 Shivam0609 changed the title Cassandra reaper deployments, initContainer image version doesn't update on helm chart upgrade Cassandra reaper deployments initContainer image version doesn't update on helm chart upgrade Dec 16, 2022
@Shivam0609
Copy link
Author

Seems ReconcileDeployment function supports only deployment.spec.template.spec.containers , Can be checked here . This could be reason when upgrading chart version reconciler updates deployment but initContainer is not updated.

But in case of fresh installation it creates reaper-schema-init container with same image as main container image. Can be checked here

So might be something similar can be done for initContainers as we can see for containers in ReconcileDeployment function.

deployment.Spec.Template.Spec.InitContainers = desiredDeployment.Spec.Template.Spec.InitContainers

@adejanovski
Copy link
Contributor

I've observed the same behavior @Shivam0609 👍

Would you be willing to send a PR with a fix and a test for that fix?

@Shivam0609
Copy link
Author

Shivam0609 commented Jan 10, 2023

Will try to give you fix @adejanovski

@Shivam0609
Copy link
Author

I'm not getting time to work on this @adejanovski will you be able to help here for the fix.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working needs-triage
Projects
Status: Product Backlog
Development

No branches or pull requests

2 participants