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

Remove Noop NodeResolver plugin #2189

Merged
merged 1 commit into from Apr 2, 2021
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
4 changes: 0 additions & 4 deletions conf/server/server.conf
Expand Up @@ -26,10 +26,6 @@ plugins {
}
}

NodeResolver "noop" {
plugin_data {}
}

KeyManager "memory" {
plugin_data = {}
}
Expand Down
6 changes: 0 additions & 6 deletions conf/server/server_full.conf
Expand Up @@ -452,12 +452,6 @@ plugins {
# }
# }

# NodeResolver "noop": It is mandatory to have at least one node resolver
# plugin configured. This one is a no-op.
NodeResolver "noop" {
plugin_data {}
}

# Notifier "gcs_bundle": A notifier that pushes the latest trust bundle
# contents into an object in Google Cloud Storage.
# Notifier "gcs_bundle" {
Expand Down
4 changes: 0 additions & 4 deletions doc/SPIRE101.md
Expand Up @@ -87,10 +87,6 @@ If you don't already have Docker installed, please follow these [installation in
}
}

NodeResolver "noop" {
plugin_data {}
}

KeyManager "memory" {
plugin_data = {}
}
Expand Down
13 changes: 0 additions & 13 deletions doc/plugin_server_noderesolver_noop.md

This file was deleted.

4 changes: 0 additions & 4 deletions doc/spire_server.md
Expand Up @@ -30,7 +30,6 @@ This document is a configuration reference for SPIRE Server. It includes informa
| NodeAttestor | [x509pop](/doc/plugin_server_nodeattestor_x509pop.md) | A node attestor which attests agent identity using an existing X.509 certificate |
| NodeResolver | [aws_iid](/doc/plugin_server_noderesolver_aws_iid.md) | A node resolver which extends the [aws_iid](/doc/plugin_server_nodeattestor_aws_iid.md) node attestor plugin to support selecting nodes based on additional properties (such as Security Group ID). |
| NodeResolver | [azure_msi](/doc/plugin_server_noderesolver_azure_msi.md) | A node resolver which extends the [azure_msi](/doc/plugin_server_nodeattestor_azure_msi.md) node attestor plugin to support selecting nodes based on additional properties (such as Network Security Group). |
| NodeResolver | [noop](/doc/plugin_server_noderesolver_noop.md) | It is mandatory to have at least one node resolver plugin configured. This one is a no-op |
| Notifier | [gcs_bundle](/doc/plugin_server_notifier_gcs_bundle.md) | A notifier that pushes the latest trust bundle contents into an object in Google Cloud Storage. |
| Notifier | [k8sbundle](/doc/plugin_server_notifier_k8sbundle.md) | A notifier that pushes the latest trust bundle contents into a Kubernetes ConfigMap. |
| UpstreamAuthority | [disk](/doc/plugin_server_upstreamauthority_disk.md) | Uses a CA loaded from disk to sign SPIRE server intermediate certificates. |
Expand Down Expand Up @@ -477,9 +476,6 @@ plugins {
NodeAttestor "join_token" {
plugin_data {}
}
NodeResolver "noop" {
plugin_data {}
}
KeyManager "disk" {
plugin_data {
keys_path = "/opt/spire/.data/keys.json"
Expand Down
19 changes: 14 additions & 5 deletions pkg/server/catalog/catalog.go
Expand Up @@ -31,7 +31,6 @@ import (
"github.com/spiffe/spire/pkg/server/plugin/noderesolver"
nr_aws_iid "github.com/spiffe/spire/pkg/server/plugin/noderesolver/aws"
nr_azure_msi "github.com/spiffe/spire/pkg/server/plugin/noderesolver/azure"
nr_noop "github.com/spiffe/spire/pkg/server/plugin/noderesolver/noop"
"github.com/spiffe/spire/pkg/server/plugin/notifier"
no_gcs_bundle "github.com/spiffe/spire/pkg/server/plugin/notifier/gcsbundle"
no_k8sbundle "github.com/spiffe/spire/pkg/server/plugin/notifier/k8sbundle"
Expand All @@ -49,6 +48,11 @@ import (
upstreamauthorityv0 "github.com/spiffe/spire/proto/spire/plugin/server/upstreamauthority/v0"
)

const (
dataStoreType = "DataStore"
nodeResolverType = "NodeResolver"
)

var (
builtIns = []catalog.Plugin{
// NodeAttestors
Expand All @@ -61,7 +65,6 @@ var (
na_k8s_psat.BuiltIn(),
na_join_token.BuiltIn(),
// NodeResolvers
nr_noop.BuiltIn(),
nr_aws_iid.BuiltIn(),
nr_azure_msi.BuiltIn(),
// UpstreamAuthorities
Expand Down Expand Up @@ -169,13 +172,19 @@ type Repository struct {
func Load(ctx context.Context, config Config) (*Repository, error) {
// Strip out the Datastore plugin configuration and load the SQL plugin
// directly. This allows us to bypass gRPC and get rid of response limits.
dataStoreConfig := config.PluginConfig[datastore.Type]
delete(config.PluginConfig, datastore.Type)
dataStoreConfig := config.PluginConfig[dataStoreType]
delete(config.PluginConfig, dataStoreType)
ds, err := loadSQLDataStore(config.Log, dataStoreConfig)
if err != nil {
return nil, err
}

if _, ok := config.PluginConfig[nodeResolverType]["noop"]; ok {
// TODO: remove in 1.1.0
delete(config.PluginConfig[nodeResolverType], "noop")
config.Log.Warn(`The "noop" NodeResolver is not required, is deprecated, and will be removed from a future release`)
}

pluginConfigs, err := catalog.PluginConfigsFromHCL(config.PluginConfig)
if err != nil {
return nil, err
Expand Down Expand Up @@ -263,7 +272,7 @@ func loadSQLDataStore(log logrus.FieldLogger, datastoreConfig map[string]catalog
return nil, fmt.Errorf("pluggability for the DataStore is deprecated; only the built-in %q plugin is supported", ds_sql.PluginName)
}

sqlConfig, err := catalog.PluginConfigFromHCL(datastore.Type, ds_sql.PluginName, sqlHCLConfig)
sqlConfig, err := catalog.PluginConfigFromHCL(dataStoreType, ds_sql.PluginName, sqlHCLConfig)
if err != nil {
return nil, err
}
Expand Down
2 changes: 0 additions & 2 deletions pkg/server/plugin/datastore/datastore.go
Expand Up @@ -8,8 +8,6 @@ import (
"google.golang.org/protobuf/types/known/wrapperspb"
)

const Type = "DataStore"

// DataStore is the data storage interface
type DataStore interface {
AppendBundle(context.Context, *AppendBundleRequest) (*AppendBundleResponse, error)
Expand Down
39 changes: 0 additions & 39 deletions pkg/server/plugin/noderesolver/noop/noop.go

This file was deleted.