Skip to content

Commit

Permalink
use new internaltls name
Browse files Browse the repository at this point in the history
  • Loading branch information
KauzClay committed Sep 22, 2023
1 parent dc0537b commit 6f465fb
Show file tree
Hide file tree
Showing 7 changed files with 10 additions and 10 deletions.
4 changes: 2 additions & 2 deletions pkg/reconciler/autoscaling/config/store_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -66,7 +66,7 @@ func TestStoreImmutableConfig(t *testing.T) {
config := store.Load()
config.Autoscaler.MaxScaleUpRate = 100.0
config.Deployment.ProgressDeadline = 3 * time.Minute
config.Network.KnativeInternalTLS = netcfg.EncryptionEnabled
config.Network.SystemInternalTLS = netcfg.EncryptionEnabled
newConfig := store.Load()

if newConfig.Autoscaler.MaxScaleUpRate == 100.0 {
Expand All @@ -76,7 +76,7 @@ func TestStoreImmutableConfig(t *testing.T) {
t.Error("Deployment config is not immutable")
}

if newConfig.Network.KnativeInternalTLS != netcfg.EncryptionDisabled {
if newConfig.Network.SystemInternalTLS != netcfg.EncryptionDisabled {
t.Error("Network config is not immutable")
}
}
2 changes: 1 addition & 1 deletion pkg/reconciler/autoscaling/kpa/kpa.go
Original file line number Diff line number Diff line change
Expand Up @@ -128,7 +128,7 @@ func (c *Reconciler) ReconcileKind(ctx context.Context, pa *autoscalingv1alpha1.
// When activator CA is enabled, force activator always in path.
// TODO: This is a temporary state and to be fixed.
// See also issues/11906 and issues/12797.
case config.FromContext(ctx).Network.KnativeInternalTLSEnabled():
case config.FromContext(ctx).Network.SystemInternalTLSEnabled():
mode = nv1alpha1.SKSOperationModeProxy

// If the want == -1 and PA is inactive that implies the autoscaler
Expand Down
4 changes: 2 additions & 2 deletions pkg/reconciler/autoscaling/kpa/kpa_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -128,7 +128,7 @@ func initialScaleZeroASConfig() *autoscalerconfig.Config {

func activatorCertsNetConfig() *netcfg.Config {
nc, _ := netcfg.NewConfigFromMap(map[string]string{
netcfg.KnativeInternalTLSKey: "enabled",
netcfg.SystemInternalTLSKey: "enabled",
})
return nc
}
Expand All @@ -140,7 +140,7 @@ func defaultConfig() *config.Config {
deployment.ProgressDeadlineKey: progressDeadline.String(),
})
networkConfig, _ := netcfg.NewConfigFromMap(map[string]string{
netcfg.KnativeInternalTLSKey: "disabled",
netcfg.SystemInternalTLSKey: "disabled",
})

return &config.Config{
Expand Down
4 changes: 2 additions & 2 deletions pkg/reconciler/route/resources/ingress.go
Original file line number Diff line number Diff line change
Expand Up @@ -149,7 +149,7 @@ func makeIngressSpec(
return netv1alpha1.IngressSpec{}, err
}
rule := makeIngressRule(domains, r.Namespace,
visibility, tc.Targets[name], ro.RolloutsByTag(name), networkConfig.KnativeInternalTLSEnabled())
visibility, tc.Targets[name], ro.RolloutsByTag(name), networkConfig.SystemInternalTLSEnabled())
if featuresConfig.TagHeaderBasedRouting == apicfg.Enabled {
if rule.HTTP.Paths[0].AppendHeaders == nil {
rule.HTTP.Paths[0].AppendHeaders = make(map[string]string, 1)
Expand All @@ -171,7 +171,7 @@ func makeIngressSpec(
// Since names are sorted `DefaultTarget == ""` is the first one,
// so just pass the subslice.
rule.HTTP.Paths = append(
makeTagBasedRoutingIngressPaths(r.Namespace, tc, ro, networkConfig.KnativeInternalTLSEnabled(), names[1:]), rule.HTTP.Paths...)
makeTagBasedRoutingIngressPaths(r.Namespace, tc, ro, networkConfig.SystemInternalTLSEnabled(), names[1:]), rule.HTTP.Paths...)
} else {
// If a request is routed by a tag-attached hostname instead of the tag header,
// the request may not have the tag header "Knative-Serving-Tag",
Expand Down
2 changes: 1 addition & 1 deletion pkg/reconciler/route/resources/ingress_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -1427,6 +1427,6 @@ func testContextWithHTTPOption() context.Context {

func testContextWithActivatorCA() context.Context {
cfg := testConfig()
cfg.Network.KnativeInternalTLS = netcfg.EncryptionEnabled
cfg.Network.SystemInternalTLS = netcfg.EncryptionEnabled
return config.ToContext(context.Background(), cfg)
}
2 changes: 1 addition & 1 deletion pkg/reconciler/route/resources/service_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -419,7 +419,7 @@ func testConfig() *config.Config {
DefaultIngressClass: "test-ingress-class",
DomainTemplate: netcfg.DefaultDomainTemplate,
TagTemplate: netcfg.DefaultTagTemplate,
KnativeInternalTLS: netcfg.EncryptionDisabled,
SystemInternalTLS: netcfg.EncryptionDisabled,
},
Features: &apiConfig.Features{
MultiContainer: apiConfig.Disabled,
Expand Down
2 changes: 1 addition & 1 deletion test/e2e/autoscale_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -175,7 +175,7 @@ func TestTargetBurstCapacity(t *testing.T) {
}

// TODO: Remove this when "activator always stay in path" is eliminated.
dataplaneTrustMode := cm.Data[netcfg.KnativeInternalTLSKey]
dataplaneTrustMode := cm.Data[netcfg.SystemInternalTLSKey]
if (dataplaneTrustMode != "" && !strings.EqualFold(dataplaneTrustMode, string(netcfg.EncryptionDisabled))) || strings.EqualFold(cm.Data[netcfg.InternalEncryptionKey], "true") {
t.Skip("Skipping TestTargetBurstCapacity as activator always stay in path.")
}
Expand Down

0 comments on commit 6f465fb

Please sign in to comment.