Skip to content

Commit

Permalink
(fleet) rename services => packages (DataDog#31613)
Browse files Browse the repository at this point in the history
  • Loading branch information
arbll authored Nov 29, 2024
1 parent c86fec4 commit 8c32e54
Show file tree
Hide file tree
Showing 34 changed files with 40 additions and 50 deletions.
30 changes: 15 additions & 15 deletions pkg/fleet/installer/installer.go
Original file line number Diff line number Diff line change
Expand Up @@ -21,8 +21,8 @@ import (
"github.com/DataDog/datadog-agent/pkg/fleet/internal/paths"

fleetEnv "github.com/DataDog/datadog-agent/pkg/fleet/env"
"github.com/DataDog/datadog-agent/pkg/fleet/installer/packages"
"github.com/DataDog/datadog-agent/pkg/fleet/installer/repository"
"github.com/DataDog/datadog-agent/pkg/fleet/installer/service"
"github.com/DataDog/datadog-agent/pkg/fleet/internal/db"
"github.com/DataDog/datadog-agent/pkg/fleet/internal/oci"
"github.com/DataDog/datadog-agent/pkg/util/log"
Expand Down Expand Up @@ -476,7 +476,7 @@ func (i *installerImpl) InstrumentAPMInjector(ctx context.Context, method string
return fmt.Errorf("APM injector is not installed")
}

err = service.InstrumentAPMInjector(ctx, method)
err = packages.InstrumentAPMInjector(ctx, method)
if err != nil {
return fmt.Errorf("could not instrument APM: %w", err)
}
Expand All @@ -496,7 +496,7 @@ func (i *installerImpl) UninstrumentAPMInjector(ctx context.Context, method stri
return fmt.Errorf("APM injector is not installed")
}

err = service.UninstrumentAPMInjector(ctx, method)
err = packages.UninstrumentAPMInjector(ctx, method)
if err != nil {
return fmt.Errorf("could not instrument APM: %w", err)
}
Expand Down Expand Up @@ -539,9 +539,9 @@ func (i *installerImpl) Close() error {
func (i *installerImpl) startExperiment(ctx context.Context, pkg string) error {
switch pkg {
case packageDatadogAgent:
return service.StartAgentExperiment(ctx)
return packages.StartAgentExperiment(ctx)
case packageDatadogInstaller:
return service.StartInstallerExperiment(ctx)
return packages.StartInstallerExperiment(ctx)
default:
return nil
}
Expand All @@ -550,9 +550,9 @@ func (i *installerImpl) startExperiment(ctx context.Context, pkg string) error {
func (i *installerImpl) stopExperiment(ctx context.Context, pkg string) error {
switch pkg {
case packageDatadogAgent:
return service.StopAgentExperiment(ctx)
return packages.StopAgentExperiment(ctx)
case packageDatadogInstaller:
return service.StopInstallerExperiment(ctx)
return packages.StopInstallerExperiment(ctx)
default:
return nil
}
Expand All @@ -561,9 +561,9 @@ func (i *installerImpl) stopExperiment(ctx context.Context, pkg string) error {
func (i *installerImpl) promoteExperiment(ctx context.Context, pkg string) error {
switch pkg {
case packageDatadogAgent:
return service.PromoteAgentExperiment(ctx)
return packages.PromoteAgentExperiment(ctx)
case packageDatadogInstaller:
return service.PromoteInstallerExperiment(ctx)
return packages.PromoteInstallerExperiment(ctx)
default:
return nil
}
Expand All @@ -572,11 +572,11 @@ func (i *installerImpl) promoteExperiment(ctx context.Context, pkg string) error
func (i *installerImpl) setupPackage(ctx context.Context, pkg string, args []string) error {
switch pkg {
case packageDatadogInstaller:
return service.SetupInstaller(ctx)
return packages.SetupInstaller(ctx)
case packageDatadogAgent:
return service.SetupAgent(ctx, args)
return packages.SetupAgent(ctx, args)
case packageAPMInjector:
return service.SetupAPMInjector(ctx)
return packages.SetupAPMInjector(ctx)
default:
return nil
}
Expand All @@ -585,11 +585,11 @@ func (i *installerImpl) setupPackage(ctx context.Context, pkg string, args []str
func (i *installerImpl) removePackage(ctx context.Context, pkg string) error {
switch pkg {
case packageDatadogAgent:
return service.RemoveAgent(ctx)
return packages.RemoveAgent(ctx)
case packageAPMInjector:
return service.RemoveAPMInjector(ctx)
return packages.RemoveAPMInjector(ctx)
case packageDatadogInstaller:
return service.RemoveInstaller(ctx)
return packages.RemoveInstaller(ctx)
default:
return nil
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,8 +5,7 @@

//go:build !windows

// Package service provides a way to interact with os services
package service
package packages

import (
"bytes"
Expand All @@ -19,7 +18,7 @@ import (
"strings"

"github.com/DataDog/datadog-agent/pkg/fleet/env"
"github.com/DataDog/datadog-agent/pkg/fleet/installer/service/embedded"
"github.com/DataDog/datadog-agent/pkg/fleet/installer/packages/embedded"
"github.com/DataDog/datadog-agent/pkg/util/log"
"go.uber.org/multierr"
"gopkg.in/DataDog/dd-trace-go.v1/ddtrace/tracer"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,8 +5,7 @@

//go:build !windows

// Package service provides a way to interact with os services
package service
package packages

import (
"context"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,8 +5,7 @@

//go:build windows

// Package service provides a way to interact with os services
package service
package packages

import "context"

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,8 +5,7 @@

//go:build !windows

// Package service provides a way to interact with os services
package service
package packages

import (
"bytes"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,8 +5,7 @@

//go:build !windows

// Package service provides a way to interact with os services
package service
package packages

import (
"context"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,8 +5,7 @@

//go:build !windows

// Package service provides a way to interact with os services
package service
package packages

import (
"context"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,8 +5,7 @@

//go:build !windows

// Package service provides a way to interact with os services
package service
package packages

import (
"context"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,8 +5,7 @@

//go:build windows

// Package service provides a way to interact with os services
package service
package packages

import (
"context"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,8 @@

//go:build !windows

package service
// Package packages contains the install/upgrades/uninstall logic for packages
package packages

import (
"context"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,10 +5,12 @@

//go:build windows

package service
// Package packages contains the install/upgrades/uninstall logic for packages
package packages

import (
"context"

"github.com/DataDog/datadog-agent/pkg/util/log"
"gopkg.in/DataDog/dd-trace-go.v1/ddtrace/tracer"
)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,8 +5,7 @@

//go:build !windows

// Package service provides a way to interact with os services
package service
package packages

import (
"bytes"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,8 +5,7 @@

//go:build !windows

// Package service provides a way to interact with os services
package service
package packages

import (
"context"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,8 +5,7 @@

//go:build !windows

// Package service provides a way to interact with os services
package service
package packages

import (
"bytes"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,8 +5,7 @@

//go:build !windows

// Package service provides a way to interact with os services
package service
package packages

import (
"context"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,15 +5,16 @@

//go:build windows

package service
package packages

import (
"fmt"
"os/exec"
"path/filepath"

"github.com/DataDog/datadog-agent/pkg/fleet/internal/paths"
"github.com/DataDog/datadog-agent/pkg/util/log"
"golang.org/x/sys/windows/registry"
"os/exec"
"path/filepath"
)

func msiexec(target, product, operation string, args []string) (*exec.Cmd, error) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,8 +5,7 @@

//go:build !windows

// Package service provides a way to interact with os services
package service
package packages

import (
"context"
Expand All @@ -17,7 +16,7 @@ import (
"path"
"path/filepath"

"github.com/DataDog/datadog-agent/pkg/fleet/installer/service/embedded"
"github.com/DataDog/datadog-agent/pkg/fleet/installer/packages/embedded"
"github.com/DataDog/datadog-agent/pkg/util/log"
"gopkg.in/DataDog/dd-trace-go.v1/ddtrace/tracer"
)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,8 +5,7 @@

//go:build windows

// Package service provides a way to interact with os services
package service
package packages

// IsSystemdRunning noop
func IsSystemdRunning() (running bool, err error) {
Expand Down

0 comments on commit 8c32e54

Please sign in to comment.