2023-03-28 18:39:22 +00:00
|
|
|
// Copyright (c) HashiCorp, Inc.
|
|
|
|
// SPDX-License-Identifier: MPL-2.0
|
|
|
|
|
2023-03-13 21:19:11 +00:00
|
|
|
//go:build !consulent
|
|
|
|
// +build !consulent
|
|
|
|
|
|
|
|
package state
|
|
|
|
|
|
|
|
import (
|
|
|
|
"fmt"
|
|
|
|
|
2023-03-17 14:48:06 +00:00
|
|
|
"github.com/hashicorp/consul/agent/configentry"
|
2023-03-13 21:19:11 +00:00
|
|
|
"github.com/hashicorp/consul/agent/structs"
|
|
|
|
"github.com/hashicorp/go-memdb"
|
|
|
|
)
|
|
|
|
|
2023-08-23 16:53:44 +00:00
|
|
|
// SamenessGroupDefaultIndex is a placeholder for CE. Sameness-groups are enterprise only.
|
2023-03-13 21:19:11 +00:00
|
|
|
type SamenessGroupDefaultIndex struct{}
|
|
|
|
|
|
|
|
var _ memdb.Indexer = (*SamenessGroupDefaultIndex)(nil)
|
|
|
|
var _ memdb.MultiIndexer = (*SamenessGroupDefaultIndex)(nil)
|
|
|
|
|
|
|
|
func (*SamenessGroupDefaultIndex) FromObject(obj interface{}) (bool, [][]byte, error) {
|
|
|
|
return false, nil, nil
|
|
|
|
}
|
|
|
|
|
|
|
|
func (*SamenessGroupDefaultIndex) FromArgs(args ...interface{}) ([]byte, error) {
|
|
|
|
return nil, nil
|
|
|
|
}
|
|
|
|
|
|
|
|
func checkSamenessGroup(tx ReadTxn, newConfig structs.ConfigEntry) error {
|
|
|
|
return fmt.Errorf("sameness-groups are an enterprise-only feature")
|
|
|
|
}
|
2023-03-17 14:48:06 +00:00
|
|
|
|
|
|
|
// getExportedServicesConfigEntryTxn is a convenience method for fetching a
|
|
|
|
// sameness-group config entries.
|
|
|
|
//
|
|
|
|
// If an override KEY is present for the requested config entry, the index
|
|
|
|
// returned will be 0. Any override VALUE (nil or otherwise) will be returned
|
|
|
|
// if there is a KEY match.
|
|
|
|
func getSamenessGroupConfigEntryTxn(
|
|
|
|
tx ReadTxn,
|
|
|
|
ws memdb.WatchSet,
|
|
|
|
name string,
|
|
|
|
overrides map[configentry.KindName]structs.ConfigEntry,
|
2023-03-31 17:36:44 +00:00
|
|
|
partition string,
|
2023-03-17 14:48:06 +00:00
|
|
|
) (uint64, *structs.SamenessGroupConfigEntry, error) {
|
|
|
|
return 0, nil, nil
|
|
|
|
}
|
2023-03-31 18:35:56 +00:00
|
|
|
|
|
|
|
func getDefaultSamenessGroup(tx ReadTxn, ws memdb.WatchSet, partition string) (uint64, *structs.SamenessGroupConfigEntry, error) {
|
|
|
|
return 0, nil, nil
|
|
|
|
}
|