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

Create go module for the CRD #196

Merged
merged 5 commits into from
Jan 8, 2025
Merged

Create go module for the CRD #196

merged 5 commits into from
Jan 8, 2025

Conversation

davidor
Copy link
Member

@davidor davidor commented Dec 11, 2024

What does this PR do?

Creates a new go module for the CRD.
This will allow other projects like the datadog-operator to rely on that go mod instead of the root go mod of the project.
This will reduce the dependencies required and hopefully create less conflicts when upgrading kubernetes libraries.

Describe your test plan

I don't think there's anything specific apart from verifying that this simplifies the process when we need to upgrade the kubernetes libraries in the datadog-operator.

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, documentation, tooling

@davidor davidor added the enhancement New feature or request label Dec 11, 2024
@davidor davidor force-pushed the davidor/contp-531-api-go-mod branch from c319b34 to 13fd935 Compare December 16, 2024 08:51
@davidor davidor marked this pull request as ready for review December 16, 2024 08:52
@davidor davidor requested a review from a team as a code owner December 16, 2024 08:52
@davidor davidor added this to the v0.10 milestone Dec 16, 2024
@codecov-commenter
Copy link

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 43.75%. Comparing base (f0c8877) to head (13fd935).
Report is 13 commits behind head on main.

Additional details and impacted files

Impacted file tree graph

@@             Coverage Diff             @@
##             main     #196       +/-   ##
===========================================
- Coverage   63.10%   43.75%   -19.36%     
===========================================
  Files          41       65       +24     
  Lines        3098     4939     +1841     
===========================================
+ Hits         1955     2161      +206     
- Misses       1023     2651     +1628     
- Partials      120      127        +7     
Flag Coverage Δ
unittests 43.75% <ø> (-19.36%) ⬇️

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

see 39 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 aa85235...13fd935. Read the comment docs.

@davidor davidor force-pushed the davidor/contp-531-api-go-mod branch from 13fd935 to 7f52c43 Compare December 16, 2024 08:57
@davidor davidor marked this pull request as draft December 16, 2024 16:36
@davidor davidor force-pushed the davidor/contp-531-api-go-mod branch from 7f52c43 to c7008b6 Compare December 16, 2024 18:25
@davidor davidor marked this pull request as ready for review December 17, 2024 15:23
@@ -86,16 +86,16 @@ require (
go.uber.org/multierr v1.11.0 // indirect
golang.org/x/exp v0.0.0-20230905200255-921286631fa9 // indirect
golang.org/x/mod v0.17.0 // indirect
golang.org/x/net v0.26.0 // indirect
golang.org/x/net v0.28.0 // indirect

Choose a reason for hiding this comment

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

🔴 Library Vulnerability

golang.org/x/net → 0.28.0

View all suggested fixes
Suggested change
golang.org/x/net v0.28.0 // indirect
golang.org/x/net vv0.34.0// indirect
Suggested change
golang.org/x/net v0.28.0 // indirect
golang.org/x/net vv0.33.0// indirect
Non-linear parsing of case-insensitive content in golang.org/x/net/html (...read more)

An attacker can craft an input to the Parse functions that would be processed non-linearly with respect to its length, resulting in extremely slow parsing. This could cause a denial of service.

View in Datadog  Leave us feedback  Documentation

github.com/modern-go/reflect2 v1.0.2 // indirect
github.com/pmezard/go-difflib v1.0.1-0.20181226105442-5d4384ee4fb2 // indirect
github.com/x448/float16 v0.8.4 // indirect
golang.org/x/net v0.28.0 // indirect

Choose a reason for hiding this comment

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

🔴 Library Vulnerability

golang.org/x/net → 0.28.0

View all suggested fixes
Suggested change
golang.org/x/net v0.28.0 // indirect
golang.org/x/net vv0.34.0// indirect
Suggested change
golang.org/x/net v0.28.0 // indirect
golang.org/x/net vv0.33.0// indirect
Non-linear parsing of case-insensitive content in golang.org/x/net/html (...read more)

An attacker can craft an input to the Parse functions that would be processed non-linearly with respect to its length, resulting in extremely slow parsing. This could cause a denial of service.

View in Datadog  Leave us feedback  Documentation

@@ -15,7 +15,7 @@ jobs:
- name: Check out code into the Go module directory
uses: actions/checkout@v1
- name: Verify Pull Request Labels
uses: jesusvasquez333/verify-pr-label-action@v1.1.0
uses: jesusvasquez333/verify-pr-label-action@v1.4.0

Choose a reason for hiding this comment

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

🟠 Code Vulnerability

Workflow depends on a GitHub actions pinned by tag (...read more)

When using a third party action, one needs to provide its GitHub path (owner/project) and can eventually pin it to a Git ref (a branch name, a Git tag, or a commit hash).

No pinned Git ref means the action uses the latest commit of the default branch each time it runs, eventually running newer versions of the code that were not audited by Datadog. Specifying a Git tag is better, but since they are not immutable, using a full length hash is recommended to make sure the action content is actually frozen to some reviewed state.

Be careful however, as even pinning an action by hash can be circumvented by attackers still. For instance, if an action relies on a Docker image which is itself not pinned to a digest, it becomes possible to alter its behaviour through the Docker image without actually changing its hash. You can learn more about this kind of attacks in Unpinnable Actions: How Malicious Code Can Sneak into Your GitHub Actions Workflows. Pinning actions by hash is still a good first line of defense against supply chain attacks.

Additionally, pinning by hash or tag means the action won’t benefit from newer version updates if any, including eventual security patches. Make sure to regularly check if newer versions for an action you use are available. For actions coming from a very trustworthy source, it can make sense to use a laxer pinning policy to benefit from updates as soon as possible.

View in Datadog  Leave us feedback  Documentation

@davidor davidor force-pushed the davidor/contp-531-api-go-mod branch from 64547e9 to 88b18e9 Compare January 8, 2025 18:31
@davidor
Copy link
Member Author

davidor commented Jan 8, 2025

Rebased on main

@davidor
Copy link
Member Author

davidor commented Jan 8, 2025

/merge

@dd-devflow
Copy link

dd-devflow bot commented Jan 8, 2025

Devflow running: /merge

View all feedbacks in Devflow UI.


2025-01-08 19:03:59 UTC ℹ️ MergeQueue: pull request added to the queue

The median merge time in main is 0s.


2025-01-08 19:17:28 UTC 🚨 MergeQueue: This merge request is in error

mergequeue build completed successfully, but the github api returned an error while merging the pr

Details

Error: PUT https://api.github.com/repos/DataDog/extendeddaemonset/pulls/196/merge: 405 Merge commits are not allowed on this repository. []

FullStacktrace:
activity error (type: github.GithubService_MergePullRequest, scheduledEventID: 41, startedEventID: 42, identity: 1@github-worker-54f6759d5b-8b5sf@): PUT https://api.github.com/repos/DataDog/extendeddaemonset/pulls/196/merge: 405 Merge commits are not allowed on this repository. [] (type: GitFailure, retryable: false): PUT https://api.github.com/repos/DataDog/extendeddaemonset/pulls/196/merge: 405 Merge commits are not allowed on this repository. [] (type: ErrorResponse, retryable: true)

@davidor davidor merged commit 6c4d337 into main Jan 8, 2025
34 of 35 checks passed
@davidor davidor deleted the davidor/contp-531-api-go-mod branch January 8, 2025 20:51
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants