Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
16 changes: 8 additions & 8 deletions pkg/reconciler/autoscaling/hpa/hpa_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -90,7 +90,7 @@ func TestReconcile(t *testing.T) {
Name: "no op",
Objects: []runtime.Object{
hpa(testRevision, testNamespace, pa(testRevision, testNamespace, WithHPAClass, WithMetricAnnotation("cpu"))),
pa(testRevision, testNamespace, WithHPAClass, WithTraffic, WithPAStatusService(testRevision+"-pub")),
pa(testRevision, testNamespace, WithHPAClass, WithTraffic, WithPAStatusService(testRevision)),
deploy(testNamespace, testRevision),
sks(testNamespace, testRevision, WithDeployRef(deployName), WithSKSReady),
},
Expand Down Expand Up @@ -124,7 +124,7 @@ func TestReconcile(t *testing.T) {
WantStatusUpdates: []ktesting.UpdateActionImpl{{
Object: pa(testRevision, testNamespace, WithHPAClass, WithTraffic,
WithNoTraffic("ServicesNotReady", "SKS Services are not ready yet"),
WithPAStatusService(testRevision+"-pub")),
WithPAStatusService(testRevision)),
}},
Key: key(testRevision, testNamespace),
}, {
Expand All @@ -138,7 +138,7 @@ func TestReconcile(t *testing.T) {
},
WantStatusUpdates: []ktesting.UpdateActionImpl{{
Object: pa(testRevision, testNamespace, WithHPAClass,
WithTraffic, WithPAStatusService(testRevision+"-pub")),
WithTraffic, WithPAStatusService(testRevision)),
}},
Key: key(testRevision, testNamespace),
}, {
Expand All @@ -152,7 +152,7 @@ func TestReconcile(t *testing.T) {
WithSKSReady),
},
WantStatusUpdates: []ktesting.UpdateActionImpl{{
Object: pa(testRevision, testNamespace, WithHPAClass, WithTraffic, WithPAStatusService(testRevision+"-pub")),
Object: pa(testRevision, testNamespace, WithHPAClass, WithTraffic, WithPAStatusService(testRevision)),
}},
Key: key(testRevision, testNamespace),
WantUpdates: []ktesting.UpdateActionImpl{{
Expand All @@ -171,7 +171,7 @@ func TestReconcile(t *testing.T) {
WantStatusUpdates: []ktesting.UpdateActionImpl{{
Object: pa(testRevision, testNamespace, WithHPAClass,
WithNoTraffic("ServicesNotReady", "SKS Services are not ready yet"),
WithPAStatusService(testRevision+"-pub")),
WithPAStatusService(testRevision)),
}},
Key: key(testRevision, testNamespace),
WantUpdates: []ktesting.UpdateActionImpl{{
Expand Down Expand Up @@ -331,7 +331,7 @@ func TestReconcile(t *testing.T) {
},
WantStatusUpdates: []ktesting.UpdateActionImpl{{
Object: pa(testRevision, testNamespace, WithHPAClass,
WithTraffic, WithPAStatusService(testRevision+"-pub")),
WithTraffic, WithPAStatusService(testRevision)),
}},
Key: key(testRevision, testNamespace),
WantErr: true,
Expand All @@ -345,7 +345,7 @@ func TestReconcile(t *testing.T) {
Name: "update hpa fails",
Objects: []runtime.Object{
pa(testRevision, testNamespace, WithHPAClass, WithTraffic,
WithPAStatusService(testRevision+"-pub"), WithTargetAnnotation("1")),
WithPAStatusService(testRevision), WithTargetAnnotation("1")),
hpa(testRevision, testNamespace, pa(testRevision, testNamespace, WithHPAClass, WithMetricAnnotation("cpu"))),
sks(testNamespace, testRevision, WithDeployRef(deployName), WithSKSReady),
deploy(testNamespace, testRevision),
Expand All @@ -365,7 +365,7 @@ func TestReconcile(t *testing.T) {
Name: "update hpa with target usage",
Objects: []runtime.Object{
pa(testRevision, testNamespace, WithHPAClass, WithTraffic,
WithPAStatusService(testRevision+"-pub"), WithTargetAnnotation("1")),
WithPAStatusService(testRevision), WithTargetAnnotation("1")),
hpa(testRevision, testNamespace, pa(testRevision, testNamespace, WithHPAClass, WithMetricAnnotation("cpu"))),
deploy(testNamespace, testRevision),
sks(testNamespace, testRevision, WithDeployRef(deployName), WithSKSReady),
Expand Down
46 changes: 23 additions & 23 deletions pkg/reconciler/autoscaling/kpa/kpa_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -173,7 +173,7 @@ func TestReconcileAndScaleToZero(t *testing.T) {
Objects: []runtime.Object{
kpa(testNamespace, testRevision,
WithNoTraffic("NoTraffic", "The target is not receiving traffic."),
markOld, WithPAStatusService(testRevision+"-pub")),
markOld, WithPAStatusService(testRevision)),
sks(testNamespace, testRevision, WithDeployRef(deployName), WithProxyMode, WithSKSReady),
metricsSvc(testNamespace, testRevision, withSvcSelector(usualSelector)),
deploy(testNamespace, testRevision, func(d *appsv1.Deployment) {
Expand All @@ -189,7 +189,7 @@ func TestReconcileAndScaleToZero(t *testing.T) {
Objects: []runtime.Object{
kpa(testNamespace, testRevision,
WithNoTraffic("NoTraffic", "The target is not receiving traffic."),
markOld, WithPAStatusService(testRevision+"-pub")),
markOld, WithPAStatusService(testRevision)),
sks(testNamespace, testRevision, WithDeployRef(deployName), WithProxyMode, WithSKSReady),
metricsSvc(testNamespace, testRevision, withSvcSelector(usualSelector)),
deploy(testNamespace, testRevision),
Expand All @@ -208,7 +208,7 @@ func TestReconcileAndScaleToZero(t *testing.T) {
Key: key,
Objects: []runtime.Object{
kpa(testNamespace, testRevision, markActive, markOld,
WithPAStatusService(testRevision+"-pub")),
WithPAStatusService(testRevision)),
sks(testNamespace, testRevision, WithDeployRef(deployName), WithSKSReady),
metricsSvc(testNamespace, testRevision, withSvcSelector(usualSelector)),
deploy(testNamespace, testRevision),
Expand All @@ -217,7 +217,7 @@ func TestReconcileAndScaleToZero(t *testing.T) {
WantStatusUpdates: []clientgotesting.UpdateActionImpl{{
Object: kpa(testNamespace, testRevision,
WithNoTraffic("NoTraffic", "The target is not receiving traffic."),
WithPAStatusService(testRevision+"-pub")),
WithPAStatusService(testRevision)),
}},
WantUpdates: []clientgotesting.UpdateActionImpl{{
Object: sks(testNamespace, testRevision, WithSKSReady,
Expand All @@ -228,7 +228,7 @@ func TestReconcileAndScaleToZero(t *testing.T) {
Key: key,
Objects: []runtime.Object{
kpa(testNamespace, testRevision, markActive, markOld,
WithPAStatusService(testRevision+"-pub")),
WithPAStatusService(testRevision)),
sks(testNamespace, testRevision, WithDeployRef(deployName), WithSKSReady),
metricsSvc(testNamespace, testRevision, withSvcSelector(usualSelector)),
deploy(testNamespace, testRevision),
Expand All @@ -245,7 +245,7 @@ func TestReconcileAndScaleToZero(t *testing.T) {
WantStatusUpdates: []clientgotesting.UpdateActionImpl{{
Object: kpa(testNamespace, testRevision,
WithNoTraffic("NoTraffic", "The target is not receiving traffic."),
WithPAStatusService(testRevision+"-pub")),
WithPAStatusService(testRevision)),
}},
WantUpdates: []clientgotesting.UpdateActionImpl{{
Object: sks(testNamespace, testRevision, WithSKSReady,
Expand All @@ -256,7 +256,7 @@ func TestReconcileAndScaleToZero(t *testing.T) {
Key: key,
Objects: []runtime.Object{
kpa(testNamespace, testRevision, markActive,
WithPAStatusService(testRevision+"-pub")),
WithPAStatusService(testRevision)),
sks(testNamespace, testRevision, WithDeployRef(deployName), WithSKSReady),
metricsSvc(testNamespace, testRevision, withSvcSelector(usualSelector)),
deploy(testNamespace, testRevision),
Expand Down Expand Up @@ -329,7 +329,7 @@ func TestReconcile(t *testing.T) {
Key: key,
Objects: []runtime.Object{
kpa(testNamespace, testRevision, markActive,
WithPAStatusService(testRevision+"-pub")),
WithPAStatusService(testRevision)),
sks(testNamespace, testRevision, WithDeployRef(deployName), WithSKSReady),
metricsSvc(testNamespace, testRevision, withSvcSelector(usualSelector)),
expectedDeploy,
Expand All @@ -340,7 +340,7 @@ func TestReconcile(t *testing.T) {
Key: key,
Objects: []runtime.Object{
kpa(testNamespace, testRevision, markActive,
WithPAStatusService(testRevision+"-pub")),
WithPAStatusService(testRevision)),
sks(testNamespace, testRevision, WithDeployRef(deployName), WithSKSReady),
expectedDeploy,
makeSKSPrivateEndpoints(1, testNamespace, testRevision),
Expand All @@ -357,7 +357,7 @@ func TestReconcile(t *testing.T) {
WantErr: true,
Objects: []runtime.Object{
kpa(testNamespace, testRevision, markActive,
WithPAStatusService(testRevision+"-pub")),
WithPAStatusService(testRevision)),
sks(testNamespace, testRevision, WithDeployRef(deployName), WithSKSReady),
expectedDeploy,
makeSKSPrivateEndpoints(1, testNamespace, testRevision),
Expand All @@ -374,7 +374,7 @@ func TestReconcile(t *testing.T) {
Key: key,
Objects: []runtime.Object{
kpa(testNamespace, testRevision, markActive,
WithPAStatusService(testRevision+"-pub")),
WithPAStatusService(testRevision)),
sks(testNamespace, testRevision, WithDeployRef(deployName), WithSKSReady),
metricsSvc(testNamespace, testRevision, withSvcSelector(usualSelector)),
deploy(testNamespace, testRevision),
Expand All @@ -396,7 +396,7 @@ func TestReconcile(t *testing.T) {
WantErr: true,
Objects: []runtime.Object{
kpa(testNamespace, testRevision, markActive,
WithPAStatusService(testRevision+"-pub")),
WithPAStatusService(testRevision)),
sks(testNamespace, testRevision, WithDeployRef(deployName), WithSKSReady),
metricsSvc(testNamespace, testRevision, withSvcSelector(usualSelector)),
deploy(testNamespace, testRevision),
Expand All @@ -418,7 +418,7 @@ func TestReconcile(t *testing.T) {
Key: key,
Objects: []runtime.Object{
kpa(testNamespace, testRevision, markActive,
WithPAStatusService(testRevision+"-pub")),
WithPAStatusService(testRevision)),
sks(testNamespace, testRevision, WithDeployRef(deployName), WithSKSReady),
expectedDeploy,
makeSKSPrivateEndpoints(1, testNamespace, testRevision),
Expand All @@ -436,7 +436,7 @@ func TestReconcile(t *testing.T) {
WantErr: true,
Objects: []runtime.Object{
kpa(testNamespace, testRevision, markActive,
WithPAStatusService(testRevision+"-pub")),
WithPAStatusService(testRevision)),
sks(testNamespace, testRevision, WithDeployRef(deployName), WithSKSReady),
expectedDeploy,
makeSKSPrivateEndpoints(1, testNamespace, testRevision),
Expand All @@ -455,7 +455,7 @@ func TestReconcile(t *testing.T) {
WantErr: true,
Objects: []runtime.Object{
kpa(testNamespace, testRevision, markActive,
WithPAStatusService(testRevision+"-pub")),
WithPAStatusService(testRevision)),
sks(testNamespace, testRevision, WithDeployRef(deployName), WithSKSReady),
metricsSvc(testNamespace, testRevision, withSvcSelector(usualSelector), func(s *corev1.Service) {
s.OwnerReferences = nil
Expand All @@ -464,7 +464,7 @@ func TestReconcile(t *testing.T) {
makeSKSPrivateEndpoints(1, testNamespace, testRevision),
},
WantStatusUpdates: []clientgotesting.UpdateActionImpl{{
Object: kpa(testNamespace, testRevision, markActive, WithPAStatusService(testRevision+"-pub"),
Object: kpa(testNamespace, testRevision, markActive, WithPAStatusService(testRevision),
// We expect this change in status:
markResourceNotOwned("Service", testRevision+"-metrics")),
}},
Expand All @@ -476,7 +476,7 @@ func TestReconcile(t *testing.T) {
Key: key,
Objects: []runtime.Object{
kpa(testNamespace, testRevision, markActive,
WithPAStatusService(testRevision+"-pub")),
WithPAStatusService(testRevision)),
sks(testNamespace, testRevision, WithDeployRef(deployName), WithSKSReady),
metricsSvc(testNamespace, testRevision, withSvcSelector(usualSelector)),
expectedDeploy,
Expand All @@ -491,7 +491,7 @@ func TestReconcile(t *testing.T) {
Key: key,
Objects: []runtime.Object{
kpa(testNamespace, testRevision, WithNoTraffic("NoTraffic", "The target is not receiving traffic."),
WithPAStatusService(testRevision+"-pub")),
WithPAStatusService(testRevision)),
// SKS is ready here, since its endpoints are populated with Activator endpoints.
sks(testNamespace, testRevision, WithProxyMode, WithDeployRef(deployName), WithSKSReady),
metricsSvc(testNamespace, testRevision, withSvcSelector(usualSelector)),
Expand All @@ -504,21 +504,21 @@ func TestReconcile(t *testing.T) {
WithDeployRef(deployName)),
}},
WantStatusUpdates: []clientgotesting.UpdateActionImpl{{
Object: kpa(testNamespace, testRevision, markActivating, WithPAStatusService(testRevision+"-pub")),
Object: kpa(testNamespace, testRevision, markActivating, WithPAStatusService(testRevision)),
}},
}, {
Name: "sks is still not ready",
Key: key,
Objects: []runtime.Object{
kpa(testNamespace, testRevision, WithTraffic,
WithPAStatusService(testRevision+"-pub")),
WithPAStatusService(testRevision)),
sks(testNamespace, testRevision, WithDeployRef(deployName), WithPubService, WithPrivateService),
metricsSvc(testNamespace, testRevision, withSvcSelector(usualSelector)),
expectedDeploy,
makeSKSPrivateEndpoints(1, testNamespace, testRevision),
},
WantStatusUpdates: []clientgotesting.UpdateActionImpl{{
Object: kpa(testNamespace, testRevision, markActivating, WithPAStatusService(testRevision+"-pub")),
Object: kpa(testNamespace, testRevision, markActivating, WithPAStatusService(testRevision)),
}},
}, {
Name: "sks becomes ready",
Expand All @@ -531,7 +531,7 @@ func TestReconcile(t *testing.T) {
makeSKSPrivateEndpoints(1, testNamespace, testRevision),
},
WantStatusUpdates: []clientgotesting.UpdateActionImpl{{
Object: kpa(testNamespace, testRevision, markActive, WithPAStatusService(testRevision+"-pub")),
Object: kpa(testNamespace, testRevision, markActive, WithPAStatusService(testRevision)),
}},
}, {
Name: "sks does not exist",
Expand Down Expand Up @@ -561,7 +561,7 @@ func TestReconcile(t *testing.T) {
},
WantStatusUpdates: []clientgotesting.UpdateActionImpl{{
// SKS just got updated and we don't have up to date status.
Object: kpa(testNamespace, testRevision, markActivating, WithPAStatusService(testRevision+"-pub")),
Object: kpa(testNamespace, testRevision, markActivating, WithPAStatusService(testRevision)),
}},
WantUpdates: []clientgotesting.UpdateActionImpl{{
Object: sks(testNamespace, testRevision, WithPubService,
Expand Down
2 changes: 1 addition & 1 deletion pkg/reconciler/revision/revision_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -81,7 +81,7 @@ func testConfiguration() *v1alpha1.Configuration {
}

func serviceName(rn string) string {
return rn + "-pub"
return rn
}

func testReadyEndpoints(revName string) *corev1.Endpoints {
Expand Down
6 changes: 3 additions & 3 deletions pkg/reconciler/route/resources/cluster_ingress_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -397,7 +397,7 @@ func TestMakeClusterIngressRule_InactiveTarget(t *testing.T) {
RevisionName: "revision",
Percent: 100,
},
ServiceName: "strange-quark-pub",
ServiceName: "strange-quark",
Active: false,
}}
domains := []string{"a.com", "b.org"}
Expand Down Expand Up @@ -437,15 +437,15 @@ func TestMakeClusterIngressRule_TwoInactiveTargets(t *testing.T) {
RevisionName: "revision",
Percent: 80,
},
ServiceName: "up-quark-pub",
ServiceName: "up-quark",
Active: false,
}, {
TrafficTarget: v1beta1.TrafficTarget{
ConfigurationName: "new-config",
RevisionName: "new-revision",
Percent: 20,
},
ServiceName: "down-quark-pub",
ServiceName: "down-quark",
Active: false,
}}
domains := []string{"a.com", "b.org"}
Expand Down
Loading