Documentation ¶
Overview ¶
Copyright Project Contour Authors Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License.
Copyright Project Contour Authors Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License.
Copyright Project Contour Authors Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License.
Index ¶
- Constants
- Variables
- func NewDiscardLogger() *logrus.Logger
- func NewTestLogger(t *testing.T) *logrus.Logger
- func ObjectMeta(nameStr string) metav1.ObjectMeta
- type DetailedConditionBuilder
- func (dcb *DetailedConditionBuilder) Orphaned() v1.DetailedCondition
- func (dcb *DetailedConditionBuilder) Valid() v1.DetailedCondition
- func (dcb *DetailedConditionBuilder) WithError(errorType, reason, message string) v1.DetailedCondition
- func (dcb *DetailedConditionBuilder) WithErrorf(errorType, reason, formatmsg string, args ...interface{}) v1.DetailedCondition
- func (dcb *DetailedConditionBuilder) WithGeneration(gen int64) *DetailedConditionBuilder
- func (dcb *DetailedConditionBuilder) WithWarning(errorType, reason, message string) v1.DetailedCondition
- func (dcb *DetailedConditionBuilder) WithWarningf(warnType, reason, formatmsg string, args ...interface{}) v1.DetailedCondition
- type ProxyBuilder
- func (b *ProxyBuilder) Annotate(k string, v string) *ProxyBuilder
- func (b *ProxyBuilder) Label(k string, v string) *ProxyBuilder
- func (b *ProxyBuilder) WithAuthServer(auth contour_api_v1.AuthorizationServer) *ProxyBuilder
- func (b *ProxyBuilder) WithCertificate(secretName string) *ProxyBuilder
- func (b *ProxyBuilder) WithFQDN(fqdn string) *ProxyBuilder
- func (b *ProxyBuilder) WithSpec(spec contour_api_v1.HTTPProxySpec) *contour_api_v1.HTTPProxy
- type ServiceBuilder
Constants ¶
const ( // generated by https://www.selfsignedcertificate.com CERTIFICATE = `` /* 1138-byte string literal not displayed */ CERTIFICATE_WITH_TEXT = CERTIFICATE + "\t\r\n" RSA_PRIVATE_KEY = `` /* 1678-byte string literal not displayed */ // sample elliptical curve data generated // openssl ecparam -name prime256v1 -genkey -out ec_key.pem // openssl req -new -x509 -key ec_key.pem -out ec_crt.pem -days 3650 \ // -subj "/C=US/ST=CA/O=Acme" \ // -reqexts SAN -extensions SAN -config <(ca t /etc/ssl/openssl.cnf \ // <(printf "\n[SAN]\nsubjectAltName=DNS:example.com,DNS:www.example.com")) EC_CERTIFICATE = `` /* 578-byte string literal not displayed */ EC_PRIVATE_KEY = `` /* 301-byte string literal not displayed */ // issue #1965 // certificate with no CN field. // openssl req -new -newkey rsa:2048 -days 365 -nodes -subj="/DC=com/DC=domain/DC=my" -x509 -keyout server.key -out server.crt -sha256 MISSING_CN_CERT = `` /* 1237-byte string literal not displayed */ MISSING_CN_KEY = `` /* 1704-byte string literal not displayed */ )
Variables ¶
var SecretProjectContourCert = &v1.Secret{ ObjectMeta: ObjectMeta("projectcontour/default-ssl-cert"), Type: v1.SecretTypeTLS, Data: SecretRootsCert.Data, }
var SecretRootsCert = &v1.Secret{ ObjectMeta: ObjectMeta("roots/ssl-cert"), Type: v1.SecretTypeTLS, Data: map[string][]byte{ v1.TLSCertKey: []byte(CERTIFICATE), v1.TLSPrivateKeyKey: []byte(RSA_PRIVATE_KEY), }, }
var SecretRootsFallback = &v1.Secret{ ObjectMeta: ObjectMeta("roots/fallbacksecret"), Type: v1.SecretTypeTLS, Data: map[string][]byte{ v1.TLSCertKey: []byte(CERTIFICATE), v1.TLSPrivateKeyKey: []byte(RSA_PRIVATE_KEY), }, }
var ServiceMarketingGreen = &v1.Service{ ObjectMeta: ObjectMeta("marketing/green"), Spec: v1.ServiceSpec{ Ports: []v1.ServicePort{{ Name: "http", Protocol: "TCP", Port: 80, }}, }, }
var ServiceRootsFoo2 = &v1.Service{ ObjectMeta: ObjectMeta("roots/foo2"), Spec: v1.ServiceSpec{ Ports: []v1.ServicePort{{ Name: "http", Protocol: "TCP", Port: 8080, }}, }, }
var ServiceRootsFoo3InvalidPort = &v1.Service{ ObjectMeta: ObjectMeta("roots/foo3"), Spec: v1.ServiceSpec{ Ports: []v1.ServicePort{{ Name: "http", Protocol: "TCP", Port: 12345678, }}, }, }
var ServiceRootsHome = &v1.Service{ ObjectMeta: ObjectMeta("roots/home"), Spec: v1.ServiceSpec{ Ports: []v1.ServicePort{{ Name: "http", Protocol: "TCP", Port: 8080, }}, }, }
var ServiceRootsKuard = &v1.Service{ ObjectMeta: ObjectMeta("roots/kuard"), Spec: v1.ServiceSpec{ Ports: []v1.ServicePort{{ Name: "http", Protocol: "TCP", Port: 8080, TargetPort: intstr.FromInt(8080), }}, }, }
var ServiceRootsNginx = &v1.Service{ ObjectMeta: ObjectMeta("roots/nginx"), Spec: v1.ServiceSpec{ Ports: []v1.ServicePort{{ Protocol: "TCP", Port: 80, }}, }, }
var ServiceTeamAKuard = &v1.Service{ ObjectMeta: ObjectMeta("teama/kuard"), Spec: v1.ServiceSpec{ Ports: []v1.ServicePort{{ Name: "http", Protocol: "TCP", Port: 8080, TargetPort: intstr.FromInt(8080), }}, }, }
var ServiceTeamBKuard = &v1.Service{ ObjectMeta: ObjectMeta("teamb/kuard"), Spec: v1.ServiceSpec{ Ports: []v1.ServicePort{{ Name: "http", Protocol: "TCP", Port: 8080, TargetPort: intstr.FromInt(8080), }}, }, }
Functions ¶
func NewDiscardLogger ¶ added in v1.8.0
NewDiscardLogger returns logrus.Logger that discards log messages.
func NewTestLogger ¶ added in v1.8.0
NewTestLogger returns logrus.Logger that writes messages using (*testing.T)Logf.
func ObjectMeta ¶
func ObjectMeta(nameStr string) metav1.ObjectMeta
ObjectMeta cracks a Kubernetes object name string of the form "namespace/name" into a metav1.ObjectMeta struct. If the namespace portion is omitted, then the default namespace is filled in.
Types ¶
type DetailedConditionBuilder ¶ added in v1.9.0
type DetailedConditionBuilder v1.DetailedCondition
DetailedConditionBuilder is a builder object to make creating HTTPProxy fixtures more succinct.
func NewValidCondition ¶ added in v1.9.0
func NewValidCondition() *DetailedConditionBuilder
NewValidCondition creates a new DetailedConditionBuilder.
func (*DetailedConditionBuilder) Orphaned ¶ added in v1.9.0
func (dcb *DetailedConditionBuilder) Orphaned() v1.DetailedCondition
func (*DetailedConditionBuilder) Valid ¶ added in v1.9.0
func (dcb *DetailedConditionBuilder) Valid() v1.DetailedCondition
func (*DetailedConditionBuilder) WithError ¶ added in v1.9.0
func (dcb *DetailedConditionBuilder) WithError(errorType, reason, message string) v1.DetailedCondition
func (*DetailedConditionBuilder) WithErrorf ¶ added in v1.9.0
func (dcb *DetailedConditionBuilder) WithErrorf(errorType, reason, formatmsg string, args ...interface{}) v1.DetailedCondition
func (*DetailedConditionBuilder) WithGeneration ¶ added in v1.9.0
func (dcb *DetailedConditionBuilder) WithGeneration(gen int64) *DetailedConditionBuilder
func (*DetailedConditionBuilder) WithWarning ¶ added in v1.9.0
func (dcb *DetailedConditionBuilder) WithWarning(errorType, reason, message string) v1.DetailedCondition
func (*DetailedConditionBuilder) WithWarningf ¶ added in v1.9.0
func (dcb *DetailedConditionBuilder) WithWarningf(warnType, reason, formatmsg string, args ...interface{}) v1.DetailedCondition
type ProxyBuilder ¶
type ProxyBuilder contour_api_v1.HTTPProxy
ProxyBuilder is a builder object to make creating HTTPProxy fixtures more succinct.
func NewProxy ¶
func NewProxy(name string) *ProxyBuilder
NewProxy creates a new ProxyBuilder with the specified object name.
func (*ProxyBuilder) Annotate ¶
func (b *ProxyBuilder) Annotate(k string, v string) *ProxyBuilder
Annotate adds the given values as metadata annotations.
func (*ProxyBuilder) Label ¶
func (b *ProxyBuilder) Label(k string, v string) *ProxyBuilder
Label adds the given values as metadata labels.
func (*ProxyBuilder) WithAuthServer ¶ added in v1.9.0
func (b *ProxyBuilder) WithAuthServer(auth contour_api_v1.AuthorizationServer) *ProxyBuilder
func (*ProxyBuilder) WithCertificate ¶ added in v1.9.0
func (b *ProxyBuilder) WithCertificate(secretName string) *ProxyBuilder
func (*ProxyBuilder) WithFQDN ¶
func (b *ProxyBuilder) WithFQDN(fqdn string) *ProxyBuilder
func (*ProxyBuilder) WithSpec ¶
func (b *ProxyBuilder) WithSpec(spec contour_api_v1.HTTPProxySpec) *contour_api_v1.HTTPProxy
WithSpec updates the builder's Spec field, returning the build proxy.
type ServiceBuilder ¶ added in v1.8.0
func NewService ¶ added in v1.8.0
func NewService(name string) *ServiceBuilder
NewService creates a new ServiceBuilder with the given resource name.
func (*ServiceBuilder) Annotate ¶ added in v1.8.0
func (s *ServiceBuilder) Annotate(k string, v string) *ServiceBuilder
Annotate adds the given values as metadata annotations.
func (*ServiceBuilder) WithPorts ¶ added in v1.8.0
func (s *ServiceBuilder) WithPorts(ports ...v1.ServicePort) *v1.Service
WithPorts specifies the ports for the .Spec.Ports field.
func (*ServiceBuilder) WithSpec ¶ added in v1.8.0
func (s *ServiceBuilder) WithSpec(spec v1.ServiceSpec) *v1.Service
WithSpec specifies the .Spec field.