Skip to content

Start using the batch/v1 api for CronJobs#3854

Merged
Molter73 merged 4 commits intomasterfrom
mauro-use-v1-cronjobs-for-deployments
Nov 28, 2022
Merged

Start using the batch/v1 api for CronJobs#3854
Molter73 merged 4 commits intomasterfrom
mauro-use-v1-cronjobs-for-deployments

Conversation

@Molter73
Copy link
Contributor

@Molter73 Molter73 commented Nov 18, 2022

Description

Closes stackrox/collector#907

The v1beta1.CronJob api is unavailable in k8s v1.25 and it causes sensor to not be able to synchronize k8s resources, which in turn causes all information gathered by collector to be discarded (since sensor is not able to link container IDs to k8s resources).

The v1.CronJob API has been available since k8s v1.21 (which is already EOL). Older versions are no longer supported by k8s or openshift, so we should be safe to make this change.

Checklist

  • Investigated and inspected CI test results
  • Unit test and regression tests added
  • Evaluated and added CHANGELOG entry if required
  • Determined and documented upgrade steps
  • Documented user facing changes (create PR based on openshift/openshift-docs and merge into rhacs-docs)

If any of these don't apply, please comment below.

Testing Performed

  • Tested on k3s with kubernetes v1.22.11
  • Tested on k3s with kubernetes v1.25.3

@ghost
Copy link

ghost commented Nov 18, 2022

Images are ready for the commit at 9963217.

To use with deploy scripts, first export MAIN_IMAGE_TAG=3.73.x-81-g9963217d5c.

@Molter73 Molter73 requested review from theencee and vikin91 November 21, 2022 12:15
Copy link
Contributor

@vikin91 vikin91 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The code change looks good!
Maybe we could check whether there are some unit tests and adapt them as well?

@lvalerom @fredrb would this change affect the safety-net tests for re-sync?

@fredrb
Copy link
Contributor

fredrb commented Nov 21, 2022

would this change affect the safety-net tests for re-sync?

We don't have any CronJob resources in the replay tests nor specific tests in the integration tests, so no.

@theencee theencee requested a review from md2119 November 21, 2022 17:10
@Molter73
Copy link
Contributor Author

@vikin91, I can try adding a cronjob test case here, think that could work/be enough?

@vikin91
Copy link
Contributor

vikin91 commented Nov 22, 2022

@vikin91, I can try adding a cronjob test case here, think that could work/be enough?

Assuming that deploymentType could accept the cron resource, that may be okay. I am not too familiar with this test.

@Molter73 Molter73 force-pushed the mauro-use-v1-cronjobs-for-deployments branch from 3d93bd2 to ee5358f Compare November 22, 2022 14:08
@Molter73 Molter73 force-pushed the mauro-use-v1-cronjobs-for-deployments branch from 9031c5b to 9963217 Compare November 28, 2022 13:14
@Molter73 Molter73 merged commit c01d55a into master Nov 28, 2022
@Molter73 Molter73 deleted the mauro-use-v1-cronjobs-for-deployments branch November 28, 2022 15:10
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Ubuntu 22.04.1 LTS Collector not working

5 participants