Changes the K8s workload attestor to invalidate the cache response based on a timestamp instead of kicking off a goroutine.
While this means that the plugin will always have a cached response in memory, it simplifies the code for both the plugin and tests. In practice, only an idle agent would waste memory holding onto the response.
Also fixes a bug wherein the plugin was reading from p.config outside of the config lock (to calculate how long the response should be cached for).
Changes the K8s workload attestor to invalidate the cache response based on a timestamp instead of kicking off a goroutine.
While this means that the plugin will always have a cached response in memory, it simplifies the code for both the plugin and tests. In practice, only an idle agent would waste memory holding onto the response.
Also fixes a bug wherein the plugin was reading from p.config outside of the config lock (to calculate how long the response should be cached for).