Documentation
¶
Overview ¶
Package types contains some types or constants that are used throughout the whole program.
Index ¶
Constants ¶
const ( // SDDefaultRegion is the key for service directory region setting SDDefaultRegion = "gcloud.servicedirectory.region" // SDProject is the key for service directory project setting SDProject = "gcloud.servicedirectory.project" // NamespaceListPolicy is the key for the namespace list policy setting NamespaceListPolicy = "namespace.listpolicy" // AllowedAnnotations is the key for the allowed annotations setting AllowedAnnotations = "service.annotations" // AllowedAnnotationsMap is the key for the allowed annotations map setting AllowedAnnotationsMap = "service.annotationsmap" // ServiceRegistrySettingsKey is the key for the service registry settings ServiceRegistrySettingsKey = "serviceregistry" // DeprecatedGcloudServiceDirectoryKey is the key for the old service // directory. It is currently only used to check if it is there and warn // the user that it is deprecated. DeprecatedGcloudServiceDirectoryKey = "gcloud.servicedirectory" // CurrentNamespace identifies the namespace name in which we are running // in, in case we are running inside the cluster. CurrentNamespace = "currentnamespace" // EtcdCredentialsSecretName is the name of the secret holding username // and password to connect to the etcd cluster. If it exists, the cnwan // operator expects this name. EtcdCredentialsSecretName = "cnwan-operator-etcd-credentials" )
const ( // AllowList will make the operator only consider resources that have // are in the allowlist AllowList ListPolicy = "allowlist" // AllowedKey is the label key that states that a specific resource is // in the allowlist, if allowlist is the current policy type. // If the policy type is blocklist, this key is ignored. AllowedKey string = "operator.cnwan.io/allowed" // BlockList will make the operator consider all resources and ignore // those that are in the blocklist BlockList ListPolicy = "blocklist" // BlockedKey is the label key that states that a specific resource is // in the blocklist, if blocklist is the current policy type. // If the policy type is allowlist, this key is ignored. BlockedKey string = "operator.cnwan.io/blocked" )
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type CloudMetadata ¶ added in v0.4.0
type CloudMetadata struct { // Network name Network *string `yaml:"network"` // SubNetwork name SubNetwork *string `yaml:"subNetwork"` }
CloudMetadata contains data and configuration about the cloud provider that is hosting the cluster, if any.
type DeprecatedServiceDirectorySettings ¶ added in v0.3.0
type DeprecatedServiceDirectorySettings struct { DefaultRegion string `yaml:"region"` ProjectName string `yaml:"project"` }
DeprecatedServiceDirectorySettings holds settings about gcloud service directory TODO: remove this on v0.6.0
type EtcdAuthenticationType ¶ added in v0.3.0
type EtcdAuthenticationType string
EtcdAuthenticationType specifies how the cnwan operator must authenticate to the etcd cluster
const ( // EtcdAuthWithNothing specifies that no authentication must be // performed. EtcdAuthWithNothing EtcdAuthenticationType = "" // EtcdAuthWithUsernamePassw specifies that authentication needs to be done // with username and password. EtcdAuthWithUsernamePassw EtcdAuthenticationType = "WithUsernameAndPassword" // EtcdAuthWithTLS specifies that authentication must be done with TLS. EtcdAuthWithTLS EtcdAuthenticationType = "WithTLS" )
type EtcdEndpoint ¶ added in v0.3.0
EtcdEndpoint specifies an endpoint where to connect to. The port is a pointer, because if it is not specifies the well-known etcd port assigned from IANA will be used instead.
type EtcdSettings ¶ added in v0.3.0
type EtcdSettings struct { Authentication EtcdAuthenticationType `yaml:"authentication,omitempty"` Prefix *string `yaml:"prefix,omitempty"` Endpoints []*EtcdEndpoint `yaml:"endpoints"` }
EtcdSettings holds settings about etcd
type GcloudSettings ¶
type GcloudSettings struct {
ServiceDirectory *DeprecatedServiceDirectorySettings `yaml:"serviceDirectory"`
}
GcloudSettings holds gcloud settings TODO: remove this on v0.6.0
type ListPolicy ¶
type ListPolicy string
ListPolicy is the list type that must be adopted by the operator
type NamespaceSettings ¶
type NamespaceSettings struct {
ListPolicy ListPolicy `yaml:"listPolicy"`
}
NamespaceSettings includes settings about namespaces
type ServiceDirectorySettings ¶
type ServiceDirectorySettings struct { // DefaultRegion is the default region where objects will be registered to // in case the region is not mentioned explicitly. DefaultRegion string `yaml:"defaultRegion"` // ProjectID is the ID of the gcp project as it appears on google cloud // console. ProjectID string `yaml:"projectID"` }
ServiceDirectorySettings holds settings about gcloud service directory
type ServiceRegistrySettings ¶ added in v0.3.0
type ServiceRegistrySettings struct { *ServiceDirectorySettings `yaml:"gcpServiceDirectory"` *EtcdSettings `yaml:"etcd"` }
ServiceRegistrySettings contains information about the service registry that must be used, i.e. etcd or service directory.
type ServiceSettings ¶ added in v0.3.0
type ServiceSettings struct {
Annotations []string `yaml:"annotations"`
}
ServiceSettings includes settings about services
type Settings ¶
type Settings struct { Namespace NamespaceSettings `yaml:"namespace"` Service ServiceSettings `yaml:"service"` *ServiceRegistrySettings `yaml:"serviceRegistry"` // DEPRECATED: include this under serviceRegistry instead of here. // TODO: remove this on v0.6.0 Gcloud *GcloudSettings `yaml:"gcloud"` CloudMetadata *CloudMetadata `yaml:"cloudMetadata"` }
Settings of the application