[
https://issues.apache.org/jira/browse/KNOX-3528?focusedWorklogId=1050188&page=com.atlassian.jira.plugin.system.issuetabpanels:worklog-tabpanel#worklog-1050188
]
ASF GitHub Bot logged work on KNOX-3528:
----------------------------------------
Author: ASF GitHub Bot
Created on: 26/Oct/26 09:27
Start Date: 26/Oct/26 09:27
Worklog Time Spent: 10m
Work Description: hanicz opened a new pull request, #1469:
URL: https://github.com/apache/knox/pull/1469
…es without an identity-assertion provider are marked UPDATED on every reload
[KNOX-3528](https://issues.apache.org/jira/browse/KNOX-3528) -
DeploymentFactory mutates the cached Topology, so topologies without an
identity-assertion provider are marked UPDATED on every reload
## What changes were proposed in this pull request?
When any file in the topologies directory changed, every topology without an
identity-assertion provider got an UPDATED event and was reactivated, even if
its own file hadn't changed.
`DeploymentFactory.addMissingDefaultProviders()` added a `Default`
identity-assertion provider directly to the `Topology` it was given. That is
the same object `DefaultTopologyService` caches for change detection. On the
next reload the cached topology had one more provider than the re-parsed file,
so `Topology.equals()` failed.
- Add `Topology.shallowCopy()`. It copies metadata and rebuilds the
provider, service and application collections through `addProvider`,
`addService` and `addApplication`. The element objects are shared, not cloned.
- `DeploymentFactory.createDeployment()` deploys from a shallow copy, so the
default provider only ends up in the deployment artifacts. The generated
`gateway.xml` and `topology.xml` are unchanged.
## How was this patch tested?
- `TopologyTest#testShallowCopyIsEqualAndIndependent`: the copy equals the
original, shares its elements, and adding to its collections doesn't affect the
original.
- `DeploymentFactoryFuncTest#testGenericProviderDeploymentContributor`: the
deployment still contains the `Default` identity-assertion provider, and the
input `Topology` is left unchanged. This failed before the fix with
`expected:<1> but was:<2>`.
Verified manually
Issue Time Tracking
-------------------
Worklog Id: (was: 1050188)
Remaining Estimate: 0h
Time Spent: 10m
> DeploymentFactory mutates the cached Topology, so topologies without an
> identity-assertion provider are marked UPDATED on every reload
> --------------------------------------------------------------------------------------------------------------------------------------
>
> Key: KNOX-3528
> URL: https://issues.apache.org/jira/browse/KNOX-3528
> Project: Apache Knox
> Issue Type: Bug
> Components: Server
> Affects Versions: 3.0.0
> Reporter: Tamás Hanicz
> Assignee: Tamás Hanicz
> Priority: Minor
> Time Spent: 10m
> Remaining Estimate: 0h
>
--
This message was sent by Atlassian Jira
(v10.3.26#10030026)