Skip to content

Commit ae677f4

Browse files
committed
Fix docs
Signed-off-by: Zachary Nixon <nixozach@amazon.com>
1 parent 681b78a commit ae677f4

18 files changed

Lines changed: 194 additions & 48 deletions

File tree

api/v1alpha1/envoygateway_helpers.go

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -89,8 +89,6 @@ func (e *EnvoyGateway) SetEnvoyGatewayDefaults() {
8989
}
9090
}
9191

92-
func (e *EnvoyGateway) handleProviderDefaults() {}
93-
9492
// GetEnvoyGatewayAdmin returns the EnvoyGatewayAdmin of EnvoyGateway or a default EnvoyGatewayAdmin if unspecified.
9593
func (e *EnvoyGateway) GetEnvoyGatewayAdmin() *EnvoyGatewayAdmin {
9694
if e.Admin != nil {

api/v1alpha1/envoygateway_helpers_test.go

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,8 @@
1+
// Copyright Envoy Gateway Authors
2+
// SPDX-License-Identifier: Apache-2.0
3+
// The full text of the Apache license is available in the LICENSE file at
4+
// the root of the repo.
5+
16
package v1alpha1
27

38
import (

api/v1alpha1/envoygateway_types.go

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -353,6 +353,7 @@ type EnvoyGatewayProvider struct {
353353
Custom *EnvoyGatewayCustomProvider `json:"custom,omitempty"`
354354
}
355355

356+
// EnvoyGatewayKubernetesInfrastructureConfiguration defines configuration for the Kubernetes infrastructure provider.
356357
type EnvoyGatewayKubernetesInfrastructureConfiguration struct {
357358
// RateLimitDeployment defines the desired state of the Envoy ratelimit deployment resource.
358359
// If unspecified, default settings for the managed Envoy ratelimit deployment resource
@@ -386,6 +387,7 @@ type EnvoyGatewayKubernetesInfrastructureConfiguration struct {
386387
TopologyInjector *EnvoyGatewayTopologyInjector `json:"proxyTopologyInjector,omitempty"`
387388
}
388389

390+
// EnvoyGatewayKubernetesConfiguration defines configuration for how Envoy Gateway communicates with the Kubernetes API server.
389391
type EnvoyGatewayKubernetesConfiguration struct {
390392
// Watch holds configuration of which input resources should be watched and reconciled.
391393
// +optional
@@ -493,7 +495,7 @@ type EnvoyGatewayCustomProvider struct {
493495

494496
// ResourceProviderType defines the types of custom resource providers supported by Envoy Gateway.
495497
//
496-
// +kubebuilder:validation:Enum=File,Kubernetes
498+
// +kubebuilder:validation:Enum=File;Kubernetes
497499
type ResourceProviderType string
498500

499501
const (

internal/cmd/egctl/translate.go

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,6 @@ import (
1313
"os"
1414
"sort"
1515

16-
"github.com/envoyproxy/gateway/internal/globalratelimit"
1716
adminv3 "github.com/envoyproxy/go-control-plane/envoy/admin/v3"
1817
bootstrapv3 "github.com/envoyproxy/go-control-plane/envoy/config/bootstrap/v3"
1918
resourcev3 "github.com/envoyproxy/go-control-plane/pkg/resource/v3"
@@ -29,6 +28,7 @@ import (
2928
"github.com/envoyproxy/gateway/internal/gatewayapi"
3029
"github.com/envoyproxy/gateway/internal/gatewayapi/resource"
3130
"github.com/envoyproxy/gateway/internal/gatewayapi/status"
31+
"github.com/envoyproxy/gateway/internal/globalratelimit"
3232
"github.com/envoyproxy/gateway/internal/logging"
3333
"github.com/envoyproxy/gateway/internal/xds/bootstrap"
3434
"github.com/envoyproxy/gateway/internal/xds/translator"
@@ -383,7 +383,7 @@ func TranslateGatewayAPIToXds(namespace, dnsDomain, resourceType string, resourc
383383
xTranslator := &translator.Translator{
384384
// Set some default settings for translation
385385
GlobalRateLimit: &translator.GlobalRateLimitSettings{
386-
ServiceURL: globalratelimit.GetRateLimitUrl(nil, namespace, dnsDomain),
386+
ServiceURL: globalratelimit.GetRateLimitURL(nil, namespace, dnsDomain),
387387
},
388388
Logger: logging.DefaultLogger(io.Discard, egv1a1.LogLevelInfo),
389389
}

internal/crypto/certgen.go

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -114,8 +114,9 @@ func GenerateCerts(cfg *config.Server) (*Certificates, error) {
114114
// For custom provider (host mode), use localhost for xDS communication
115115
egDNSNames = []string{"localhost"}
116116
envoyDNSNames = []string{"localhost"}
117-
} else {
118-
// Kubernetes is the only supported Envoy Gateway provider.
117+
}
118+
119+
if len(egDNSNames) == 0 {
119120
return nil, fmt.Errorf("unsupported provider type %v", egProvider)
120121
}
121122

internal/extension/grpc.go

Lines changed: 10 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,8 @@
1+
// Copyright Envoy Gateway Authors
2+
// SPDX-License-Identifier: Apache-2.0
3+
// The full text of the Apache license is available in the LICENSE file at
4+
// the root of the repo.
5+
16
package extension
27

38
import (
@@ -12,9 +17,6 @@ import (
1217
"strings"
1318
"time"
1419

15-
egv1a1 "github.com/envoyproxy/gateway/api/v1alpha1"
16-
"github.com/envoyproxy/gateway/internal/kubernetes"
17-
"github.com/envoyproxy/gateway/internal/utils/fraction"
1820
"google.golang.org/grpc"
1921
"google.golang.org/grpc/codes"
2022
"google.golang.org/grpc/credentials"
@@ -25,6 +27,10 @@ import (
2527
"k8s.io/utils/ptr"
2628
k8scli "sigs.k8s.io/controller-runtime/pkg/client"
2729
gwapiv1 "sigs.k8s.io/gateway-api/apis/v1"
30+
31+
egv1a1 "github.com/envoyproxy/gateway/api/v1alpha1"
32+
"github.com/envoyproxy/gateway/internal/kubernetes"
33+
"github.com/envoyproxy/gateway/internal/utils/fraction"
2834
)
2935

3036
const grpcServiceConfigTemplate = `{
@@ -57,7 +63,7 @@ func GetExtensionServerAddress(service *egv1a1.ExtensionService) string {
5763
}
5864

5965
// GenerateGRPCOptions generates the necessary connection descriptors for a GRPC client.
60-
func GenerateGRPCOptions(ctx context.Context, client k8scli.Client, ext *egv1a1.ExtensionService, maxMessageSize *resource.Quantity, svcName string, namespace string) ([]grpc.DialOption, error) {
66+
func GenerateGRPCOptions(ctx context.Context, client k8scli.Client, ext *egv1a1.ExtensionService, maxMessageSize *resource.Quantity, svcName, namespace string) ([]grpc.DialOption, error) {
6167
// These two errors shouldn't happen since we check these conditions when loading the extension
6268
if ext == nil {
6369
return nil, errors.New("the registered extension's config is nil")

internal/extension/grpc_test.go

Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,8 @@
1+
// Copyright Envoy Gateway Authors
2+
// SPDX-License-Identifier: Apache-2.0
3+
// The full text of the Apache license is available in the LICENSE file at
4+
// the root of the repo.
5+
16
package extension
27

38
import (
@@ -7,12 +12,13 @@ import (
712
"reflect"
813
"testing"
914

10-
egv1a1 "github.com/envoyproxy/gateway/api/v1alpha1"
11-
"github.com/envoyproxy/gateway/internal/envoygateway"
1215
"google.golang.org/grpc"
1316
"k8s.io/apimachinery/pkg/api/resource"
1417
fakeclient "sigs.k8s.io/controller-runtime/pkg/client/fake"
1518
gwapiv1 "sigs.k8s.io/gateway-api/apis/v1"
19+
20+
egv1a1 "github.com/envoyproxy/gateway/api/v1alpha1"
21+
"github.com/envoyproxy/gateway/internal/envoygateway"
1622
)
1723

1824
func Test_GenerateGRPCOptions(t *testing.T) {

internal/extension/registry/extension_manager_test.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,6 @@ import (
1616
"sync"
1717
"testing"
1818

19-
grpcExtension "github.com/envoyproxy/gateway/internal/extension"
2019
clusterv3 "github.com/envoyproxy/go-control-plane/envoy/config/cluster/v3"
2120
listenerv3 "github.com/envoyproxy/go-control-plane/envoy/config/listener/v3"
2221
routev3 "github.com/envoyproxy/go-control-plane/envoy/config/route/v3"
@@ -36,6 +35,7 @@ import (
3635
egv1a1 "github.com/envoyproxy/gateway/api/v1alpha1"
3736
"github.com/envoyproxy/gateway/internal/envoygateway"
3837
"github.com/envoyproxy/gateway/internal/envoygateway/config"
38+
grpcExtension "github.com/envoyproxy/gateway/internal/extension"
3939
extTypes "github.com/envoyproxy/gateway/internal/extension/types"
4040
"github.com/envoyproxy/gateway/internal/ir"
4141
"github.com/envoyproxy/gateway/proto/extension"

internal/gatewayapi/status/gateway.go

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -169,10 +169,10 @@ func updateGatewayProgrammedCondition(gw *gwapiv1.Gateway, envoyObj client.Objec
169169

170170
if isInfraRemote {
171171
// We won't expect any Envoy replicas, hence we can assume (and document) that the remote provider should
172-
// guarantee the Envoy addresses are made available IIF the Envoy data plane is ready to serve traffic.
172+
// guarantee the Envoy addresses are made available if the Envoy data plane is ready to serve traffic.
173173
gw.Status.Conditions = MergeConditions(gw.Status.Conditions,
174174
newCondition(string(gwapiv1.GatewayConditionProgrammed), metav1.ConditionTrue, string(gwapiv1.GatewayConditionProgrammed),
175-
fmt.Sprintf(messageFmtProgrammedRemotely), gw.Generation))
175+
fmt.Sprint(messageFmtProgrammedRemotely), gw.Generation))
176176
return
177177
}
178178

internal/globalratelimit/resource.go

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,17 @@
1+
// Copyright Envoy Gateway Authors
2+
// SPDX-License-Identifier: Apache-2.0
3+
// The full text of the Apache license is available in the LICENSE file at
4+
// the root of the repo.
5+
16
package globalratelimit
27

38
import (
49
egv1a1 "github.com/envoyproxy/gateway/api/v1alpha1"
510
"github.com/envoyproxy/gateway/internal/infrastructure/kubernetes/ratelimit"
611
)
712

8-
// GetRateLimitUrl returns the URL for the rate limit service.
9-
func GetRateLimitUrl(eg *egv1a1.EnvoyGateway, namespace, dnsDomain string) string {
13+
// GetRateLimitURL returns the URL for the rate limit service.
14+
func GetRateLimitURL(eg *egv1a1.EnvoyGateway, namespace, dnsDomain string) string {
1015
if eg != nil && eg.RateLimit != nil && eg.RateLimit.URL != nil {
1116
return *eg.RateLimit.URL
1217
}

0 commit comments

Comments
 (0)