-
Notifications
You must be signed in to change notification settings - Fork 208
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
chore: move workload related defs to api module and remove cyclic dep…
…endency (#2356) This PR removes the dependency of the `api` module on the `k8sutils` module. Since `k8sutils` obviously needs to depend on `api`, this causes cyclic dependency between modules and can sometimes manifest as errors when attempting new imports in code.
- Loading branch information
Showing
54 changed files
with
322 additions
and
312 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
6 changes: 3 additions & 3 deletions
6
api/generated/odigos/applyconfiguration/odigos/v1alpha1/instrumentationrulespec.go
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
10 changes: 5 additions & 5 deletions
10
api/generated/odigos/applyconfiguration/odigos/v1alpha1/sourcespec.go
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,35 @@ | ||
package k8sconsts | ||
|
||
// 1. the pascal case representation of the workload kind | ||
// it is used in k8s api objects as the `Kind` field. | ||
type WorkloadKind string | ||
|
||
const ( | ||
WorkloadKindDeployment WorkloadKind = "Deployment" | ||
WorkloadKindDaemonSet WorkloadKind = "DaemonSet" | ||
WorkloadKindStatefulSet WorkloadKind = "StatefulSet" | ||
WorkloadKindNamespace WorkloadKind = "Namespace" | ||
) | ||
|
||
// 2. the lower case representation of the workload kind | ||
// is used in odigos with the object name for instrumentation config and runtime details | ||
type WorkloadKindLowerCase string | ||
|
||
const ( | ||
WorkloadKindLowerCaseDeployment WorkloadKindLowerCase = "deployment" | ||
WorkloadKindLowerCaseDaemonSet WorkloadKindLowerCase = "daemonset" | ||
WorkloadKindLowerCaseStatefulSet WorkloadKindLowerCase = "statefulset" | ||
WorkloadKindLowerCaseNamespace WorkloadKindLowerCase = "namespace" | ||
) | ||
|
||
// PodWorkload represents the higher-level controller managing a specific Pod within a Kubernetes cluster. | ||
// It contains essential details about the controller such as its Name, Namespace, and Kind. | ||
// 'Kind' refers to the type of controller, which can be a Deployment, StatefulSet, or DaemonSet. | ||
// This struct is useful for identifying and interacting with the overarching entity | ||
// that governs the lifecycle and behavior of a Pod, especially in contexts where | ||
// understanding the relationship between a Pod and its controlling workload is crucial. | ||
type PodWorkload struct { | ||
Name string `json:"name"` | ||
Namespace string `json:"namespace"` | ||
Kind WorkloadKind `json:"kind"` | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,10 +1,10 @@ | ||
package common | ||
|
||
import "github.com/odigos-io/odigos/k8sutils/pkg/workload" | ||
import "github.com/odigos-io/odigos/api/k8sconsts" | ||
|
||
type SourceID struct { | ||
// combination of namespace, kind and name is unique | ||
Name string `json:"name"` | ||
Kind workload.WorkloadKind `json:"kind"` | ||
Namespace string `json:"namespace"` | ||
Name string `json:"name"` | ||
Kind k8sconsts.WorkloadKind `json:"kind"` | ||
Namespace string `json:"namespace"` | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.