Skip to content

IgnoreVolumeClaimTemplateTypeMetaAndStatus looks not work #51

@Rory-Z

Description

@Rory-Z

Describe the bug
IgnoreVolumeClaimTemplateTypeMetaAndStatus looks not work

Steps to reproduce the issue:
I tried to compare the two statefulsets like this

opts := []patch.CalculateOption{
    patch.IgnoreStatusFields(), 
    patch.IgnoreVolumeClaimTemplateTypeMetaAndStatus(),
}
patchResult, err := patch.DefaultPatchMaker.Calculate(old, new, opts...)
fmt.Printf("==========================%+v\n", patchResult.String())

I got this

Patch: {"spec":{"volumeClaimTemplates":[{"metadata":{"name":"emqx-data","namespace":"default"},"spec":{"accessModes":["ReadWriteOnce"],"resources":{"requests":{"storage":"20Mi"}},"storageClassName":"standard"},"status":{"phase":"Pending"}},{"metadata":{"name":"emqx-log","namespace":"default"},"spec":{"accessModes":["ReadWriteOnce"],"resources":{"requests":{"storage":"20Mi"}},"storageClassName":"standard"},"status":{"phase":"Pending"}}]}} 

volumeClaimTemplates is not ignored

Expected behavior
volumeClaimTemplates should be ignored

Additional context
k8s-objectmatcher version: v1.7.0
go version: go1.17.3 darwin/amd64

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions