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

support egctl get describe different namespace #1197

Merged
merged 8 commits into from
Jan 26, 2024

Conversation

suchen-sci
Copy link
Contributor

@suchen-sci suchen-sci commented Jan 19, 2024

In Easegress, when using IngressController, MeshController, or GatewayController, resources such as HTTPServers and Pipelines are created in separate namespaces to prevent conflicts. To access these resources, you can utilize the --namespace or --all-namespaces argument for egctl get or egctl describe command.

The use of these arguments is relevant only when employing IngressController, MeshController, or GatewayController. Easegress does not support creating resources in different namespaces by using apis or egctl command.

This pr also fix some previous bugs about get status. In easegress, status and config of traffic object are put into different namespace.
For example, autocertmanager in default namespace, then its status is in default namespace too. But for httpserver (which is traffic object), if httpserver is in default namespace, then its status is in eg-traffic-default. When store status, traffic controller use a special prefix for it.

@codecov-commenter
Copy link

codecov-commenter commented Jan 19, 2024

Codecov Report

All modified and coverable lines are covered by tests ✅

Comparison is base (2aa5400) 79.84% compared to head (81d6786) 79.72%.
Report is 1 commits behind head on main.

❗ Your organization needs to install the Codecov GitHub app to enable full functionality.

Additional details and impacted files
@@            Coverage Diff             @@
##             main    #1197      +/-   ##
==========================================
- Coverage   79.84%   79.72%   -0.12%     
==========================================
  Files         152      152              
  Lines       17163    17196      +33     
==========================================
+ Hits        13703    13709       +6     
- Misses       2805     2828      +23     
- Partials      655      659       +4     

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

@suchen-sci suchen-sci marked this pull request as draft January 23, 2024 03:39
@suchen-sci suchen-sci changed the title support egctl get display resource in different namespace support egctl get describe different namespace Jan 25, 2024
@suchen-sci suchen-sci marked this pull request as ready for review January 25, 2024 04:19
return res, nil
}

func defaultObjectNameSpace() string {
return cluster.TrafficNamespace(cluster.NamespaceDefault)
// trafficObjectStatusNamespace return namespace of traffic object status.
Copy link
Contributor

Choose a reason for hiding this comment

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

I can't understand this comment, what does it mean? And the following line also contains confusing grammar.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

for non-traffic objects, like autocertmanager, it is in namespace default, and its status is in namespace default.

but for traffic objects, they are managed by traffic controller, and traffic controller use specially prefix for status. for example, if a pipeline in namesapce default, then its status in namespace eg-traffic-default.

pkg/api/cluster.go Outdated Show resolved Hide resolved
pkg/object/trafficcontroller/trafficcontroller.go Outdated Show resolved Hide resolved
@@ -99,12 +97,6 @@ var _ easemonitor.Metricer = (*TrafficObjectStatus)(nil)

func init() {
supervisor.Register(&TrafficController{})
api.RegisterObject(&api.APIResource{
Copy link
Contributor

Choose a reason for hiding this comment

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

Why delete this registration?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

cycle import, i move this registration to api pkg. it can't be solved by other way... i try it several times.

pkg/api/object.go Outdated Show resolved Hide resolved
pkg/api/object.go Outdated Show resolved Hide resolved
@xxx7xxxx xxx7xxxx added this pull request to the merge queue Jan 26, 2024
Merged via the queue into easegress-io:main with commit 25e4240 Jan 26, 2024
8 checks passed
@suchen-sci suchen-sci deleted the support-check-namespace branch January 26, 2024 02:17
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 this pull request may close these issues.

None yet

3 participants