Skip to content

Commit

Permalink
Create cmd folder in instrumentor, scheduler and autoscaler (#2440)
Browse files Browse the repository at this point in the history
  • Loading branch information
RonFed authored Feb 13, 2025
1 parent 69049d3 commit f4d438e
Show file tree
Hide file tree
Showing 7 changed files with 9 additions and 7 deletions.
2 changes: 1 addition & 1 deletion Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ RUN go mod tidy
RUN --mount=type=cache,target=/root/.cache/go-build \
--mount=type=cache,target=/go/pkg \
CGO_ENABLED=0 GOARCH=$TARGETARCH \
go build -a -o /workspace/build/$SERVICE_NAME .
go build -a -o /workspace/build/$SERVICE_NAME cmd/main.go

# Use distroless as minimal base image to package the manager binary
# Refer to https://github.com/GoogleContainerTools/distroless for more details
Expand Down
2 changes: 1 addition & 1 deletion Dockerfile.rhel
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ RUN go mod tidy
RUN --mount=type=cache,target=/root/.cache/go-build \
--mount=type=cache,target=/go/pkg \
CGO_ENABLED=0 GOARCH=$TARGETARCH \
go build -a -o /workspace/build/$SERVICE_NAME .
go build -a -o /workspace/build/$SERVICE_NAME cmd/main.go
RUN make licenses

FROM registry.access.redhat.com/ubi9:9.5-1736404036
Expand Down
3 changes: 2 additions & 1 deletion autoscaler/main.go → autoscaler/cmd/main.go
Original file line number Diff line number Diff line change
Expand Up @@ -60,6 +60,7 @@ import (
commonconfig "github.com/odigos-io/odigos/autoscaler/controllers/common"
controllerconfig "github.com/odigos-io/odigos/autoscaler/controllers/controller_config"
"github.com/odigos-io/odigos/autoscaler/controllers/gateway"
"github.com/odigos-io/odigos/autoscaler"

//+kubebuilder:scaffold:imports

Expand Down Expand Up @@ -206,7 +207,7 @@ func main() {
// This is the reason we skip it for versions < 1.23 (Also, versions < 1.23 require a non-caching client and API chane)
if k8sVersion != nil && k8sVersion.GreaterThan(version.MustParse("v1.23")) {
// Use the cached client for versions >= 1.23
err = MigrateCollectorsWorkloadToNewLabels(context.Background(), mgr.GetClient(), odigosNs)
err = autosacler.MigrateCollectorsWorkloadToNewLabels(context.Background(), mgr.GetClient(), odigosNs)
if err != nil {
setupLog.Error(err, "unable to migrate collectors workload to new labels")
os.Exit(1)
Expand Down
2 changes: 1 addition & 1 deletion autoscaler/migration.go
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
package main
package autosacler

import (
"context"
Expand Down
5 changes: 3 additions & 2 deletions instrumentor/main.go → instrumentor/cmd/main.go
Original file line number Diff line number Diff line change
Expand Up @@ -51,6 +51,7 @@ import (

"github.com/odigos-io/odigos/instrumentor/controllers/deleteinstrumentationconfig"
"github.com/odigos-io/odigos/instrumentor/report"
"github.com/odigos-io/odigos/instrumentor"

// Import all Kubernetes client auth plugins (e.g. Azure, GCP, OIDC, etc.)
// to ensure that exec-entrypoint and run can make use of them.
Expand Down Expand Up @@ -259,10 +260,10 @@ func main() {
err = builder.
WebhookManagedBy(mgr).
For(&odigosv1.Source{}).
WithDefaulter(&SourcesDefaulter{
WithDefaulter(&instrumentor.SourcesDefaulter{
Client: mgr.GetClient(),
}).
WithValidator(&SourcesValidator{
WithValidator(&instrumentor.SourcesValidator{
Client: mgr.GetClient(),
}).
Complete()
Expand Down
2 changes: 1 addition & 1 deletion instrumentor/sources_webhooks.go
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ See the License for the specific language governing permissions and
limitations under the License.
*/

package main
package instrumentor

import (
"context"
Expand Down
File renamed without changes.

0 comments on commit f4d438e

Please sign in to comment.