Skip to content
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

When cr annotation update,sts annotations will not updated! #398

Merged

Conversation

jiuker
Copy link
Contributor

@jiuker jiuker commented Dec 9, 2022

Description

When Cr annotations updated, the VolumeClaimTemplates's annotations update everyTime

if !apiequality.Semantic.DeepEqual(newStateful.Spec.VolumeClaimTemplates, storedStateful.Spec.VolumeClaimTemplates) {
				// resize pvc
				// 1.Get the data already stored internally
				// 2.Get the desired data
				// 3.Start querying the pvc list when you find data inconsistencies
				// 3.1 Comparison using real pvc capacity and desired data
				// 3.1.1 Update if you find inconsistencies
				// 3.2 Writing successful updates to internal
				// 4. Set to old VolumeClaimTemplates to update.Prevent update error reporting
				// 5. Set to old annotations to update
				annotations := storedStateful.Annotations
				if annotations == nil {
					annotations = map[string]string{
						"storageCapacity": "0",
					}
				}

will go in.
and end of the,will be set

			newStateful.Annotations = storedStateful.Annotations

so,the newStateful with the newest annotations will be set old annotations again.
In fact,just set storageCapacity . and compare VolumeClaimTemplates[0].spec is ok

Fixes #ISSUE

Type of change

  • Bug fix (non-breaking change which fixes an issue)
  • New feature (non-breaking change which adds functionality)
  • Breaking change (fix or feature that would cause existing functionality to not work as expected)

Checklist

  • Testing has been performed
  • No functionality is broken
  • Documentation updated

@jiuker jiuker force-pushed the fix_cr_update_annotations branch 2 times, most recently from 28ea2f6 to 3de6a21 Compare December 9, 2022 14:49
@jiuker jiuker force-pushed the fix_cr_update_annotations branch from ef48c5f to 4603d9d Compare December 9, 2022 15:16
@jiuker
Copy link
Contributor Author

jiuker commented Dec 26, 2022

@iamabhishek-dubey

@iamabhishek-dubey iamabhishek-dubey merged commit 0e975e1 into OT-CONTAINER-KIT:master Dec 28, 2022
devkmsg added a commit to devkmsg/redis-operator that referenced this pull request Mar 7, 2023
…HOMPSON/redis-operator:sync-upstream-0.14 to master

Auto-Merge: Pull request OT-CONTAINER-KIT#11: [AUTO] Sync upstream @ v0.14

Merge in OSS/redis-operator from ~ATHOMPSON/redis-operatorsync-upstream-0.14 to master

* commit 'e86884ead1005484bdb10fb30caf8f8acac2f89b': (49 commits)
  [Feature] Add Redis Sentinel Support  (OT-CONTAINER-KIT#408)
  Fixed Redis Replicate Cache bug (OT-CONTAINER-KIT#424)
  [Feature] : Add Replication Mode to the Redis Operator (OT-CONTAINER-KIT#417)
  [Development][Add] Added recreation logic for statefulset (OT-CONTAINER-KIT#411)
  Fixes issue with arm64 support. (OT-CONTAINER-KIT#404)
  [Development][Add] Added nodeSelector and tolerations for cluster (OT-CONTAINER-KIT#410)
  Add Label Selector to pod anti affinity  (OT-CONTAINER-KIT#407)
  When cr annotation update,sts annotations will not updated! (OT-CONTAINER-KIT#398)
  fix: invalid memory address or nil pointer dereference (OT-CONTAINER-KIT#395)
  export redis exporter as a container port (OT-CONTAINER-KIT#393)
  [Development][Add] Added feature for additional volume mounts (OT-CONTAINER-KIT#389)
  fix crash with go panic (OT-CONTAINER-KIT#385)
  Add check PersistenceEnabled not nil (OT-CONTAINER-KIT#380)
  [feature]add serviceType functionality for standalone and cluster with annotations (OT-CONTAINER-KIT#376)
  [Development][Update]Updated information for v0.13.0 (OT-CONTAINER-KIT#374)
  Create CODE_OF_CONDUCT.md
  [feature]add tls for redis-standlone (OT-CONTAINER-KIT#372)
  Update README.md
  Create package.json
  Revamped documentation for better knowledge base (OT-CONTAINER-KIT#370)
  ...
devkmsg added a commit to devkmsg/redis-operator that referenced this pull request Jan 30, 2024
…/internal patches

Merge in OSS/redis-operator from ~ATHOMPSON/redis-operator:sync-internal-cs-main-to-0.14 to cs-main

* commit '2ea8fcaf61b322186f8a0a2c4e7bcb310f55ea2d':
  Revert "Handle nil probe"
  Handle nil probe
  Bumps prometheus/client_golang to address vuln
  Adds CODEOWNERS for our internal branch
  [Feature] Add Redis Sentinel Support  (OT-CONTAINER-KIT#408)
  Fixed Redis Replicate Cache bug (OT-CONTAINER-KIT#424)
  [Feature] : Add Replication Mode to the Redis Operator (OT-CONTAINER-KIT#417)
  [Development][Add] Added recreation logic for statefulset (OT-CONTAINER-KIT#411)
  Fixes issue with arm64 support. (OT-CONTAINER-KIT#404)
  [Development][Add] Added nodeSelector and tolerations for cluster (OT-CONTAINER-KIT#410)
  Add Label Selector to pod anti affinity  (OT-CONTAINER-KIT#407)
  When cr annotation update,sts annotations will not updated! (OT-CONTAINER-KIT#398)
  fix: invalid memory address or nil pointer dereference (OT-CONTAINER-KIT#395)
  export redis exporter as a container port (OT-CONTAINER-KIT#393)
  [Development][Add] Added feature for additional volume mounts (OT-CONTAINER-KIT#389)
  fix crash with go panic (OT-CONTAINER-KIT#385)
  Add check PersistenceEnabled not nil (OT-CONTAINER-KIT#380)
  [feature]add serviceType functionality for standalone and cluster with annotations (OT-CONTAINER-KIT#376)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants