Skip to content

Commit

Permalink
Change package name to contourconfig
Browse files Browse the repository at this point in the history
Signed-off-by: Sunjay Bhatia <sunjayb@vmware.com>
  • Loading branch information
sunjayBhatia committed Nov 9, 2021
1 parent 7edcf3a commit 2ec96bd
Show file tree
Hide file tree
Showing 6 changed files with 31 additions and 31 deletions.
4 changes: 2 additions & 2 deletions cmd/contour/serve.go
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ import (
contour_api_v1alpha1 "github.com/projectcontour/contour/apis/projectcontour/v1alpha1"
"github.com/projectcontour/contour/internal/annotation"
"github.com/projectcontour/contour/internal/contour"
"github.com/projectcontour/contour/internal/contourconfiguration"
"github.com/projectcontour/contour/internal/contourconfig"
"github.com/projectcontour/contour/internal/controller"
"github.com/projectcontour/contour/internal/dag"
"github.com/projectcontour/contour/internal/debug"
Expand Down Expand Up @@ -281,7 +281,7 @@ func (s *Server) doServe() error {
cipherSuites = append(cipherSuites, string(cs))
}

timeouts, err := contourconfiguration.ParseTimeoutPolicy(contourConfiguration.Envoy.Timeouts)
timeouts, err := contourconfig.ParseTimeoutPolicy(contourConfiguration.Envoy.Timeouts)
if err != nil {
return err
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@
// See the License for the specific language governing permissions and
// limitations under the License.

package contourconfiguration
package contourconfig

import (
"fmt"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -11,14 +11,14 @@
// See the License for the specific language governing permissions and
// limitations under the License.

package contourconfiguration_test
package contourconfig_test

import (
"testing"
"time"

contour_api_v1alpha1 "github.com/projectcontour/contour/apis/projectcontour/v1alpha1"
"github.com/projectcontour/contour/internal/contourconfiguration"
"github.com/projectcontour/contour/internal/contourconfig"
"github.com/projectcontour/contour/internal/timeout"
"github.com/stretchr/testify/require"
"k8s.io/utils/pointer"
Expand All @@ -27,12 +27,12 @@ import (
func TestParseTimeoutPolicy(t *testing.T) {
testCases := map[string]struct {
config *contour_api_v1alpha1.TimeoutParameters
expected contourconfiguration.Timeouts
expected contourconfig.Timeouts
errorMsg string
}{
"nil timeout parameters": {
config: nil,
expected: contourconfiguration.Timeouts{
expected: contourconfig.Timeouts{
Request: timeout.DefaultSetting(),
ConnectionIdle: timeout.DefaultSetting(),
StreamIdle: timeout.DefaultSetting(),
Expand All @@ -43,7 +43,7 @@ func TestParseTimeoutPolicy(t *testing.T) {
},
"timeouts not set": {
config: &contour_api_v1alpha1.TimeoutParameters{},
expected: contourconfiguration.Timeouts{
expected: contourconfig.Timeouts{
Request: timeout.DefaultSetting(),
ConnectionIdle: timeout.DefaultSetting(),
StreamIdle: timeout.DefaultSetting(),
Expand All @@ -61,7 +61,7 @@ func TestParseTimeoutPolicy(t *testing.T) {
DelayedCloseTimeout: pointer.String("5s"),
ConnectionShutdownGracePeriod: pointer.String("6s"),
},
expected: contourconfiguration.Timeouts{
expected: contourconfig.Timeouts{
Request: timeout.DurationSetting(time.Second),
ConnectionIdle: timeout.DurationSetting(time.Second * 2),
StreamIdle: timeout.DurationSetting(time.Second * 3),
Expand Down Expand Up @@ -110,7 +110,7 @@ func TestParseTimeoutPolicy(t *testing.T) {

for name, tc := range testCases {
t.Run(name, func(t *testing.T) {
parsed, err := contourconfiguration.ParseTimeoutPolicy(tc.config)
parsed, err := contourconfig.ParseTimeoutPolicy(tc.config)
if len(tc.errorMsg) > 0 {
require.Error(t, err, "expected error to be returned")
require.Contains(t, err.Error(), tc.errorMsg)
Expand Down
4 changes: 2 additions & 2 deletions internal/featuretests/v3/timeouts_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ import (

envoy_discovery_v3 "github.com/envoyproxy/go-control-plane/envoy/service/discovery/v3"
contour_api_v1 "github.com/projectcontour/contour/apis/projectcontour/v1"
"github.com/projectcontour/contour/internal/contourconfiguration"
"github.com/projectcontour/contour/internal/contourconfig"
envoy_v3 "github.com/projectcontour/contour/internal/envoy/v3"
"github.com/projectcontour/contour/internal/fixture"
"github.com/projectcontour/contour/internal/timeout"
Expand Down Expand Up @@ -77,7 +77,7 @@ func TestTimeoutsNotSpecified(t *testing.T) {

func TestNonZeroTimeoutsSpecified(t *testing.T) {
withTimeouts := func(conf *xdscache_v3.ListenerConfig) {
conf.Timeouts = contourconfiguration.Timeouts{
conf.Timeouts = contourconfig.Timeouts{
ConnectionIdle: timeout.DurationSetting(7 * time.Second),
StreamIdle: timeout.DurationSetting(70 * time.Second),
MaxConnectionDuration: timeout.DurationSetting(700 * time.Second),
Expand Down
4 changes: 2 additions & 2 deletions internal/xdscache/v3/listener.go
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ import (
"github.com/golang/protobuf/proto"
contour_api_v1alpha1 "github.com/projectcontour/contour/apis/projectcontour/v1alpha1"
"github.com/projectcontour/contour/internal/contour"
"github.com/projectcontour/contour/internal/contourconfiguration"
"github.com/projectcontour/contour/internal/contourconfig"
"github.com/projectcontour/contour/internal/dag"
envoy_v3 "github.com/projectcontour/contour/internal/envoy/v3"
"github.com/projectcontour/contour/internal/protobuf"
Expand Down Expand Up @@ -113,7 +113,7 @@ type ListenerConfig struct {
AccessLogFormatterExtensions []string

// Timeouts holds Listener timeout settings.
Timeouts contourconfiguration.Timeouts
Timeouts contourconfig.Timeouts

// AllowChunkedLength enables setting allow_chunked_length on the HTTP1 options for all
// listeners.
Expand Down
34 changes: 17 additions & 17 deletions internal/xdscache/v3/listener_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ import (
"github.com/envoyproxy/go-control-plane/pkg/wellknown"
"github.com/golang/protobuf/proto"
contour_api_v1 "github.com/projectcontour/contour/apis/projectcontour/v1"
"github.com/projectcontour/contour/internal/contourconfiguration"
"github.com/projectcontour/contour/internal/contourconfig"
"github.com/projectcontour/contour/internal/dag"
envoy_v3 "github.com/projectcontour/contour/internal/envoy/v3"
"github.com/projectcontour/contour/internal/k8s"
Expand Down Expand Up @@ -1126,7 +1126,7 @@ func TestListenerVisit(t *testing.T) {
Namespace: "default",
},
ListenerConfig: ListenerConfig{
Timeouts: contourconfiguration.Timeouts{
Timeouts: contourconfig.Timeouts{
Request: timeout.DurationSetting(90 * time.Second),
},
},
Expand Down Expand Up @@ -1242,7 +1242,7 @@ func TestListenerVisit(t *testing.T) {
Namespace: "default",
},
ListenerConfig: ListenerConfig{
Timeouts: contourconfiguration.Timeouts{
Timeouts: contourconfig.Timeouts{
ConnectionIdle: timeout.DurationSetting(90 * time.Second),
},
},
Expand Down Expand Up @@ -1358,7 +1358,7 @@ func TestListenerVisit(t *testing.T) {
Namespace: "default",
},
ListenerConfig: ListenerConfig{
Timeouts: contourconfiguration.Timeouts{
Timeouts: contourconfig.Timeouts{
StreamIdle: timeout.DurationSetting(90 * time.Second),
},
},
Expand Down Expand Up @@ -1474,7 +1474,7 @@ func TestListenerVisit(t *testing.T) {
Namespace: "default",
},
ListenerConfig: ListenerConfig{
Timeouts: contourconfiguration.Timeouts{
Timeouts: contourconfig.Timeouts{
DelayedClose: timeout.DurationSetting(90 * time.Second),
},
},
Expand Down Expand Up @@ -1590,7 +1590,7 @@ func TestListenerVisit(t *testing.T) {
Namespace: "default",
},
ListenerConfig: ListenerConfig{
Timeouts: contourconfiguration.Timeouts{
Timeouts: contourconfig.Timeouts{
MaxConnectionDuration: timeout.DurationSetting(90 * time.Second),
},
},
Expand Down Expand Up @@ -1706,7 +1706,7 @@ func TestListenerVisit(t *testing.T) {
Namespace: "default",
},
ListenerConfig: ListenerConfig{
Timeouts: contourconfiguration.Timeouts{
Timeouts: contourconfig.Timeouts{
ConnectionShutdownGracePeriod: timeout.DurationSetting(90 * time.Second),
},
},
Expand Down Expand Up @@ -2159,7 +2159,7 @@ func TestListenerVisit(t *testing.T) {
},
"httpproxy with connection idle timeout set in listener config": {
ListenerConfig: ListenerConfig{
Timeouts: contourconfiguration.Timeouts{
Timeouts: contourconfig.Timeouts{
ConnectionIdle: timeout.DurationSetting(90 * time.Second),
},
},
Expand Down Expand Up @@ -2215,7 +2215,7 @@ func TestListenerVisit(t *testing.T) {
},
"httpproxy with stream idle timeout set in listener config": {
ListenerConfig: ListenerConfig{
Timeouts: contourconfiguration.Timeouts{
Timeouts: contourconfig.Timeouts{
StreamIdle: timeout.DurationSetting(90 * time.Second),
},
},
Expand Down Expand Up @@ -2271,7 +2271,7 @@ func TestListenerVisit(t *testing.T) {
},
"httpproxy with max connection duration set in listener config": {
ListenerConfig: ListenerConfig{
Timeouts: contourconfiguration.Timeouts{
Timeouts: contourconfig.Timeouts{
MaxConnectionDuration: timeout.DurationSetting(90 * time.Second),
},
},
Expand Down Expand Up @@ -2327,7 +2327,7 @@ func TestListenerVisit(t *testing.T) {
},
"httpproxy with delayed close timeout set in listener config": {
ListenerConfig: ListenerConfig{
Timeouts: contourconfiguration.Timeouts{
Timeouts: contourconfig.Timeouts{
DelayedClose: timeout.DurationSetting(90 * time.Second),
},
},
Expand Down Expand Up @@ -2383,7 +2383,7 @@ func TestListenerVisit(t *testing.T) {
},
"httpproxy with connection shutdown grace period set in listener config": {
ListenerConfig: ListenerConfig{
Timeouts: contourconfiguration.Timeouts{
Timeouts: contourconfig.Timeouts{
ConnectionShutdownGracePeriod: timeout.DurationSetting(90 * time.Second),
},
},
Expand Down Expand Up @@ -2439,7 +2439,7 @@ func TestListenerVisit(t *testing.T) {
},
"httpsproxy with secret with connection idle timeout set in listener config": {
ListenerConfig: ListenerConfig{
Timeouts: contourconfiguration.Timeouts{
Timeouts: contourconfig.Timeouts{
ConnectionIdle: timeout.DurationSetting(90 * time.Second),
},
},
Expand Down Expand Up @@ -2631,7 +2631,7 @@ func TestListenerVisit(t *testing.T) {
},
"httpsproxy with secret with stream idle timeout set in listener config": {
ListenerConfig: ListenerConfig{
Timeouts: contourconfiguration.Timeouts{
Timeouts: contourconfig.Timeouts{
StreamIdle: timeout.DurationSetting(90 * time.Second),
},
},
Expand Down Expand Up @@ -2715,7 +2715,7 @@ func TestListenerVisit(t *testing.T) {
},
"httpsproxy with secret with max connection duration set in listener config": {
ListenerConfig: ListenerConfig{
Timeouts: contourconfiguration.Timeouts{
Timeouts: contourconfig.Timeouts{
MaxConnectionDuration: timeout.DurationSetting(90 * time.Second),
},
},
Expand Down Expand Up @@ -2799,7 +2799,7 @@ func TestListenerVisit(t *testing.T) {
},
"httpsproxy with secret with delayed close timeout set in listener config": {
ListenerConfig: ListenerConfig{
Timeouts: contourconfiguration.Timeouts{
Timeouts: contourconfig.Timeouts{
DelayedClose: timeout.DurationSetting(90 * time.Second),
},
},
Expand Down Expand Up @@ -2883,7 +2883,7 @@ func TestListenerVisit(t *testing.T) {
},
"httpsproxy with secret with connection shutdown grace period set in listener config": {
ListenerConfig: ListenerConfig{
Timeouts: contourconfiguration.Timeouts{
Timeouts: contourconfig.Timeouts{
ConnectionShutdownGracePeriod: timeout.DurationSetting(90 * time.Second),
},
},
Expand Down

0 comments on commit 2ec96bd

Please sign in to comment.