Skip to content

Commit

Permalink
Split pbmesh.UpstreamsConfiguration out of pbmesh.Upstreams
Browse files Browse the repository at this point in the history
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.
  • Loading branch information
ishustava committed Jul 5, 2023
1 parent 0b1299c commit b46c9e2
Show file tree
Hide file tree
Showing 13 changed files with 1,271 additions and 780 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
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 @@ -25,7 +25,7 @@ var (

func RegisterUpstreams(r resource.Registry) {
r.Register(resource.Registration{
Type: UpstreamsV1Alpha1Type,
Type: UpstreamsType,
Proto: &pbmesh.Upstreams{},
Validate: nil,
})
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: CurrentVersion,
Kind: UpstreamsConfigurationKind,
}

UpstreamsConfigurationType = UpstreamsConfigurationV1Alpha1Type
)

func RegisterUpstreamsConfiguration(r resource.Registry) {
r.Register(resource.Registration{
Type: UpstreamsConfigurationType,
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 b46c9e2

Please sign in to comment.