-
Notifications
You must be signed in to change notification settings - Fork 8k
pilot: set istio.alpn_override: false
in subset clusters
#46496
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
pilot: set istio.alpn_override: false
in subset clusters
#46496
Conversation
Signed-off-by: Jacek Ewertowski <jewertow@redhat.com>
Signed-off-by: Jacek Ewertowski <jewertow@redhat.com>
Signed-off-by: Jacek Ewertowski <jewertow@redhat.com>
Signed-off-by: Jacek Ewertowski <jewertow@redhat.com>
@@ -395,9 +395,13 @@ func AddSubsetToMetadata(md *core.Metadata, subset string) { | |||
} | |||
} | |||
|
|||
// AddALPNOverrideToMetadata adds whether the the ALPN prefix should be added to the header | |||
// to the given core.Metadata struct, if metadata is not initialized, build a new metadata. | |||
func AddALPNOverrideToMetadata(metadata *core.Metadata, alpnOverride bool) *core.Metadata { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
JFYI: alpn_override is always set to "false", and this is very unlikely that we will need to set "true", so I decided to refactor this function to simplify cluster builder.
@@ -218,6 +218,7 @@ func (cb *ClusterBuilder) buildSubsetCluster(opts buildClusterOpts, | |||
// basis in buildCluster, so we can just insert without a copy. | |||
subsetCluster.cluster.Metadata = util.AddConfigInfoMetadata(subsetCluster.cluster.Metadata, destRule.Meta) | |||
util.AddSubsetToMetadata(subsetCluster.cluster.Metadata, subset.Name) | |||
subsetCluster.cluster.Metadata = util.AddALPNOverrideToMetadata(subsetCluster.cluster.Metadata, opts.policy.GetTls().GetMode()) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
As you can see, util.AddSubsetToMetadata
does not return metadata, it does not initialize metadata if it's nil. Do you think that we should follow that semantics?
Signed-off-by: Jacek Ewertowski <jewertow@redhat.com>
Signed-off-by: Jacek Ewertowski <jewertow@redhat.com>
Signed-off-by: Jacek Ewertowski <jewertow@redhat.com>
/retest |
2 similar comments
/retest |
/retest |
In response to a cherrypick label: #46496 failed to apply on top of branch "release-1.19":
|
In response to a cherrypick label: new issue created for failed cherrypick: #46504 |
* Add tests for destination rules with port level settings Signed-off-by: Jacek Ewertowski <jewertow@redhat.com> * Add test cases for subsets Signed-off-by: Jacek Ewertowski <jewertow@redhat.com> * Refactor AddALPNOverrideToMetadata Signed-off-by: Jacek Ewertowski <jewertow@redhat.com> * Update comment for AddALPNOverrideToMetadata Signed-off-by: Jacek Ewertowski <jewertow@redhat.com> * Fix lint error Signed-off-by: Jacek Ewertowski <jewertow@redhat.com> * Add release note Signed-off-by: Jacek Ewertowski <jewertow@redhat.com> * Fix release note Signed-off-by: Jacek Ewertowski <jewertow@redhat.com> --------- Signed-off-by: Jacek Ewertowski <jewertow@redhat.com>
…46529) * Add tests for destination rules with port level settings * Add test cases for subsets * Refactor AddALPNOverrideToMetadata * Update comment for AddALPNOverrideToMetadata * Fix lint error * Add release note * Fix release note --------- Signed-off-by: Jacek Ewertowski <jewertow@redhat.com>
…e"` for SIMPLE and MUTUAL TLS (istio#833) * Set alpnOverride depending on TLS Mode (istio#44918) * Set alpnOverride Signed-off-by: Kalya Subramanian <kasubra@microsoft.com> * remove test logs Signed-off-by: Kalya Subramanian <kasubra@microsoft.com> --------- Signed-off-by: Kalya Subramanian <kasubra@microsoft.com> * pilot: set `istio.alpn_override: false` in subset clusters (istio#46496) (istio#46529) * Add tests for destination rules with port level settings * Add test cases for subsets * Refactor AddALPNOverrideToMetadata * Update comment for AddALPNOverrideToMetadata * Fix lint error * Add release note * Fix release note --------- Signed-off-by: Jacek Ewertowski <jewertow@redhat.com> --------- Signed-off-by: Kalya Subramanian <kasubra@microsoft.com> Signed-off-by: Jacek Ewertowski <jewertow@redhat.com> Co-authored-by: Kalya Subramanian <42158129+ksubrmnn@users.noreply.github.com>
Please provide a description of this PR:
This is a follow-up to #44918.
That PR didn't cover a case where TLS policy is configured for a subset, like this: