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

[Choreo] Removal of unused internal service resource path named retrieve-api-artifacts and its usage #3639

Open
wants to merge 3 commits into
base: choreo
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 3 additions & 7 deletions adapter/internal/adapter/adapter.go
Original file line number Diff line number Diff line change
Expand Up @@ -373,13 +373,9 @@ func fetchChunkedAPIsOnStartUp(conf *config.Config, apiUUIDList []string, xdsOpt
} else {
adapter.GetAPIs(c, nil, envs, sync.RuntimeArtifactEndpoint, true, nil, queryParamMap)
}
} else {
if conf.ControlPlane.DynamicEnvironments.Enabled {
queryParamMap = common.PopulateQueryParamForDataPlane(queryParamMap)
adapter.GetAPIs(c, nil, nil, sync.RetrieveRuntimeArtifactEndpoint, true, apiUUIDList, queryParamMap)
} else {
adapter.GetAPIs(c, nil, envs, sync.APIArtifactEndpoint, true, apiUUIDList, queryParamMap)
}
} else if conf.ControlPlane.DynamicEnvironments.Enabled {
Copy link
Contributor

Choose a reason for hiding this comment

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

We no longer need Dynamic Environments Enabled flag too.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Config is used in multiple places. Since the issue -> https://github.com/wso2-enterprise/choreo/issues/31875
Is bit urgent shall we track removal of it with another task ?

image image

Choose a reason for hiding this comment

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

If we remove the code, wont the config get ignored or throw an error?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

You mean the cp-overlay config right ?
I'll not throw an error. But we'll have to clean up the repos if we remove the config.

Copy link
Contributor

Choose a reason for hiding this comment

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

If we remove the code, wont the config get ignored or throw an error?

Ignored.
Since it is always TRUE (feature flag) we can think it's boolean true and remove unnecessary if blocks.

queryParamMap = common.PopulateQueryParamForDataPlane(queryParamMap)
adapter.GetAPIs(c, nil, nil, sync.RetrieveRuntimeArtifactEndpoint, true, apiUUIDList, queryParamMap)
}
for i := 0; i < 1; i++ {
data := <-c
Expand Down
2 changes: 0 additions & 2 deletions adapter/pkg/synchronizer/apis_fetcher.go
Original file line number Diff line number Diff line change
Expand Up @@ -51,8 +51,6 @@ const (
RuntimeArtifactEndpoint string = "internal/data/v1/runtime-artifacts"
//RetrieveRuntimeArtifactEndpoint represents the RuntimeArtifactEndpoint endpoint with dataplane identifier
RetrieveRuntimeArtifactEndpoint string = "internal/data/v1/retrieve-runtime-artifacts"
// APIArtifactEndpoint represents the /retrieve-api-artifacts endpoint.
APIArtifactEndpoint string = "internal/data/v1/retrieve-api-artifacts"
// httpTimeout is for connection timeout of httpClient in seconds
httpTimeout time.Duration = 30
)
Expand Down
Loading