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 support for elasticsearch.privileges.cluster #750

Merged
merged 6 commits into from Oct 14, 2021

Conversation

nchaulet
Copy link
Member

@nchaulet nchaulet commented Oct 13, 2021

Description

Related to elastic/package-spec#226

This PR add support for elasticsearch.privileges.cluster in the package manifest. This will allow packages to specify cluster privileges.

@nchaulet nchaulet added enhancement New feature or request v7.16.0 labels Oct 13, 2021
@nchaulet nchaulet self-assigned this Oct 13, 2021
@elasticmachine
Copy link

elasticmachine commented Oct 13, 2021

💚 Build Succeeded

the below badges are clickable and redirect to their specific view in the CI or DOCS
Pipeline View Test View Changes Artifacts preview preview

Expand to view the summary

Build stats

  • Duration: 4 min 53 sec

🤖 GitHub comments

To re-run your PR in the CI, just comment with:

  • /test : Re-trigger the build.

Copy link
Contributor

@mtojek mtojek left a comment

Choose a reason for hiding this comment

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

I'm bit confused, because we don't process this option in the Package Registry at all. It isn't exposed via HTTP API and the package-spec and elastic-package's linter make sure that this is correct.
So, do we need to define it here? WDYT @jsoriano?

IndexTemplateMappings map[string]interface{} `config:"index_template.mappings" json:"index_template.mappings,omitempty" yaml:"index_template.mappings,omitempty"`
IngestPipelineName string `config:"ingest_pipeline.name,omitempty" json:"ingest_pipeline.name,omitempty" yaml:"ingest_pipeline.name,omitempty"`
Privileges *ElasticsearchPrivileges `config:"privileges,omitempty" json:"privileges,omitempty" yaml:"privileges,omitempty"`
type DsElasticsearch struct {
Copy link
Contributor

Choose a reason for hiding this comment

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

nit: let's expand the Ds and replace it with DataStreamElasticsearch

@@ -144,6 +145,14 @@ type Image struct {
Type string `config:"type" json:"type,omitempty"`
}

type PkgElasticsearch struct {
Copy link
Contributor

Choose a reason for hiding this comment

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

nit: same situation, PackageElasticsearch

Privileges *PkgElasticsearchPrivileges `config:"privileges,omitempty" json:"privileges,omitempty" yaml:"privileges,omitempty"`
}

type PkgElasticsearchPrivileges struct {
Copy link
Contributor

Choose a reason for hiding this comment

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

nit: PackageElasticsearchPrivileges

@jsoriano
Copy link
Member

jsoriano commented Oct 14, 2021

I'm bit confused, because we don't process this option in the Package Registry at all. It isn't exposed via HTTP API and the package-spec and elastic-package's linter make sure that this is correct.
So, do we need to define it here? WDYT @jsoriano?

+1, no need to add anything that is not exposed through the API.

@jsoriano
Copy link
Member

Let's close this as it doesn't seem to be neccesary, @nchaulet please reopen if we are missing something, thanks!

@jsoriano jsoriano closed this Oct 14, 2021
@nchaulet
Copy link
Member Author

@mtojek @jsoriano the goal of that PR is to expose elasticsearch.privileges.cluster in the http API you can see it exposed here https://github.com/elastic/package-registry/blob/b7285e51b85d0ac58a12f3172de5d8d4ef1007a5/testdata/generated/package/elasticsearch_privileges/1.0.0/index.json

@nchaulet nchaulet reopened this Oct 14, 2021
@mtojek
Copy link
Contributor

mtojek commented Oct 14, 2021

Ah, thanks for pointing this out, Nicolas! Will this option be used by Kibana before downloading the package? The same information is in manifest hence our concerns.

@nchaulet
Copy link
Member Author

Ah, thanks for pointing this out, Nicolas! Will this option be used by Kibana before downloading the package? The same information is in manifest hence our concerns.

The information will be used in Kibana when installing the package, currently we never consume the manifest.yml directly in Kibana we only use the results from the HTTP api.

…ture-support-elasticsearch-cluster-privileges
@jsoriano
Copy link
Member

we never consume the manifest.yml directly in Kibana

Umm, this is a bit concerning to me. manifest.yml is the source of truth for a package, we shouldn't be duplicating information there in the API, apart of maybe metadata that may be relevant to discovering resources.
This information is only used when installing the package, in that moment the manifest could be used.

@nchaulet
Copy link
Member Author

Umm, this is a bit concerning to me. manifest.yml is the source of truth for a package, we shouldn't be duplicating information there in the API, apart of maybe metadata that may be relevant to discovering resources.
This information is only used when installing the package, in that moment the manifest could be used.

@jsoriano I does not feel confident to change how we consume packages in Kibana right now. Do you think we could move forward with that PR and create an issue to address and discuss that in Kibana?

@jsoriano
Copy link
Member

Yep, let's move this on and discuss later if more things would need to change.

@jsoriano
Copy link
Member

@nchaulet oh btw, could you please add a changelog entry?

@jsoriano jsoriano mentioned this pull request Oct 14, 2021
@nchaulet nchaulet merged commit e1ac6f1 into master Oct 14, 2021
@nchaulet nchaulet deleted the feature-support-elasticsearch-cluster-privileges branch October 14, 2021 15:01
@jsoriano
Copy link
Member

create an issue to address and discuss that in Kibana?

Issue created to discuss the change in Kibana: elastic/kibana#115032

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request v7.16.0
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

4 participants