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

Add a mechanism to patch provider configuration post enrollment #3265

Closed
jhrozek opened this issue May 7, 2024 · 1 comment · Fixed by #3468
Closed

Add a mechanism to patch provider configuration post enrollment #3265

jhrozek opened this issue May 7, 2024 · 1 comment · Fixed by #3468
Assignees

Comments

@jhrozek
Copy link
Contributor

jhrozek commented May 7, 2024

This is a follow-up to issue #3263. In addition to storing the provider configuration on provider creation we'll also want to patch the provider configuration after the fact. We might want to implement something like:

message ProviderPatch {
	// to allow generic configuration changes. 
	google.protobuf.Struct config = 1;
}

message PatchProviderRequest {
	Context context = 1;
	ProviderPatch = 2;

	google.protobuf.FieldMask update_mask = 3;
}

message PatchProviderResponse {
	Provider provider = 1;
}

rpc PatchProvider(PatchProviderRequest) returns (PatchProviderResponse) {
	option (google.api.http) {
		patch: "/api/v1/provider"
		body: "patch"
	}
	option (rpc_options) = {
		target_resource = TARGET_RESOURCE_PROJECT;
		relation = RELATION_PROVIDER_UPDATE;
	}
}

and expose that through the CLI. To implement the patch handler we'll need to:

  • Extend the ProviderManager interface with a new PatchProvider method, e.g PatchProvider(ctx context.Context, uuid uuid.UUID, patch minderv1.ProviderPatch) (minderv1.Provider, error)
  • Extend the ProviderClassManager interface with a new Patch method
  • The ProviderManager.PatchProvider would get the correct class manager and call its Patch
  • The per-provider Patch implementation is where the generic protobuf struct is unmarshalled into the correct Go struct and the configuration adjusted
@jhrozek jhrozek self-assigned this May 24, 2024
@jhrozek jhrozek mentioned this issue May 30, 2024
10 tasks
@jhrozek
Copy link
Contributor Author

jhrozek commented Jun 5, 2024

Co-assigning @blkt who will be working on this issue to get it out of draft and merged as I'm away tomorrow and Friday.

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 a pull request may close this issue.

2 participants