Skip to content

Commit

Permalink
Revert "Source package info delivery to control-plane (#639)" (#656)
Browse files Browse the repository at this point in the history
This reverts commit ab4c8a3.
  • Loading branch information
burov authored Aug 22, 2024
1 parent 98f0b09 commit 235ada8
Show file tree
Hide file tree
Showing 45 changed files with 58 additions and 121 deletions.
2 changes: 1 addition & 1 deletion agentendpoint/agentendpoint.go
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,7 @@ import (
"google.golang.org/grpc/status"
"google.golang.org/protobuf/proto"

"cloud.google.com/go/osconfig/agentendpoint/apiv1/agentendpointpb"
agentendpointpb "google.golang.org/genproto/googleapis/cloud/osconfig/agentendpoint/v1"
)

const apiRetrySec = 600
Expand Down
2 changes: 1 addition & 1 deletion agentendpoint/agentendpoint_beta.go
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ import (
"google.golang.org/grpc"
"google.golang.org/grpc/credentials"

"cloud.google.com/go/osconfig/agentendpoint/apiv1beta/agentendpointpb"
agentendpointpb "google.golang.org/genproto/googleapis/cloud/osconfig/agentendpoint/v1beta"
)

// BetaClient is a an agentendpoint client.
Expand Down
2 changes: 1 addition & 1 deletion agentendpoint/agentendpoint_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,7 @@ import (
"google.golang.org/grpc/status"
"google.golang.org/grpc/test/bufconn"

"cloud.google.com/go/osconfig/agentendpoint/apiv1/agentendpointpb"
agentendpointpb "google.golang.org/genproto/googleapis/cloud/osconfig/agentendpoint/v1"
)

var testIDToken string
Expand Down
2 changes: 1 addition & 1 deletion agentendpoint/config_task.go
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ import (
"github.com/GoogleCloudPlatform/osconfig/config"
"github.com/GoogleCloudPlatform/osconfig/pretty"

"cloud.google.com/go/osconfig/agentendpoint/apiv1/agentendpointpb"
agentendpointpb "google.golang.org/genproto/googleapis/cloud/osconfig/agentendpoint/v1"
)

// This is the maximum size in bytes of the OSPolicyResourceConfigStep ErrorMessage field.
Expand Down
2 changes: 1 addition & 1 deletion agentendpoint/config_task_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ import (
"google.golang.org/grpc/status"
"google.golang.org/protobuf/testing/protocmp"

"cloud.google.com/go/osconfig/agentendpoint/apiv1/agentendpointpb"
agentendpointpb "google.golang.org/genproto/googleapis/cloud/osconfig/agentendpoint/v1"
)

var errTest = errors.New("this is a test error")
Expand Down
2 changes: 1 addition & 1 deletion agentendpoint/exec_task.go
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ import (
"github.com/GoogleCloudPlatform/osconfig/external"
"github.com/GoogleCloudPlatform/osconfig/util"

"cloud.google.com/go/osconfig/agentendpoint/apiv1/agentendpointpb"
agentendpointpb "google.golang.org/genproto/googleapis/cloud/osconfig/agentendpoint/v1"
)

var (
Expand Down
2 changes: 1 addition & 1 deletion agentendpoint/exec_task_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ import (
"google.golang.org/grpc/status"
"google.golang.org/protobuf/testing/protocmp"

"cloud.google.com/go/osconfig/agentendpoint/apiv1/agentendpointpb"
agentendpointpb "google.golang.org/genproto/googleapis/cloud/osconfig/agentendpoint/v1"
)

type agentEndpointServiceExecTestServer struct {
Expand Down
33 changes: 5 additions & 28 deletions agentendpoint/inventory.go
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ import (
"github.com/GoogleCloudPlatform/osconfig/retryutil"
"google.golang.org/protobuf/types/known/timestamppb"

"cloud.google.com/go/osconfig/agentendpoint/apiv1/agentendpointpb"
agentendpointpb "google.golang.org/genproto/googleapis/cloud/osconfig/agentendpoint/v1"
datepb "google.golang.org/genproto/googleapis/type/date"
)

Expand Down Expand Up @@ -225,23 +225,12 @@ func formatPackages(ctx context.Context, pkgs *packages.Packages, shortName stri
}

func formatAptPackage(pkg *packages.PkgInfo) *agentendpointpb.Inventory_SoftwarePackage_AptPackage {
fPkg := &agentendpointpb.Inventory_SoftwarePackage_AptPackage{
return &agentendpointpb.Inventory_SoftwarePackage_AptPackage{
AptPackage: &agentendpointpb.Inventory_VersionedPackage{
PackageName: pkg.Name,
Architecture: pkg.Arch,
Version: pkg.Version,
},
}

// for some of the APT packages source package might be available.
if pkg.Source.Name != "" {
fPkg.AptPackage.Source = &agentendpointpb.Inventory_VersionedPackage_Source{
Name: pkg.Source.Name,
Version: pkg.Source.Version,
}
}

return fPkg
}}
}

func formatCOSPackage(pkg *packages.PkgInfo) *agentendpointpb.Inventory_SoftwarePackage_CosPackage {
Expand All @@ -263,23 +252,11 @@ func formatGooGetPackage(pkg *packages.PkgInfo) *agentendpointpb.Inventory_Softw
}

func formatYumPackage(pkg *packages.PkgInfo) *agentendpointpb.Inventory_SoftwarePackage_YumPackage {
fPkg := &agentendpointpb.Inventory_SoftwarePackage_YumPackage{
return &agentendpointpb.Inventory_SoftwarePackage_YumPackage{
YumPackage: &agentendpointpb.Inventory_VersionedPackage{
PackageName: pkg.Name,
Architecture: pkg.Arch,
Version: pkg.Version,
},
}

// for some of the YUM packages source package might be available.
if pkg.Source.Name != "" {
fPkg.YumPackage.Source = &agentendpointpb.Inventory_VersionedPackage_Source{
Name: pkg.Source.Name,
Version: pkg.Source.Version,
}
}

return fPkg
Version: pkg.Version}}
}

func formatZypperPackage(pkg *packages.PkgInfo) *agentendpointpb.Inventory_SoftwarePackage_ZypperPackage {
Expand Down
56 changes: 9 additions & 47 deletions agentendpoint/inventory_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@ import (
"google.golang.org/protobuf/testing/protocmp"
"google.golang.org/protobuf/types/known/timestamppb"

"cloud.google.com/go/osconfig/agentendpoint/apiv1/agentendpointpb"
agentendpointpb "google.golang.org/genproto/googleapis/cloud/osconfig/agentendpoint/v1"
)

type agentEndpointServiceInventoryTestServer struct {
Expand Down Expand Up @@ -84,28 +84,10 @@ func generateInventoryState() *inventory.InstanceInventory {
KernelRelease: "KernelRelease",
OSConfigAgentVersion: "OSConfigAgentVersion",
InstalledPackages: &packages.Packages{
Yum: []*packages.PkgInfo{{
Name: "YumInstalledPkg",
Arch: "Arch",
Version: "Version",
Source: packages.Source{Name: "SourceName", Version: "SourceVersion"}}},

Rpm: []*packages.PkgInfo{{
Name: "RpmInstalledPkg",
Arch: "Arch",
Version: "Version",
Source: packages.Source{Name: "SourceName", Version: "SourceVersion"}}},

Apt: []*packages.PkgInfo{{
Name: "AptInstalledPkg",
Arch: "Arch",
Version: "Version",
Source: packages.Source{Name: "SourceName", Version: "SourceVersion"}}},
Deb: []*packages.PkgInfo{{
Name: "DebInstalledPkg",
Arch: "Arch",
Version: "Version",
Source: packages.Source{Name: "SourceName", Version: "SourceVersion"}}},
Yum: []*packages.PkgInfo{{Name: "YumInstalledPkg", Arch: "Arch", Version: "Version"}},
Rpm: []*packages.PkgInfo{{Name: "RpmInstalledPkg", Arch: "Arch", Version: "Version"}},
Apt: []*packages.PkgInfo{{Name: "AptInstalledPkg", Arch: "Arch", Version: "Version"}},
Deb: []*packages.PkgInfo{{Name: "DebInstalledPkg", Arch: "Arch", Version: "Version"}},
Zypper: []*packages.PkgInfo{{Name: "ZypperInstalledPkg", Arch: "Arch", Version: "Version"}},
ZypperPatches: []*packages.ZypperPatch{{Name: "ZypperInstalledPatch", Category: "Category", Severity: "Severity", Summary: "Summary"}},
Gem: []*packages.PkgInfo{{Name: "GemInstalledPkg", Arch: "Arch", Version: "Version"}},
Expand Down Expand Up @@ -166,23 +148,13 @@ func generateInventory() *agentendpointpb.Inventory {
AptPackage: &agentendpointpb.Inventory_VersionedPackage{
PackageName: "AptInstalledPkg",
Architecture: "Arch",
Version: "Version",
Source: &agentendpointpb.Inventory_VersionedPackage_Source{
Name: "SourceName",
Version: "SourceVersion",
},
}}},
Version: "Version"}}},
{
Details: &agentendpointpb.Inventory_SoftwarePackage_AptPackage{
AptPackage: &agentendpointpb.Inventory_VersionedPackage{
PackageName: "DebInstalledPkg",
Architecture: "Arch",
Version: "Version",
Source: &agentendpointpb.Inventory_VersionedPackage_Source{
Name: "SourceName",
Version: "SourceVersion",
},
}}},
Version: "Version"}}},
{
Details: &agentendpointpb.Inventory_SoftwarePackage_GoogetPackage{
GoogetPackage: &agentendpointpb.Inventory_VersionedPackage{
Expand All @@ -194,12 +166,7 @@ func generateInventory() *agentendpointpb.Inventory {
YumPackage: &agentendpointpb.Inventory_VersionedPackage{
PackageName: "YumInstalledPkg",
Architecture: "Arch",
Version: "Version",
Source: &agentendpointpb.Inventory_VersionedPackage_Source{
Name: "SourceName",
Version: "SourceVersion",
},
}}},
Version: "Version"}}},
{
Details: &agentendpointpb.Inventory_SoftwarePackage_ZypperPackage{
ZypperPackage: &agentendpointpb.Inventory_VersionedPackage{
Expand All @@ -211,12 +178,7 @@ func generateInventory() *agentendpointpb.Inventory {
YumPackage: &agentendpointpb.Inventory_VersionedPackage{
PackageName: "RpmInstalledPkg",
Architecture: "Arch",
Version: "Version",
Source: &agentendpointpb.Inventory_VersionedPackage_Source{
Name: "SourceName",
Version: "SourceVersion",
},
}}},
Version: "Version"}}},
{
Details: &agentendpointpb.Inventory_SoftwarePackage_ZypperPatch{
ZypperPatch: &agentendpointpb.Inventory_ZypperPatch{
Expand Down
2 changes: 1 addition & 1 deletion agentendpoint/patch_linux.go
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ import (
"github.com/GoogleCloudPlatform/osconfig/packages"
"github.com/GoogleCloudPlatform/osconfig/retryutil"

"cloud.google.com/go/osconfig/agentendpoint/apiv1/agentendpointpb"
agentendpointpb "google.golang.org/genproto/googleapis/cloud/osconfig/agentendpoint/v1"
)

func (r *patchTask) runUpdates(ctx context.Context) error {
Expand Down
2 changes: 1 addition & 1 deletion agentendpoint/patch_task.go
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ import (
"github.com/GoogleCloudPlatform/osconfig/ospatch"
"google.golang.org/protobuf/encoding/protojson"

"cloud.google.com/go/osconfig/agentendpoint/apiv1/agentendpointpb"
agentendpointpb "google.golang.org/genproto/googleapis/cloud/osconfig/agentendpoint/v1"
)

func systemRebootRequired(ctx context.Context) (bool, error) {
Expand Down
2 changes: 1 addition & 1 deletion agentendpoint/patch_windows.go
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ import (
"github.com/GoogleCloudPlatform/osconfig/packages"
"github.com/GoogleCloudPlatform/osconfig/retryutil"

"cloud.google.com/go/osconfig/agentendpoint/apiv1/agentendpointpb"
agentendpointpb "google.golang.org/genproto/googleapis/cloud/osconfig/agentendpoint/v1"
)

func (r *patchTask) classFilter() ([]string, error) {
Expand Down
2 changes: 1 addition & 1 deletion agentendpoint/task_state_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ import (
"github.com/google/go-cmp/cmp/cmpopts"
"google.golang.org/protobuf/testing/protocmp"

"cloud.google.com/go/osconfig/agentendpoint/apiv1/agentendpointpb"
agentendpointpb "google.golang.org/genproto/googleapis/cloud/osconfig/agentendpoint/v1"
)

var (
Expand Down
2 changes: 1 addition & 1 deletion config/config.go
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ import (
"fmt"
"runtime"

"cloud.google.com/go/osconfig/agentendpoint/apiv1/agentendpointpb"
agentendpointpb "google.golang.org/genproto/googleapis/cloud/osconfig/agentendpoint/v1"
)

var goos = runtime.GOOS
Expand Down
2 changes: 1 addition & 1 deletion config/exec_resource.go
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ import (
"github.com/GoogleCloudPlatform/osconfig/clog"
"github.com/GoogleCloudPlatform/osconfig/util"

"cloud.google.com/go/osconfig/agentendpoint/apiv1/agentendpointpb"
agentendpointpb "google.golang.org/genproto/googleapis/cloud/osconfig/agentendpoint/v1"
)

const maxExecOutputSize = 500 * 1024
Expand Down
2 changes: 1 addition & 1 deletion config/exec_resource_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ import (
"reflect"
"testing"

"cloud.google.com/go/osconfig/agentendpoint/apiv1/agentendpointpb"
agentendpointpb "google.golang.org/genproto/googleapis/cloud/osconfig/agentendpoint/v1"
)

func TestExecResourceDownload(t *testing.T) {
Expand Down
2 changes: 1 addition & 1 deletion config/file.go
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ import (
"github.com/GoogleCloudPlatform/osconfig/external"
"github.com/GoogleCloudPlatform/osconfig/util"

"cloud.google.com/go/osconfig/agentendpoint/apiv1/agentendpointpb"
agentendpointpb "google.golang.org/genproto/googleapis/cloud/osconfig/agentendpoint/v1"
)

func checksum(r io.Reader) string {
Expand Down
2 changes: 1 addition & 1 deletion config/file_resource.go
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ import (
"github.com/GoogleCloudPlatform/osconfig/clog"
"github.com/GoogleCloudPlatform/osconfig/util"

"cloud.google.com/go/osconfig/agentendpoint/apiv1/agentendpointpb"
agentendpointpb "google.golang.org/genproto/googleapis/cloud/osconfig/agentendpoint/v1"
)

const defaultFilePerms = 0644
Expand Down
2 changes: 1 addition & 1 deletion config/file_resource_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ import (
"github.com/GoogleCloudPlatform/osconfig/util"
"github.com/google/go-cmp/cmp"

"cloud.google.com/go/osconfig/agentendpoint/apiv1/agentendpointpb"
agentendpointpb "google.golang.org/genproto/googleapis/cloud/osconfig/agentendpoint/v1"
)

func TestFileResourceValidate(t *testing.T) {
Expand Down
2 changes: 1 addition & 1 deletion config/package_resource.go
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ import (
"github.com/GoogleCloudPlatform/osconfig/packages"
"github.com/GoogleCloudPlatform/osconfig/util"

"cloud.google.com/go/osconfig/agentendpoint/apiv1/agentendpointpb"
agentendpointpb "google.golang.org/genproto/googleapis/cloud/osconfig/agentendpoint/v1"
"google.golang.org/protobuf/proto"
)

Expand Down
2 changes: 1 addition & 1 deletion config/package_resource_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ import (
"github.com/google/go-cmp/cmp"
"google.golang.org/protobuf/testing/protocmp"

"cloud.google.com/go/osconfig/agentendpoint/apiv1/agentendpointpb"
agentendpointpb "google.golang.org/genproto/googleapis/cloud/osconfig/agentendpoint/v1"
)

var (
Expand Down
2 changes: 1 addition & 1 deletion config/repository_resource.go
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@ import (
"golang.org/x/crypto/openpgp"
"golang.org/x/crypto/openpgp/armor"

"cloud.google.com/go/osconfig/agentendpoint/apiv1/agentendpointpb"
agentendpointpb "google.golang.org/genproto/googleapis/cloud/osconfig/agentendpoint/v1"
)

const aptGPGDir = "/etc/apt/trusted.gpg.d"
Expand Down
2 changes: 1 addition & 1 deletion config/repository_resource_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ import (
"github.com/google/go-cmp/cmp"
"google.golang.org/protobuf/testing/protocmp"

"cloud.google.com/go/osconfig/agentendpoint/apiv1/agentendpointpb"
agentendpointpb "google.golang.org/genproto/googleapis/cloud/osconfig/agentendpoint/v1"
)

var (
Expand Down

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion e2e_tests/osconfig_server/osconfig_data_builder.go
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ package osconfigserver
import (
"fmt"

"cloud.google.com/go/osconfig/apiv1beta/osconfigpb"
osconfigpb "google.golang.org/genproto/googleapis/cloud/osconfig/v1beta"
)

// BuildPackagePolicy creates an package policy.
Expand Down
2 changes: 1 addition & 1 deletion e2e_tests/test_suites/guestpolicies/guest_policies.go
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@ import (
"github.com/kylelemons/godebug/pretty"
computeApi "google.golang.org/api/compute/v1"

"cloud.google.com/go/osconfig/apiv1beta/osconfigpb"
osconfigpb "google.golang.org/genproto/googleapis/cloud/osconfig/v1beta"
)

var (
Expand Down
Loading

0 comments on commit 235ada8

Please sign in to comment.