Skip to content

Commit

Permalink
Add tooling to automatically sync proto versions (#2021)
Browse files Browse the repository at this point in the history
* Add script to sync protobuf versions

* Updates to protobuf files

* Update generated code

* Fix release locks
  • Loading branch information
howardjohn authored Jul 1, 2021
1 parent 2cccf2e commit 88e56fb
Show file tree
Hide file tree
Showing 32 changed files with 170 additions and 59 deletions.
3 changes: 3 additions & 0 deletions gen.sh
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,9 @@

set -eu

# Sync API versions
scripts/sync.sh

# Generate all protos
buf generate \
--path networking \
Expand Down
3 changes: 3 additions & 0 deletions networking/v1alpha3/destination_rule.pb.go

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

15 changes: 9 additions & 6 deletions networking/v1alpha3/destination_rule.proto
Original file line number Diff line number Diff line change
Expand Up @@ -194,6 +194,9 @@ option go_package = "istio.io/api/networking/v1alpha3";
// +genclient
// +k8s:deepcopy-gen=true
// -->
// <!-- istio code generation tags
// +istio.io/sync-start
// -->
message DestinationRule {
// The name of a service from the service registry. Service
// names are looked up from the platform's service registry (e.g.,
Expand Down Expand Up @@ -615,13 +618,13 @@ message ConnectionPoolSettings {
// cluster at a given time. Defaults to 2^32-1.
int32 max_retries = 4;

// The idle timeout for upstream connection pool connections. The idle timeout
// The idle timeout for upstream connection pool connections. The idle timeout
// is defined as the period in which there are no active requests.
// If not set, the default is 1 hour. When the idle timeout is reached,
// the connection will be closed. If the connection is an HTTP/2
// connection a drain sequence will occur prior to closing the connection.
// Note that request based timeouts mean that HTTP/2 PINGs will not
// keep the connection alive. Applies to both HTTP1.1 and HTTP2 connections.
// If not set, the default is 1 hour. When the idle timeout is reached,
// the connection will be closed. If the connection is an HTTP/2
// connection a drain sequence will occur prior to closing the connection.
// Note that request based timeouts mean that HTTP/2 PINGs will not
// keep the connection alive. Applies to both HTTP1.1 and HTTP2 connections.
google.protobuf.Duration idle_timeout = 5;

// Policy for upgrading http1.1 connections to http2.
Expand Down
3 changes: 3 additions & 0 deletions networking/v1alpha3/gateway.pb.go

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

7 changes: 5 additions & 2 deletions networking/v1alpha3/gateway.proto
Original file line number Diff line number Diff line change
Expand Up @@ -372,6 +372,9 @@ option go_package = "istio.io/api/networking/v1alpha3";
// +genclient
// +k8s:deepcopy-gen=true
// -->
// <!-- istio code generation tags
// +istio.io/sync-start
// -->
message Gateway {
// A list of server specifications.
repeated Server servers = 1 [(google.api.field_behavior) = REQUIRED];
Expand Down Expand Up @@ -675,8 +678,8 @@ message ServerTLSSettings {
// holds the TLS certs including the CA certificates. Applicable
// only on Kubernetes. The secret (of type `generic`) should
// contain the following keys and values: `key:
// <privateKey>` and `cert: <serverCert>`. For mutual TLS,
// `cacert: <CACertificate>` can be provided in the same secret or
// <privateKey>` and `cert: <serverCert>`. For mutual TLS,
// `cacert: <CACertificate>` can be provided in the same secret or
// a separate secret named `<secret>-cacert`.
// Secret of type tls for server certificates along with
// ca.crt key for CA certificates is also supported.
Expand Down
3 changes: 3 additions & 0 deletions networking/v1alpha3/service_entry.pb.go

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

3 changes: 3 additions & 0 deletions networking/v1alpha3/service_entry.proto
Original file line number Diff line number Diff line change
Expand Up @@ -805,6 +805,9 @@ option go_package = "istio.io/api/networking/v1alpha3";
// +genclient
// +k8s:deepcopy-gen=true
// -->
// <!-- istio code generation tags
// +istio.io/sync-start
// -->
message ServiceEntry {
// The hosts associated with the ServiceEntry. Could be a DNS
// name with wildcard prefix.
Expand Down
3 changes: 3 additions & 0 deletions networking/v1alpha3/sidecar.pb.go

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

5 changes: 4 additions & 1 deletion networking/v1alpha3/sidecar.proto
Original file line number Diff line number Diff line change
Expand Up @@ -427,6 +427,9 @@ option go_package = "istio.io/api/networking/v1alpha3";
// +genclient
// +k8s:deepcopy-gen=true
// -->
// <!-- istio code generation tags
// +istio.io/sync-start
// -->
message Sidecar {
// Criteria used to select the specific set of pods/VMs on which this
// `Sidecar` configuration should be applied. If omitted, the `Sidecar`
Expand Down Expand Up @@ -607,7 +610,7 @@ message OutboundTrafficPolicy {
// Envoy's dynamic forward proxy can handle only HTTP and TLS
// connections.
// $hide_from_docs
istio.networking.v1alpha3.Destination egress_proxy = 2;
Destination egress_proxy = 2;
}


Expand Down
8 changes: 4 additions & 4 deletions networking/v1alpha3/virtual_service.pb.go

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

5 changes: 1 addition & 4 deletions networking/v1alpha3/virtual_service.pb.html

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

8 changes: 4 additions & 4 deletions networking/v1alpha3/virtual_service.proto
Original file line number Diff line number Diff line change
Expand Up @@ -202,6 +202,9 @@ option go_package = "istio.io/api/networking/v1alpha3";
// +genclient
// +k8s:deepcopy-gen=true
// -->
// <!-- istio code generation tags
// +istio.io/sync-start
// -->
message VirtualService {
// The destination hosts to which traffic is being sent. Could
// be a DNS name with wildcard prefix or an IP address. Depending on the
Expand Down Expand Up @@ -284,9 +287,6 @@ message VirtualService {
// The value "." is reserved and defines an export to the same namespace that
// the virtual service is declared in. Similarly the value "*" is reserved and
// defines an export to all namespaces.
//
// NOTE: in the current release, the `exportTo` value is restricted to
// "." or "*" (i.e., the current namespace or all namespaces).
repeated string export_to = 6;
}

Expand Down Expand Up @@ -515,7 +515,7 @@ message VirtualService {
// protocol: HTTP
// resolution: DNS
// ---
// apiVersion: networking.istio.io/v1alpha3
// apiVersion: networking.istio.io/v1beta1
// kind: VirtualService
// metadata:
// name: my-wiki-rule
Expand Down
3 changes: 3 additions & 0 deletions networking/v1alpha3/workload_entry.pb.go

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

3 changes: 3 additions & 0 deletions networking/v1alpha3/workload_entry.proto
Original file line number Diff line number Diff line change
Expand Up @@ -257,6 +257,9 @@ option go_package = "istio.io/api/networking/v1alpha3";
// +genclient
// +k8s:deepcopy-gen=true
// -->
// <!-- istio code generation tags
// +istio.io/sync-start
// -->
message WorkloadEntry {
// Address associated with the network endpoint without the
// port. Domain names can be used if and only if the resolution is set
Expand Down
3 changes: 3 additions & 0 deletions networking/v1beta1/destination_rule.pb.go

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

3 changes: 3 additions & 0 deletions networking/v1beta1/destination_rule.proto
Original file line number Diff line number Diff line change
Expand Up @@ -194,6 +194,9 @@ option go_package = "istio.io/api/networking/v1beta1";
// +genclient
// +k8s:deepcopy-gen=true
// -->
// <!-- istio code generation tags
// +istio.io/sync-from:networking/v1alpha3/destination_rule.proto
// -->
message DestinationRule {
// The name of a service from the service registry. Service
// names are looked up from the platform's service registry (e.g.,
Expand Down
16 changes: 9 additions & 7 deletions networking/v1beta1/gateway.pb.go

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

16 changes: 9 additions & 7 deletions networking/v1beta1/gateway.proto
Original file line number Diff line number Diff line change
Expand Up @@ -372,6 +372,9 @@ option go_package = "istio.io/api/networking/v1beta1";
// +genclient
// +k8s:deepcopy-gen=true
// -->
// <!-- istio code generation tags
// +istio.io/sync-from:networking/v1alpha3/gateway.proto
// -->
message Gateway {
// A list of server specifications.
repeated Server servers = 1 [(google.api.field_behavior) = REQUIRED];
Expand Down Expand Up @@ -546,17 +549,16 @@ message Server {
// HTTP services, it can also be used for TCP services using TLS with SNI.
// A host is specified as a `dnsName` with an optional `namespace/` prefix.
// The `dnsName` should be specified using FQDN format, optionally including
// a wildcard character in the left-most component (e.g.,
// `prod/*.example.com`). Set the `dnsName` to `*` to select all
// `VirtualService` hosts from the specified namespace (e.g.,`prod/*`).
// a wildcard character in the left-most component (e.g., `prod/*.example.com`).
// Set the `dnsName` to `*` to select all `VirtualService` hosts from the
// specified namespace (e.g.,`prod/*`).
//
// The `namespace` can be set to `*` or `.`, representing any or the current
// namespace, respectively. For example, `*/foo.example.com` selects the
// service from any available namespace while `./foo.example.com` only selects
// the service from the namespace of the sidecar. The default, if no
// `namespace/` is specified, is `*/`, that is, select services from any
// namespace. Any associated `DestinationRule` in the selected namespace will
// also be used.
// the service from the namespace of the sidecar. The default, if no `namespace/`
// is specified, is `*/`, that is, select services from any namespace.
// Any associated `DestinationRule` in the selected namespace will also be used.
//
// A `VirtualService` must be bound to the gateway and must have one or
// more hosts that match the hosts specified in a server. The match
Expand Down
3 changes: 3 additions & 0 deletions networking/v1beta1/service_entry.pb.go

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

3 changes: 3 additions & 0 deletions networking/v1beta1/service_entry.proto
Original file line number Diff line number Diff line change
Expand Up @@ -805,6 +805,9 @@ option go_package = "istio.io/api/networking/v1beta1";
// +genclient
// +k8s:deepcopy-gen=true
// -->
// <!-- istio code generation tags
// +istio.io/sync-from:networking/v1alpha3/service_entry.proto
// -->
message ServiceEntry {
// The hosts associated with the ServiceEntry. Could be a DNS
// name with wildcard prefix.
Expand Down
3 changes: 3 additions & 0 deletions networking/v1beta1/sidecar.pb.go

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

5 changes: 4 additions & 1 deletion networking/v1beta1/sidecar.proto
Original file line number Diff line number Diff line change
Expand Up @@ -427,6 +427,9 @@ option go_package = "istio.io/api/networking/v1beta1";
// +genclient
// +k8s:deepcopy-gen=true
// -->
// <!-- istio code generation tags
// +istio.io/sync-from:networking/v1alpha3/sidecar.proto
// -->
message Sidecar {
// Criteria used to select the specific set of pods/VMs on which this
// `Sidecar` configuration should be applied. If omitted, the `Sidecar`
Expand Down Expand Up @@ -607,7 +610,7 @@ message OutboundTrafficPolicy {
// Envoy's dynamic forward proxy can handle only HTTP and TLS
// connections.
// $hide_from_docs
istio.networking.v1beta1.Destination egress_proxy = 2;
Destination egress_proxy = 2;
}


Expand Down
2 changes: 1 addition & 1 deletion networking/v1beta1/virtual_service.gen.json

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

9 changes: 6 additions & 3 deletions networking/v1beta1/virtual_service.pb.go

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

Loading

0 comments on commit 88e56fb

Please sign in to comment.