-
Notifications
You must be signed in to change notification settings - Fork 1
[Feature] UnitedDeployment support patch for pool #12
Conversation
Signed-off-by: kadisi <iamkadisi@163.com>
Signed-off-by: kadisi <iamkadisi@163.com>
@kadisi Would you make up an example that uses the patch field? |
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 a best practice, please update the copyright year to 2021 for all the files that you have touched in the PR.
I think you need to add some UTs to test the merge functionality.
pkg/yurtappmanager/apis/apps/v1alpha1/uniteddeployment_types.go
Outdated
Show resolved
Hide resolved
pkg/yurtappmanager/controller/uniteddeployment/adapter/deployment_adapter.go
Outdated
Show resolved
Hide resolved
pkg/yurtappmanager/controller/uniteddeployment/adapter/statefulset_adapter.go
Outdated
Show resolved
Hide resolved
pkg/yurtappmanager/controller/uniteddeployment/uniteddeployment_controller_utils.go
Outdated
Show resolved
Hide resolved
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.
done
@Fei-Guo PTAL |
@rambohe-ch done, and add some UTs |
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.
Overall LG. Nits
pkg/yurtappmanager/controller/uniteddeployment/adapter/adapter_util.go
Outdated
Show resolved
Hide resolved
pkg/yurtappmanager/controller/uniteddeployment/uniteddeployment_controller_utils.go
Outdated
Show resolved
Hide resolved
pkg/yurtappmanager/apis/apps/v1alpha1/well_known_labels_annotations.go
Outdated
Show resolved
Hide resolved
pkg/yurtappmanager/apis/apps/v1alpha1/uniteddeployment_types.go
Outdated
Show resolved
Hide resolved
config/yurt-app-manager/crd/bases/apps.openyurt.io_uniteddeployments.yaml
Outdated
Show resolved
Hide resolved
Signed-off-by: kadisi <iamkadisi@163.com>
this pr let unitedDeployment support patch for pool.
ref issue 242
for Pool Struct , add new field
Patches
:User can use this
Patches
to applyworkloadTemplate.DeploymentTemplate
orworkloadTemplate.StatefulSetTemplate
configuration. and now only support strategic merge path.For the creation process, workload inherits the
workloadTemplate
configuration. IfPatches
are found in the Pool, it applies theworkloadTemplate
using the strategic merge path. It also saves the patches configuration in the annotation. Please review these documents in detail:pkg/yurtappmanager/controller/uniteddeployment/adapter/deployment_adapter.go
ApplyPoolTemplate
pkg/yurtappmanager/controller/uniteddeployment/adapter/statefulset_adapter.go
ApplyPoolTemplate
For the update process, the controller determines whether the annotation patches configuration in the workload matches the pool patches configuration. If not, trigger an update operation.
this is an example:
add an
patch
field for poolcc @Fei-Guo @huangyuqi @charleszheng44