Skip to content

Commit

Permalink
Split pbmesh.UpstreamsConfiguration as a resource out of pbmesh.Upstr…
Browse files Browse the repository at this point in the history
…eams (#17991)

Configuration that previously was inlined into the Upstreams resource
applies to both explicit and implicit upstreams and so it makes sense to
split it out into its own resource.

It also has other minor changes:
- Renames `proxy.proto` proxy_configuration.proto`
- Changes the type of `Upstream.destination_ref` from `pbresource.ID` to
`pbresource.Reference`
- Adds comments to fields that didn't have them
  • Loading branch information
ishustava authored Jul 13, 2023
1 parent efe9816 commit c328ba8
Show file tree
Hide file tree
Showing 14 changed files with 1,278 additions and 785 deletions.
5 changes: 3 additions & 2 deletions internal/mesh/exports.go
Original file line number Diff line number Diff line change
Expand Up @@ -22,8 +22,9 @@ var (

// Resource Types for the v1alpha1 version.

ProxyConfigurationV1Alpha1Type = types.ProxyConfigurationV1Alpha1Type
UpstreamsV1Alpha1Type = types.UpstreamsV1Alpha1Type
ProxyConfigurationV1Alpha1Type = types.ProxyConfigurationV1Alpha1Type
UpstreamsV1Alpha1Type = types.UpstreamsV1Alpha1Type
UpstreamsConfigurationV1Alpha1Type = types.UpstreamsConfigurationV1Alpha1Type
)

// RegisterTypes adds all resource types within the "catalog" API group
Expand Down
2 changes: 1 addition & 1 deletion internal/mesh/internal/types/proxy_configuration.go
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ const (
var (
ProxyConfigurationV1Alpha1Type = &pbresource.Type{
Group: GroupName,
GroupVersion: CurrentVersion,
GroupVersion: VersionV1Alpha1,
Kind: ProxyConfigurationKind,
}

Expand Down
1 change: 1 addition & 0 deletions internal/mesh/internal/types/types.go
Original file line number Diff line number Diff line change
Expand Up @@ -16,4 +16,5 @@ const (
func Register(r resource.Registry) {
RegisterProxyConfiguration(r)
RegisterUpstreams(r)
RegisterUpstreamsConfiguration(r)
}
2 changes: 1 addition & 1 deletion internal/mesh/internal/types/upstreams.go
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ const (
var (
UpstreamsV1Alpha1Type = &pbresource.Type{
Group: GroupName,
GroupVersion: CurrentVersion,
GroupVersion: VersionV1Alpha1,
Kind: UpstreamsKind,
}

Expand Down
32 changes: 32 additions & 0 deletions internal/mesh/internal/types/upstreams_configuration.go
Original file line number Diff line number Diff line change
@@ -0,0 +1,32 @@
// Copyright (c) HashiCorp, Inc.
// SPDX-License-Identifier: MPL-2.0

package types

import (
"github.com/hashicorp/consul/internal/resource"
pbmesh "github.com/hashicorp/consul/proto-public/pbmesh/v1alpha1"
"github.com/hashicorp/consul/proto-public/pbresource"
)

const (
UpstreamsConfigurationKind = "UpstreamsConfiguration"
)

var (
UpstreamsConfigurationV1Alpha1Type = &pbresource.Type{
Group: GroupName,
GroupVersion: VersionV1Alpha1,
Kind: UpstreamsConfigurationKind,
}

UpstreamsConfigurationType = UpstreamsConfigurationV1Alpha1Type
)

func RegisterUpstreamsConfiguration(r resource.Registry) {
r.Register(resource.Registration{
Type: UpstreamsConfigurationV1Alpha1Type,
Proto: &pbmesh.UpstreamsConfiguration{},
Validate: nil,
})
}

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

Large diffs are not rendered by default.

File renamed without changes.
34 changes: 2 additions & 32 deletions proto-public/pbmesh/v1alpha1/upstreams.pb.binary.go

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

Loading

0 comments on commit c328ba8

Please sign in to comment.