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

Migrate to kubebuilder v4 #1355

Merged
merged 17 commits into from
Sep 4, 2024
Merged

Conversation

fanny-jiang
Copy link
Contributor

@fanny-jiang fanny-jiang commented Aug 15, 2024

What does this PR do?

Migrate project to use kubebuilder v4: https://book.kubebuilder.io/migration/manually_migration_guide_gov3_to_gov4

Main changes:

  • controllers/ renamed and moved to internal/controller/
  • apis/ renamed to api/
  • main.go moved to cmd/main.go
  • kubebuilder dependency version bumps

Motivation

What inspired you to submit this pull request?

Additional Notes

Anything else we should know when reviewing?

Minimum Agent Versions

Are there minimum versions of the Datadog Agent and/or Cluster Agent required?

  • Agent: vX.Y.Z
  • Cluster Agent: vX.Y.Z

Describe your test plan

  • Run make all and there should be no errors and tests pass
  • Run make VERSION=X.Y.Z-rc.W LATEST_VERSION=X.Y.Z bundle and check that bundle is created properly and does not produce errors in the terminal
  • Same with make redhat-bundle
  • Run make install in a fresh kind cluster and CRDs should install
  • Run make deploy and check that the operator pod is running properly
  • Deploy a datadogagent manifest and spot check that agent pods get created properly

Checklist

  • PR has at least one valid label: bug, enhancement, refactoring, documentation, tooling, and/or dependencies
  • PR has a milestone or the qa/skip-qa label

Copy link

@github-actions github-actions bot left a comment

Choose a reason for hiding this comment

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

This pull request does not contain a valid label. Please add one of the following labels: bug, enhancement, refactoring, documentation, tooling, dependencies

@fanny-jiang fanny-jiang added the dependencies Pull requests that update a dependency file label Aug 15, 2024
@fanny-jiang fanny-jiang added this to the v1.9.0 milestone Aug 15, 2024
…e-kustomize

# Conflicts:
#	api/datadoghq/v1alpha1/datadogagent_conversion.go
#	api/datadoghq/v1alpha1/datadogagent_conversion_agent.go
#	api/datadoghq/v1alpha1/datadogagent_conversion_ccr.go
#	api/datadoghq/v1alpha1/datadogagent_conversion_dca.go
#	api/datadoghq/v1alpha1/datadogagent_conversion_test.go
#	api/datadoghq/v1alpha1/datadogagent_default.go
#	api/datadoghq/v1alpha1/datadogagent_default_test.go
#	api/datadoghq/v1alpha1/datadogagent_types.go
#	api/datadoghq/v1alpha1/datadogagent_validation.go
#	api/datadoghq/v1alpha1/patch/datadogagent.go
#	api/datadoghq/v1alpha1/patch/datadogagent_test.go
#	api/datadoghq/v1alpha1/secret.go
#	api/datadoghq/v1alpha1/test/new.go
#	api/datadoghq/v1alpha1/testdata/all.expected.yaml
#	api/datadoghq/v1alpha1/testdata/all.yaml
#	api/datadoghq/v1alpha1/testdata/empty.expected.yaml
#	api/datadoghq/v1alpha1/testdata/empty.yaml
#	api/datadoghq/v1alpha1/testdata/featureOvr.expected.yaml
#	api/datadoghq/v1alpha1/testdata/featureOvr.yaml
#	api/datadoghq/v1alpha1/utils.go
#	api/datadoghq/v1alpha1/utils_test.go
#	api/datadoghq/v1alpha1/zz_generated.deepcopy.go
#	api/datadoghq/v1alpha1/zz_generated.openapi.go
#	cmd/check-operator/upgrade/upgrade.go
#	cmd/kubectl-datadog/agent/upgrade/upgrade.go
#	cmd/kubectl-datadog/agent/upgrade/upgrade_test.go
#	cmd/kubectl-datadog/clusteragent/upgrade/upgrade.go
#	cmd/kubectl-datadog/clusteragent/upgrade/upgrade_test.go
#	cmd/kubectl-datadog/flare/flare.go
#	cmd/kubectl-datadog/get/get.go
#	internal/controller/testutils/new.go
#	pkg/controller/utils/condition/condition.go
#	pkg/plugin/common/statuswrapper.go
#	pkg/plugin/common/v2support.go
@codecov-commenter
Copy link

