sonic-utilities
sonic-utilities copied to clipboard
[db_migrator][telemetry] Remove the telemetry from the feature table
What I did
Feature telemetry has been replaced by GNMI. This PR removes the telemetry feature from FEATURE table to avoid the logging message shown up every minute when upgrade a platform from 202205 to 202405 image. It fixes https://github.com/sonic-net/sonic-buildimage/issues/20056.
The following is the log message:
2024 Aug 28 15:35:12.219750 Linecard WARNING Chassis: Failed to get image 'docker-sonic-telemetry'. Error: '404 Client Error for http+docker://localhost/v1.43/images/docker-sonic-telemetry/json: Not Found ("No such image: docker-sonic-telemetry:latest")'
How I did it
Modified the db_migrator by adding function migrate_remove_feature() to remove the telemetry related configuration in the CONFIG_DB if telemetry config exists. Configuration includes "FEATURE|telemetry" and "AUTO_TECHSUPPORT|telemetry"
How to verify it
- Upgrade a platform which is running 202205 image.
- Using the following command to verify the telemetry is no longer in the CONFIG_BD
admin@ixre-egl-board25:~$ sonic-db-dump -n CONFIG_DB -y -k "FEATURE|telemetry"
{}
admin@ixre-egl-board25:~$ sonic-db-dump -n CONFIG_DB -y -k "AUTO_TECHSUPPORT_FEATURE|telemetry"
{}
- Check the syslog. The following message should not be shown
Linecard WARNING Chassis: Failed to get image 'docker-sonic-telemetry'. Error: '404 Client Error for http+docker://localhost/v1.43/images/docker-sonic-telemetry/json: Not Found ("No such image: docker-sonic-telemetry:latest")'