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

cmd: Unwrap adapter modules to get underlying modules #5624

Closed
wants to merge 1 commit into from

Conversation

WeidiDeng
Copy link
Member

Fix 5621.

In addition, this also fixed several add(remove)-package related commands as they can't be used to add or remove adapter related modules.

Before,

image

After,

image

Copy link
Member

@mholt mholt left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Oh, thanks for this!

I was kind of thinking that we should rethink this command...

Technically, by "modules" I mean "config modules" i.e. an extension of the configuration.

I wonder if this command should actually be "list-plugins" to list all the plugins.

Or maybe the semantics shouldn't matter and we should just print everything.

The problem is that config adapters don't keep the same interface as a Caddy module... so we'd have to figure that out.

Can we talk about a fix where we don't wrap the adapters in the first place? I think I'd like that better. 😁

@mholt mholt added the under review 🧐 Review is pending before merging label Jul 10, 2023
@WeidiDeng
Copy link
Member Author

You mean adapters are not part of modules, and will not show as so. However, they will show in the new list-plugin command?

They are of course affected by add / remove package commands.

@WeidiDeng
Copy link
Member Author

What should be the definition of a plugin? Maybe just config-adapters are more expressive?

@francislavoie francislavoie changed the title fix: unwrap adapter modules to get underlying modules cmd: Unwrap adapter modules to get underlying modules Jul 10, 2023
@francislavoie francislavoie added the bug 🐞 Something isn't working label Jul 10, 2023
@francislavoie francislavoie added this to the v2.7.0 milestone Jul 10, 2023
@mholt
Copy link
Member

mholt commented Jul 10, 2023

Well, I'm not sure if a new list-plugins command is the right answer -- maybe it is. I need to think about it more, or maybe have a discussion about other good solutions.

@mholt mholt modified the milestones: v2.7.0, v2.7.1 Jul 25, 2023
@mholt mholt modified the milestones: v2.7.1, v2.7.2 Aug 3, 2023
@francislavoie francislavoie modified the milestones: v2.7.2, v2.7.3 Aug 3, 2023
@mholt mholt modified the milestones: v2.7.3, v2.7.4, 2.9.0 Aug 3, 2023
@mholt
Copy link
Member

mholt commented Sep 26, 2024

Revisiting this...

this also fixed several add(remove)-package related commands as they can't be used to add or remove adapter related modules.

Are you sure this doesn't work? It should still "plug in" the adapters and download the resulting build, even if they don't appear in the list.

I still hesitate to print adapters as if they were config modules with names like caddy.adapters.* because they aren't config modules. They're plugins, at least... but the list-modules command is for config modules.

I think perhaps there is a solution, but probably not this PR. I hope that's OK. Thank you for working on this nonetheless.

What I think we should do instead, to describe the config adapters supported by a Caddy build, is to properly set the Accept header in the admin API, since the Content-Type header is what determines which config adapters to use.

I'm going to close this, but we can open a new PR to set the Accept header. Thanks for understanding, @WeidiDeng. You are great.

@mholt mholt closed this Sep 26, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug 🐞 Something isn't working under review 🧐 Review is pending before merging
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Adapters are counted as standard modules
3 participants