From f637f5280914af4ba1b7b8557ba4e6de94009f68 Mon Sep 17 00:00:00 2001 From: Navid Shaikh Date: Tue, 10 Dec 2019 23:40:03 +0530 Subject: [PATCH 1/2] Vendor serving v0.11.0 --- go.mod | 2 +- go.sum | 4 +- .../autoscaling/v1alpha1/podscalable_types.go | 1 + .../serving/pkg/apis/networking/register.go | 6 ++ .../pkg/apis/networking/v1alpha1/doc.go | 2 +- .../networking/v1alpha1/ingress_accessors.go | 59 ------------------- .../networking/v1alpha1/ingress_lifecycle.go | 13 +++- .../apis/networking/v1alpha1/ingress_types.go | 2 +- .../serving/pkg/apis/serving/fieldmask.go | 2 +- .../pkg/apis/serving/metadata_validation.go | 37 ++++++++++++ .../serving/v1/configuration_validation.go | 8 ++- .../apis/serving/v1/revision_validation.go | 17 +----- .../pkg/apis/serving/v1/route_validation.go | 8 ++- .../v1alpha1/configuration_defaults.go | 2 +- .../v1alpha1/configuration_lifecycle.go | 4 +- .../v1alpha1/configuration_validation.go | 8 ++- .../serving/v1alpha1/revision_conversion.go | 1 + .../serving/v1alpha1/revision_defaults.go | 5 ++ .../serving/v1alpha1/revision_lifecycle.go | 6 +- .../serving/v1alpha1/revision_validation.go | 23 +------- .../apis/serving/v1alpha1/route_validation.go | 8 ++- .../v1beta1/configuration_validation.go | 8 ++- .../apis/serving/v1beta1/route_validation.go | 8 ++- vendor/modules.txt | 2 +- 24 files changed, 113 insertions(+), 123 deletions(-) delete mode 100644 vendor/knative.dev/serving/pkg/apis/networking/v1alpha1/ingress_accessors.go diff --git a/go.mod b/go.mod index c5a5b98722..8337dcfaa0 100644 --- a/go.mod +++ b/go.mod @@ -20,7 +20,7 @@ require ( k8s.io/client-go v0.0.0-20191016110837-54936ba21026 knative.dev/eventing v0.10.0 knative.dev/pkg v0.0.0-20191107185656-884d50f09454 - knative.dev/serving v0.10.0 + knative.dev/serving v0.11.0 knative.dev/test-infra v0.0.0-20191205012837-30f1a1f7b77e sigs.k8s.io/yaml v1.1.0 ) diff --git a/go.sum b/go.sum index db74000e2b..4568a69e7d 100644 --- a/go.sum +++ b/go.sum @@ -532,8 +532,8 @@ knative.dev/eventing v0.10.0 h1:dDrOjBWWgloOCUjxR8ixUIh8nqCTbmM5BbGo8rvf1bc= knative.dev/eventing v0.10.0/go.mod h1:UxweNv8yXhsdHJitcb9R6rmfNaUD2DFi9GWwNRyIs58= knative.dev/pkg v0.0.0-20191107185656-884d50f09454 h1:nkslWFyRWaJp3nPDm+GSQOSvN8NpZg8qIYTR+XssNNg= knative.dev/pkg v0.0.0-20191107185656-884d50f09454/go.mod h1:pgODObA1dTyhNoFxPZTTjNWfx6F0aKsKzn+vaT9XO/Q= -knative.dev/serving v0.10.0 h1:T1csznAQrc/DvCE4KROz4NqOtJ24mnU9eF9RMeeYaCc= -knative.dev/serving v0.10.0/go.mod h1:x2n255JS2XBI39tmjZ8CwTxIf9EKNMCrkVuiOttLRm0= +knative.dev/serving v0.11.0 h1:FK8aPpMuiBHZbfBfT+Avxyk11TaIlOMDEw/Va2sw1w0= +knative.dev/serving v0.11.0/go.mod h1:x2n255JS2XBI39tmjZ8CwTxIf9EKNMCrkVuiOttLRm0= knative.dev/test-infra v0.0.0-20191205012837-30f1a1f7b77e h1:QTlOxV+M072CNdbKkqn6gmLWPETuLs+EiZ/pOv1jcrw= knative.dev/test-infra v0.0.0-20191205012837-30f1a1f7b77e/go.mod h1:xcdUkMJrLlBswIZqL5zCuBFOC22WIPMQoVX1L35i0vQ= modernc.org/cc v1.0.0/go.mod h1:1Sk4//wdnYJiUIxnW8ddKpaOJCF37yAdqYnkxUpaYxw= diff --git a/vendor/knative.dev/serving/pkg/apis/autoscaling/v1alpha1/podscalable_types.go b/vendor/knative.dev/serving/pkg/apis/autoscaling/v1alpha1/podscalable_types.go index 54d67929c9..b6d05a7b73 100644 --- a/vendor/knative.dev/serving/pkg/apis/autoscaling/v1alpha1/podscalable_types.go +++ b/vendor/knative.dev/serving/pkg/apis/autoscaling/v1alpha1/podscalable_types.go @@ -24,6 +24,7 @@ import ( "knative.dev/pkg/apis/duck" ) +// +genduck // +k8s:deepcopy-gen:interfaces=k8s.io/apimachinery/pkg/runtime.Object // PodScalable is a duck type that the resources referenced by the diff --git a/vendor/knative.dev/serving/pkg/apis/networking/register.go b/vendor/knative.dev/serving/pkg/apis/networking/register.go index c7c1c65b8b..4ab10998a0 100644 --- a/vendor/knative.dev/serving/pkg/apis/networking/register.go +++ b/vendor/knative.dev/serving/pkg/apis/networking/register.go @@ -80,6 +80,11 @@ const ( // WildcardCertDomainLabelKey is the label key attached to a certificate to indicate the // domain for which it was issued. WildcardCertDomainLabelKey = "networking.knative.dev/wildcardDomain" + + // KnativeIngressGateway is the name of the ingress gateway + KnativeIngressGateway = "knative-ingress-gateway" + // ClusterLocalGateway is the name of the local gateway + ClusterLocalGateway = "cluster-local-gateway" ) // ServiceType is the enumeration type for the Kubernetes services @@ -95,6 +100,7 @@ const ( ServiceTypePublic ServiceType = "Public" // ServiceTypeMetrics is the label value for Metrics services. Such services // are used for meric scraping. + // TODO(5900): Remove after 0.12 is cut. ServiceTypeMetrics ServiceType = "Metrics" ) diff --git a/vendor/knative.dev/serving/pkg/apis/networking/v1alpha1/doc.go b/vendor/knative.dev/serving/pkg/apis/networking/v1alpha1/doc.go index f10d2c772c..2663a50e6a 100644 --- a/vendor/knative.dev/serving/pkg/apis/networking/v1alpha1/doc.go +++ b/vendor/knative.dev/serving/pkg/apis/networking/v1alpha1/doc.go @@ -19,6 +19,6 @@ limitations under the License. package v1alpha1 // Ingress is heavily based on K8s Ingress -// https://godoc.org/k8s.io/api/extensions/v1beta1#Ingress with some +// https://godoc.org/k8s.io/api/networking/v1beta1#Ingress with some // highlighted modifications. See ingress_types.go for more // information about the modifications that we made. diff --git a/vendor/knative.dev/serving/pkg/apis/networking/v1alpha1/ingress_accessors.go b/vendor/knative.dev/serving/pkg/apis/networking/v1alpha1/ingress_accessors.go deleted file mode 100644 index 1dcf6f933c..0000000000 --- a/vendor/knative.dev/serving/pkg/apis/networking/v1alpha1/ingress_accessors.go +++ /dev/null @@ -1,59 +0,0 @@ -/* -Copyright 2019 The Knative 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. -*/ - -package v1alpha1 - -import ( - "context" - - "knative.dev/pkg/kmeta" -) - -// IngressAccessor interfaces that exposes members of an Ingress -type IngressAccessor interface { - kmeta.OwnerRefableAccessor - - GetStatus() *IngressStatus - SetStatus(IngressStatus) - - GetSpec() *IngressSpec - SetSpec(IngressSpec) - - // lifecycle methods - IsPublic() bool - // defaults methods - SetDefaults(ctx context.Context) -} - -// GetStatus returns Status of an Ingress -func (ingress *Ingress) GetStatus() *IngressStatus { - return &ingress.Status -} - -// GetSpec returns Spec of an Ingress -func (ingress *Ingress) GetSpec() *IngressSpec { - return &ingress.Spec -} - -// SetStatus assigns ingress status -func (ingress *Ingress) SetStatus(status IngressStatus) { - ingress.Status = status -} - -// SetSpec assigns ingress spec -func (ingress *Ingress) SetSpec(spec IngressSpec) { - ingress.Spec = spec -} diff --git a/vendor/knative.dev/serving/pkg/apis/networking/v1alpha1/ingress_lifecycle.go b/vendor/knative.dev/serving/pkg/apis/networking/v1alpha1/ingress_lifecycle.go index f227e75afe..fe840dc506 100644 --- a/vendor/knative.dev/serving/pkg/apis/networking/v1alpha1/ingress_lifecycle.go +++ b/vendor/knative.dev/serving/pkg/apis/networking/v1alpha1/ingress_lifecycle.go @@ -29,6 +29,10 @@ var ingressCondSet = apis.NewLivingConditionSet( IngressConditionLoadBalancerReady, ) +// VirtualServiceNotReconciled is used for the reason of MarkLoadBalancerFailed +// when VirtualService is failed to be reconciled. +var VirtualServiceNotReconciled = "ReconcileVirtualServiceFailed" + // GetGroupVersionKind returns SchemeGroupVersion of an Ingress func (i *Ingress) GetGroupVersionKind() schema.GroupVersionKind { return SchemeGroupVersion.WithKind("Ingress") @@ -71,13 +75,18 @@ func (is *IngressStatus) MarkLoadBalancerReady(lbs []LoadBalancerIngressStatus, ingressCondSet.Manage(is).MarkTrue(IngressConditionLoadBalancerReady) } -// MarkLoadBalancerPending marks the "IngressConditionLoadBalancerReady" condition to unknown to +// MarkLoadBalancerNotReady marks the "IngressConditionLoadBalancerReady" condition to unknown to // reflect that the load balancer is not ready yet. -func (is *IngressStatus) MarkLoadBalancerPending() { +func (is *IngressStatus) MarkLoadBalancerNotReady() { ingressCondSet.Manage(is).MarkUnknown(IngressConditionLoadBalancerReady, "Uninitialized", "Waiting for VirtualService to be ready") } +// MarkLoadBalancerFailed marks the "IngressConditionLoadBalancerReady" condition to false. +func (is *IngressStatus) MarkLoadBalancerFailed(reason, message string) { + ingressCondSet.Manage(is).MarkFalse(IngressConditionLoadBalancerReady, reason, message) +} + // MarkIngressNotReady marks the "IngressConditionReady" condition to unknown. func (is *IngressStatus) MarkIngressNotReady(reason, message string) { ingressCondSet.Manage(is).MarkUnknown(IngressConditionReady, reason, message) diff --git a/vendor/knative.dev/serving/pkg/apis/networking/v1alpha1/ingress_types.go b/vendor/knative.dev/serving/pkg/apis/networking/v1alpha1/ingress_types.go index 6ce9d1bb8b..9d2811e0b8 100644 --- a/vendor/knative.dev/serving/pkg/apis/networking/v1alpha1/ingress_types.go +++ b/vendor/knative.dev/serving/pkg/apis/networking/v1alpha1/ingress_types.go @@ -31,7 +31,7 @@ import ( // by a backend. An Ingress can be configured to give services externally-reachable URLs, load // balance traffic, offer name based virtual hosting, etc. // -// This is heavily based on K8s Ingress https://godoc.org/k8s.io/api/extensions/v1beta1#Ingress +// This is heavily based on K8s Ingress https://godoc.org/k8s.io/api/networking/v1beta1#Ingress // which some highlighted modifications. type Ingress struct { metav1.TypeMeta `json:",inline"` diff --git a/vendor/knative.dev/serving/pkg/apis/serving/fieldmask.go b/vendor/knative.dev/serving/pkg/apis/serving/fieldmask.go index fe958373cb..833d0aa207 100644 --- a/vendor/knative.dev/serving/pkg/apis/serving/fieldmask.go +++ b/vendor/knative.dev/serving/pkg/apis/serving/fieldmask.go @@ -147,6 +147,7 @@ func PodSpecMask(in *corev1.PodSpec) *corev1.PodSpec { out.ServiceAccountName = in.ServiceAccountName out.Containers = in.Containers out.Volumes = in.Volumes + out.ImagePullSecrets = in.ImagePullSecrets // Disallowed fields // This list is unnecessary, but added here for clarity @@ -163,7 +164,6 @@ func PodSpecMask(in *corev1.PodSpec) *corev1.PodSpec { out.HostIPC = false out.ShareProcessNamespace = nil out.SecurityContext = nil - out.ImagePullSecrets = nil out.Hostname = "" out.Subdomain = "" out.Affinity = nil diff --git a/vendor/knative.dev/serving/pkg/apis/serving/metadata_validation.go b/vendor/knative.dev/serving/pkg/apis/serving/metadata_validation.go index cac595f4c3..034af7c231 100644 --- a/vendor/knative.dev/serving/pkg/apis/serving/metadata_validation.go +++ b/vendor/knative.dev/serving/pkg/apis/serving/metadata_validation.go @@ -18,10 +18,12 @@ package serving import ( "context" + "fmt" "strconv" "strings" "k8s.io/apimachinery/pkg/api/equality" + "k8s.io/apimachinery/pkg/api/validation" metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" "knative.dev/pkg/apis" "knative.dev/serving/pkg/apis/autoscaling" @@ -132,3 +134,38 @@ func SetUserInfo(ctx context.Context, oldSpec, newSpec, resource interface{}) { } } } + +// ValidateRevisionName validates name and generateName for the revisionTemplate +func ValidateRevisionName(ctx context.Context, name, generateName string) *apis.FieldError { + if generateName != "" { + if msgs := validation.NameIsDNS1035Label(generateName, true); len(msgs) > 0 { + return apis.ErrInvalidValue( + fmt.Sprintf("not a DNS 1035 label prefix: %v", msgs), + "metadata.generateName") + } + } + if name != "" { + if msgs := validation.NameIsDNS1035Label(name, false); len(msgs) > 0 { + return apis.ErrInvalidValue( + fmt.Sprintf("not a DNS 1035 label: %v", msgs), + "metadata.name") + } + om := apis.ParentMeta(ctx) + prefix := om.Name + "-" + if om.Name != "" { + // Even if there is GenerateName, allow the use + // of Name post-creation. + } else if om.GenerateName != "" { + // We disallow bringing your own name when the parent + // resource uses generateName (at creation). + return apis.ErrDisallowedFields("metadata.name") + } + + if !strings.HasPrefix(name, prefix) { + return apis.ErrInvalidValue( + fmt.Sprintf("%q must have prefix %q", name, prefix), + "metadata.name") + } + } + return nil +} diff --git a/vendor/knative.dev/serving/pkg/apis/serving/v1/configuration_validation.go b/vendor/knative.dev/serving/pkg/apis/serving/v1/configuration_validation.go index 1d901da402..da69563049 100644 --- a/vendor/knative.dev/serving/pkg/apis/serving/v1/configuration_validation.go +++ b/vendor/knative.dev/serving/pkg/apis/serving/v1/configuration_validation.go @@ -43,8 +43,12 @@ func (c *Configuration) Validate(ctx context.Context) (errs *apis.FieldError) { if apis.IsInUpdate(ctx) { original := apis.GetBaseline(ctx).(*Configuration) - errs = errs.Also(apis.ValidateCreatorAndModifier(original.Spec, c.Spec, original.GetAnnotations(), - c.GetAnnotations(), serving.GroupName).ViaField("metadata.annotations")) + // Don't validate annotations(creator and lastModifier) when configuration owned by service + // validate only when configuration created independently. + if c.OwnerReferences == nil { + errs = errs.Also(apis.ValidateCreatorAndModifier(original.Spec, c.Spec, original.GetAnnotations(), + c.GetAnnotations(), serving.GroupName).ViaField("metadata.annotations")) + } err := c.Spec.Template.VerifyNameChange(ctx, original.Spec.Template) errs = errs.Also(err.ViaField("spec.template")) } diff --git a/vendor/knative.dev/serving/pkg/apis/serving/v1/revision_validation.go b/vendor/knative.dev/serving/pkg/apis/serving/v1/revision_validation.go index 9c3a148ce9..d83b3760cb 100644 --- a/vendor/knative.dev/serving/pkg/apis/serving/v1/revision_validation.go +++ b/vendor/knative.dev/serving/pkg/apis/serving/v1/revision_validation.go @@ -18,7 +18,6 @@ package v1 import ( "context" - "fmt" "strings" "knative.dev/pkg/apis" @@ -62,21 +61,7 @@ func (rts *RevisionTemplateSpec) Validate(ctx context.Context) *apis.FieldError // If the RevisionTemplateSpec has a name specified, then check that // it follows the requirements on the name. - if rts.Name != "" { - var prefix string - if om := apis.ParentMeta(ctx); om.Name == "" { - prefix = om.GenerateName - } else { - prefix = om.Name + "-" - } - - if !strings.HasPrefix(rts.Name, prefix) { - errs = errs.Also(apis.ErrInvalidValue( - fmt.Sprintf("%q must have prefix %q", rts.Name, prefix), - "metadata.name")) - } - } - + errs = errs.Also(serving.ValidateRevisionName(ctx, rts.Name, rts.GenerateName)) errs = errs.Also(serving.ValidateQueueSidecarAnnotation(rts.Annotations).ViaField("metadata.annotations")) return errs } diff --git a/vendor/knative.dev/serving/pkg/apis/serving/v1/route_validation.go b/vendor/knative.dev/serving/pkg/apis/serving/v1/route_validation.go index 4904b56b1b..ec7843dac7 100644 --- a/vendor/knative.dev/serving/pkg/apis/serving/v1/route_validation.go +++ b/vendor/knative.dev/serving/pkg/apis/serving/v1/route_validation.go @@ -36,8 +36,12 @@ func (r *Route) Validate(ctx context.Context) *apis.FieldError { if apis.IsInUpdate(ctx) { original := apis.GetBaseline(ctx).(*Route) - errs = errs.Also(apis.ValidateCreatorAndModifier(original.Spec, r.Spec, original.GetAnnotations(), - r.GetAnnotations(), serving.GroupName).ViaField("metadata.annotations")) + // Don't validate annotations(creator and lastModifier) when route owned by service + // validate only when route created independently. + if r.OwnerReferences == nil { + errs = errs.Also(apis.ValidateCreatorAndModifier(original.Spec, r.Spec, original.GetAnnotations(), + r.GetAnnotations(), serving.GroupName).ViaField("metadata.annotations")) + } } return errs } diff --git a/vendor/knative.dev/serving/pkg/apis/serving/v1alpha1/configuration_defaults.go b/vendor/knative.dev/serving/pkg/apis/serving/v1alpha1/configuration_defaults.go index ebd659eb1e..56ef58c062 100644 --- a/vendor/knative.dev/serving/pkg/apis/serving/v1alpha1/configuration_defaults.go +++ b/vendor/knative.dev/serving/pkg/apis/serving/v1alpha1/configuration_defaults.go @@ -48,5 +48,5 @@ func (cs *ConfigurationSpec) SetDefaults(ctx context.Context) { } } - cs.GetTemplate().Spec.SetDefaults(ctx) + cs.GetTemplate().SetDefaults(ctx) } diff --git a/vendor/knative.dev/serving/pkg/apis/serving/v1alpha1/configuration_lifecycle.go b/vendor/knative.dev/serving/pkg/apis/serving/v1alpha1/configuration_lifecycle.go index c0b4a66535..25d532de58 100644 --- a/vendor/knative.dev/serving/pkg/apis/serving/v1alpha1/configuration_lifecycle.go +++ b/vendor/knative.dev/serving/pkg/apis/serving/v1alpha1/configuration_lifecycle.go @@ -88,7 +88,9 @@ func (cs *ConfigurationStatus) SetLatestCreatedRevisionName(name string) { func (cs *ConfigurationStatus) SetLatestReadyRevisionName(name string) { cs.LatestReadyRevisionName = name - confCondSet.Manage(cs).MarkTrue(ConfigurationConditionReady) + if cs.LatestReadyRevisionName == cs.LatestCreatedRevisionName { + confCondSet.Manage(cs).MarkTrue(ConfigurationConditionReady) + } } func (cs *ConfigurationStatus) MarkLatestCreatedFailed(name, message string) { diff --git a/vendor/knative.dev/serving/pkg/apis/serving/v1alpha1/configuration_validation.go b/vendor/knative.dev/serving/pkg/apis/serving/v1alpha1/configuration_validation.go index 2308739c85..2704da20b8 100644 --- a/vendor/knative.dev/serving/pkg/apis/serving/v1alpha1/configuration_validation.go +++ b/vendor/knative.dev/serving/pkg/apis/serving/v1alpha1/configuration_validation.go @@ -39,8 +39,12 @@ func (c *Configuration) Validate(ctx context.Context) (errs *apis.FieldError) { if apis.IsInUpdate(ctx) { original := apis.GetBaseline(ctx).(*Configuration) - errs = errs.Also(apis.ValidateCreatorAndModifier(original.Spec, c.Spec, original.GetAnnotations(), - c.GetAnnotations(), serving.GroupName).ViaField("metadata.annotations")) + // Don't validate annotations(creator and lastModifier) when configuration owned by service + // validate only when configuration created independently. + if c.GetOwnerReferences() == nil { + errs = errs.Also(apis.ValidateCreatorAndModifier(original.Spec, c.Spec, original.GetAnnotations(), + c.GetAnnotations(), serving.GroupName).ViaField("metadata.annotations")) + } err := c.Spec.GetTemplate().VerifyNameChange(ctx, original.Spec.GetTemplate()) errs = errs.Also(err.ViaField("spec.revisionTemplate")) diff --git a/vendor/knative.dev/serving/pkg/apis/serving/v1alpha1/revision_conversion.go b/vendor/knative.dev/serving/pkg/apis/serving/v1alpha1/revision_conversion.go index 5c127e3016..b234f4a286 100644 --- a/vendor/knative.dev/serving/pkg/apis/serving/v1alpha1/revision_conversion.go +++ b/vendor/knative.dev/serving/pkg/apis/serving/v1alpha1/revision_conversion.go @@ -61,6 +61,7 @@ func (source *RevisionSpec) ConvertUp(ctx context.Context, sink *v1.RevisionSpec ServiceAccountName: source.ServiceAccountName, Containers: []corev1.Container{*source.DeprecatedContainer}, Volumes: source.Volumes, + ImagePullSecrets: source.ImagePullSecrets, } case len(source.Containers) == 1: sink.PodSpec = source.PodSpec diff --git a/vendor/knative.dev/serving/pkg/apis/serving/v1alpha1/revision_defaults.go b/vendor/knative.dev/serving/pkg/apis/serving/v1alpha1/revision_defaults.go index 904abd8c2f..887487fa95 100644 --- a/vendor/knative.dev/serving/pkg/apis/serving/v1alpha1/revision_defaults.go +++ b/vendor/knative.dev/serving/pkg/apis/serving/v1alpha1/revision_defaults.go @@ -29,6 +29,11 @@ func (r *Revision) SetDefaults(ctx context.Context) { r.Spec.SetDefaults(apis.WithinSpec(ctx)) } +// SetDefaults implements apis.Defaultable +func (rts *RevisionTemplateSpec) SetDefaults(ctx context.Context) { + rts.Spec.SetDefaults(apis.WithinSpec(ctx)) +} + func (rs *RevisionSpec) SetDefaults(ctx context.Context) { if v1.IsUpgradeViaDefaulting(ctx) { v1 := v1.RevisionSpec{} diff --git a/vendor/knative.dev/serving/pkg/apis/serving/v1alpha1/revision_lifecycle.go b/vendor/knative.dev/serving/pkg/apis/serving/v1alpha1/revision_lifecycle.go index 965a2f8076..6bfbcca72d 100644 --- a/vendor/knative.dev/serving/pkg/apis/serving/v1alpha1/revision_lifecycle.go +++ b/vendor/knative.dev/serving/pkg/apis/serving/v1alpha1/revision_lifecycle.go @@ -44,7 +44,7 @@ const ( // QueueAdminPortName specifies the port name for // health check and lifecycle hooks for queue-proxy. - QueueAdminPortName string = "queueadm-port" + QueueAdminPortName string = "http-queueadm" // AutoscalingQueueMetricsPortName specifies the port name to use for metrics // emitted by queue-proxy for autoscaler. @@ -52,11 +52,11 @@ const ( // UserQueueMetricsPortName specifies the port name to use for metrics // emitted by queue-proxy for end user. - UserQueueMetricsPortName = "user-metrics" + UserQueueMetricsPortName = "http-usermetric" // ServiceQueueMetricsPortName is the name of the port that serves metrics // on the Kubernetes service. - ServiceQueueMetricsPortName = "metrics" + ServiceQueueMetricsPortName = "http-metrics" ) var revCondSet = apis.NewLivingConditionSet( diff --git a/vendor/knative.dev/serving/pkg/apis/serving/v1alpha1/revision_validation.go b/vendor/knative.dev/serving/pkg/apis/serving/v1alpha1/revision_validation.go index 0c97123689..713c56770b 100644 --- a/vendor/knative.dev/serving/pkg/apis/serving/v1alpha1/revision_validation.go +++ b/vendor/knative.dev/serving/pkg/apis/serving/v1alpha1/revision_validation.go @@ -18,8 +18,6 @@ package v1alpha1 import ( "context" - "fmt" - "strings" "k8s.io/apimachinery/pkg/api/equality" "knative.dev/pkg/apis" @@ -61,28 +59,9 @@ func (r *Revision) Validate(ctx context.Context) *apis.FieldError { func (rt *RevisionTemplateSpec) Validate(ctx context.Context) *apis.FieldError { errs := rt.Spec.Validate(ctx).ViaField("spec") errs = errs.Also(autoscaling.ValidateAnnotations(rt.GetAnnotations()).ViaField("metadata.annotations")) - // If the DeprecatedRevisionTemplate has a name specified, then check that // it follows the requirements on the name. - if rt.Name != "" { - om := apis.ParentMeta(ctx) - prefix := om.Name + "-" - if om.Name != "" { - // Even if there is GenerateName, allow the use - // of Name post-creation. - } else if om.GenerateName != "" { - // We disallow bringing your own name when the parent - // resource uses generateName (at creation). - return apis.ErrDisallowedFields("metadata.name") - } - - if !strings.HasPrefix(rt.Name, prefix) { - errs = errs.Also(apis.ErrInvalidValue( - fmt.Sprintf("%q must have prefix %q", rt.Name, prefix), - "metadata.name")) - } - } - + errs = errs.Also(serving.ValidateRevisionName(ctx, rt.Name, rt.GenerateName)) errs = errs.Also(serving.ValidateQueueSidecarAnnotation(rt.Annotations).ViaField("metadata.annotations")) return errs } diff --git a/vendor/knative.dev/serving/pkg/apis/serving/v1alpha1/route_validation.go b/vendor/knative.dev/serving/pkg/apis/serving/v1alpha1/route_validation.go index 3c1c842bac..025457b7e3 100644 --- a/vendor/knative.dev/serving/pkg/apis/serving/v1alpha1/route_validation.go +++ b/vendor/knative.dev/serving/pkg/apis/serving/v1alpha1/route_validation.go @@ -31,8 +31,12 @@ func (r *Route) Validate(ctx context.Context) *apis.FieldError { if apis.IsInUpdate(ctx) { original := apis.GetBaseline(ctx).(*Route) - errs = errs.Also(apis.ValidateCreatorAndModifier(original.Spec, r.Spec, original.GetAnnotations(), - r.GetAnnotations(), serving.GroupName).ViaField("metadata.annotations")) + // Don't validate annotations(creator and lastModifier) when route owned by service + // validate only when route created independently. + if r.OwnerReferences == nil { + errs = errs.Also(apis.ValidateCreatorAndModifier(original.Spec, r.Spec, original.GetAnnotations(), + r.GetAnnotations(), serving.GroupName).ViaField("metadata.annotations")) + } } return errs } diff --git a/vendor/knative.dev/serving/pkg/apis/serving/v1beta1/configuration_validation.go b/vendor/knative.dev/serving/pkg/apis/serving/v1beta1/configuration_validation.go index db44bcb644..f4df84744c 100644 --- a/vendor/knative.dev/serving/pkg/apis/serving/v1beta1/configuration_validation.go +++ b/vendor/knative.dev/serving/pkg/apis/serving/v1beta1/configuration_validation.go @@ -43,8 +43,12 @@ func (c *Configuration) Validate(ctx context.Context) (errs *apis.FieldError) { if apis.IsInUpdate(ctx) { original := apis.GetBaseline(ctx).(*Configuration) - errs = errs.Also(apis.ValidateCreatorAndModifier(original.Spec, c.Spec, original.GetAnnotations(), - c.GetAnnotations(), serving.GroupName).ViaField("metadata.annotations")) + // Don't validate annotations(creator and lastModifier) when configuration owned by service + // validate only when configuration created independently. + if c.OwnerReferences == nil { + errs = errs.Also(apis.ValidateCreatorAndModifier(original.Spec, c.Spec, original.GetAnnotations(), + c.GetAnnotations(), serving.GroupName).ViaField("metadata.annotations")) + } err := c.Spec.Template.VerifyNameChange(ctx, original.Spec.Template) errs = errs.Also(err.ViaField("spec.template")) } diff --git a/vendor/knative.dev/serving/pkg/apis/serving/v1beta1/route_validation.go b/vendor/knative.dev/serving/pkg/apis/serving/v1beta1/route_validation.go index ee856cbc30..d2ccf00372 100644 --- a/vendor/knative.dev/serving/pkg/apis/serving/v1beta1/route_validation.go +++ b/vendor/knative.dev/serving/pkg/apis/serving/v1beta1/route_validation.go @@ -34,8 +34,12 @@ func (r *Route) Validate(ctx context.Context) *apis.FieldError { if apis.IsInUpdate(ctx) { original := apis.GetBaseline(ctx).(*Route) - errs = errs.Also(apis.ValidateCreatorAndModifier(original.Spec, r.Spec, original.GetAnnotations(), - r.GetAnnotations(), serving.GroupName).ViaField("metadata.annotations")) + // Don't validate annotations(creator and lastModifier) when route owned by service + // validate only when route created independently. + if r.OwnerReferences == nil { + errs = errs.Also(apis.ValidateCreatorAndModifier(original.Spec, r.Spec, original.GetAnnotations(), + r.GetAnnotations(), serving.GroupName).ViaField("metadata.annotations")) + } } return errs } diff --git a/vendor/modules.txt b/vendor/modules.txt index 2b08f76776..44f90cba6d 100644 --- a/vendor/modules.txt +++ b/vendor/modules.txt @@ -652,7 +652,7 @@ knative.dev/pkg/logging/logkey knative.dev/pkg/controller knative.dev/pkg/metrics knative.dev/pkg/metrics/metricskey -# knative.dev/serving v0.10.0 +# knative.dev/serving v0.11.0 knative.dev/serving/pkg/client/clientset/versioned/typed/serving/v1alpha1 knative.dev/serving/pkg/client/clientset/versioned/typed/serving/v1alpha1/fake knative.dev/serving/pkg/apis/serving From 11d6e284adbc5dd59d6bf384b685d5422854929d Mon Sep 17 00:00:00 2001 From: Navid Shaikh Date: Tue, 10 Dec 2019 23:40:48 +0530 Subject: [PATCH 2/2] Run tests against serving v0.11.0 --- test/presubmit-integration-tests-latest-release.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/test/presubmit-integration-tests-latest-release.sh b/test/presubmit-integration-tests-latest-release.sh index 1e4656b0eb..3d05bda475 100755 --- a/test/presubmit-integration-tests-latest-release.sh +++ b/test/presubmit-integration-tests-latest-release.sh @@ -19,6 +19,6 @@ # We currently take 0.10.0 for Serving and 0.10.2 for Eventing as the # latest release version. -export KNATIVE_SERVING_VERSION="0.10.0" +export KNATIVE_SERVING_VERSION="0.11.0" export KNATIVE_EVENTING_VERSION="0.10.2" $(dirname $0)/presubmit-tests.sh --integration-tests