Skip to content
This repository was archived by the owner on Dec 18, 2018. It is now read-only.
This repository was archived by the owner on Dec 18, 2018. It is now read-only.

[Question] How does reloadOnChange work in AddJsonFile #908

@Marusyk

Description

@Marusyk

I have this code in Program.cs

return WebHost.CreateDefaultBuilder(args)
	.ConfigureAppConfiguration((hostingContext, config) =>
	{
		config
			.SetBasePath(hostingContext.HostingEnvironment.ContentRootPath)
			.AddJsonFile(Path.Combine("configurations", "ocelot.json"), false, reloadOnChange: true)
			.AddEnvironmentVariables();
	})
	.UseStartup<Startup>();

Then I run my app in Docker container that managed by k8s.
I've created ConfigMap and in Deployment add volume to that file (ocelot.json). So, I expected when ConfigMap changes then my file ocelot.json also should change. And it does. I exec container and check that file has changed but my app doesn't see that.

Also I check sha1sum of file before and after change ConfigMap and it is different. What is the problem? Why my app doesn't see that changes?

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