Skip to content

Commit 366de96

Browse files
[Multi_K8s-Plugin] Config hash for StatefulSet and DaemonSet (#6697)
Signed-off-by: Mohammed Firdous <124298708+mohammedfirdouss@users.noreply.github.com>
1 parent 92cd52f commit 366de96

2 files changed

Lines changed: 8 additions & 3 deletions

File tree

pkg/app/pipedv1/plugin/kubernetes_multicluster/deployment/annotate.go

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -47,12 +47,10 @@ func annotateConfigHash(manifests []provider.Manifest) error {
4747
}
4848

4949
for _, m := range manifests {
50-
if m.IsDeployment() {
50+
if m.IsDeployment() || m.IsStatefulSet() || m.IsDaemonSet() {
5151
if err := annotateConfigHashToWorkload(m, configMaps, secrets); err != nil {
5252
return err
5353
}
54-
55-
// TODO: Add support for other workload types, such as StatefulSet, DaemonSet, etc.
5654
}
5755
}
5856

pkg/app/pipedv1/plugin/kubernetes_multicluster/provider/manifest.go

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -154,6 +154,13 @@ func (m Manifest) IsStatefulSet() bool {
154154
return isBuiltinAPIGroup(m.body.GroupVersionKind().Group) && m.body.GetKind() == KindStatefulSet
155155
}
156156

157+
// IsDaemonSet returns true if the manifest is a DaemonSet.
158+
// It checks the API group and the kind of the manifest.
159+
func (m Manifest) IsDaemonSet() bool {
160+
// TODO: check the API group more strictly.
161+
return isBuiltinAPIGroup(m.body.GroupVersionKind().Group) && m.body.GetKind() == KindDaemonSet
162+
}
163+
157164
// IsSecret returns true if the manifest is a Secret.
158165
// It checks the API group and the kind of the manifest.
159166
func (m Manifest) IsSecret() bool {

0 commit comments

Comments
 (0)