codecov-commenter commented Aug 23, 2024

Codecov Report

Attention: Patch coverage is 25.00000% with 3 lines in your changes missing coverage. Please review.

Project coverage is 47.40%. Comparing base (9d154ce) to head (97de985).

Files with missing lines Patch % Lines
cmd/main.go 0.00% 3 Missing ⚠️
Additional details and impacted files

Impacted file tree graph

@@           Coverage Diff           @@
##             main    #1355   +/-   ##
=======================================
  Coverage   47.40%   47.40%           
=======================================
  Files         223      223           
  Lines       19244    19244           
=======================================
  Hits         9123     9123           
  Misses       9635     9635           
  Partials      486      486           
Flag Coverage Δ
unittests 47.40% <25.00%> (ø)

Flags with carried forward coverage won't be shown. Click here to find out more.

Files with missing lines Coverage Δ
api/datadoghq/common/common.go 14.92% <ø> (ø)
api/datadoghq/common/v1/customConfig.go 100.00% <ø> (ø)
...pi/datadoghq/v1alpha1/datadogagentprofile_types.go 100.00% <ø> (ø)
...tadoghq/v1alpha1/datadogagentprofile_validation.go 100.00% <ø> (ø)
api/datadoghq/v1alpha1/datadogdashboard_types.go 100.00% <ø> (ø)
.../datadoghq/v1alpha1/datadogdashboard_validation.go 100.00% <ø> (ø)
api/datadoghq/v1alpha1/datadogmetric_types.go 100.00% <ø> (ø)
api/datadoghq/v1alpha1/datadogmonitor_types.go 100.00% <ø> (ø)
...pi/datadoghq/v1alpha1/datadogmonitor_validation.go 100.00% <ø> (ø)
...i/datadoghq/v1alpha1/datadogpodautoscaler_types.go 100.00% <ø> (ø)
... and 152 more

... and 8 files with indirect coverage changes


Continue to review full report in Codecov by Sentry.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update 9d154ce...97de985. Read the comment docs.

@fanny-jiang fanny-jiang added the enhancement New feature or request label Aug 26, 2024
@fanny-jiang fanny-jiang marked this pull request as ready for review August 26, 2024 22:10
@fanny-jiang fanny-jiang requested review from a team as code owners August 26, 2024 22:10
…e-kustomize

# Conflicts:
#	internal/controller/datadogagent/feature/apm/feature.go
#	internal/controller/datadogagent/feature/apm/feature_test.go
# Conflicts:
#	api/datadoghq/v2alpha1/zz_generated.openapi.go
#	internal/controller/datadogagent/override/daemonset_test.go
#	pkg/agentprofile/agent_profile_test.go
@fanny-jiang fanny-jiang force-pushed the fanny/CECO-1269/update-kustomize branch from 8ad0a4d to 254c832 Compare August 29, 2024 22:46
@fanny-jiang fanny-jiang merged commit 010c848 into main Sep 4, 2024
20 checks passed
@fanny-jiang fanny-jiang deleted the fanny/CECO-1269/update-kustomize branch September 4, 2024 21:13
mftoure pushed a commit that referenced this pull request Oct 3, 2024
* update licenses

* migrate project to kubebuilder v4

* post-merge fixes

* fix licenses

* fix check-operator dockerfile

* migrate deprecated kustomization fields

* comment out v1alpha1 resources/patches

* post-merge fix

* fix generated files

---------

Co-authored-by: levan-m <[email protected]>
Co-authored-by: Levan Machablishvili <[email protected]>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
dependencies Pull requests that update a dependency file enhancement New feature or request
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants