Documentation ¶
Overview ¶
Package crd contains objects used to represent Kubernetes Custom Resource Definitions (CRDs) defined by Proclaim.
Index ¶
- Constants
- func AdvertiseErrorCondition(err error) metav1.Condition
- func DNSRecordsCreated(m manager.Manager, res *DNSSDServiceInstance)
- func DNSRecordsCreatedCondition() metav1.Condition
- func DNSRecordsDeleted(m manager.Manager, res *DNSSDServiceInstance)
- func DNSRecordsDeletedCondition() metav1.Condition
- func DNSRecordsDoNotExistCondition() metav1.Condition
- func DNSRecordsObservedCondition() metav1.Condition
- func DNSRecordsUpdated(m manager.Manager, res *DNSSDServiceInstance)
- func DNSRecordsUpdatedCondition() metav1.Condition
- func DNSRecordsVerified(m manager.Manager, res *DNSSDServiceInstance)
- func Discovered(m manager.Manager, res *DNSSDServiceInstance)
- func DiscoveredCondition() metav1.Condition
- func DiscoveryError(m manager.Manager, res *DNSSDServiceInstance, err error)
- func DiscoveryErrorCondition(err error) metav1.Condition
- func InstanceAdopted(m manager.Manager, res *DNSSDServiceInstance)
- func InstanceAdoptedCondition() metav1.Condition
- func InstanceIgnored(m manager.Manager, res *DNSSDServiceInstance)
- func InstanceIgnoredCondition() metav1.Condition
- func LookupResultOutOfSync(m manager.Manager, res *DNSSDServiceInstance)
- func LookupResultOutOfSyncCondition() metav1.Condition
- func NegativeBrowseResult(m manager.Manager, res *DNSSDServiceInstance)
- func NegativeBrowseResultCondition() metav1.Condition
- func NegativeLookupResult(m manager.Manager, res *DNSSDServiceInstance)
- func NegativeLookupResultCondition() metav1.Condition
- func ProviderError(m manager.Manager, res *DNSSDServiceInstance, id, desc string, err error)
- func UnadvertiseErrorCondition(err error) metav1.Condition
- func UpdateStatus(ctx context.Context, cli client.Client, res *DNSSDServiceInstance, ...) error
- type DNSSDServiceInstance
- type DNSSDServiceInstanceList
- type DNSSDServiceInstanceSpec
- type DNSSDServiceInstanceStatus
- type Instance
- type StatusUpdate
- type Target
Constants ¶
const ( // GroupName is the API group name used by Proclaim. GroupName = "proclaim.dogmatiq.io" // FinalizerName is the name of the finalizer used by Proclaim to ensure // that DNS-SD services are unadvertised when they're underlying resource // is deleted. FinalizerName = GroupName + "/unadvertise" // Version is the version of the API/CRDs. Version = "v1" )
const ConditionTypeAdopted = "Adopted"
ConditionTypeAdopted is a condition that indicates whether or not the service instance has been adopted by a provider.
const ConditionTypeAdvertised = "Advertised"
ConditionTypeAdvertised is a condition that indicates whether or not the service instance has been advertised via a provider.
const ConditionTypeDiscoverable = "Discoverable"
ConditionTypeDiscoverable is a condition that indicates whether or not the service instance is discoverable via the DNS system.
Variables ¶
This section is empty.
Functions ¶
func AdvertiseErrorCondition ¶ added in v0.2.0
AdvertiseErrorCondition returns a condition indicating that an attempt to advertise the instance failed with the given error.
func DNSRecordsCreated ¶ added in v0.2.0
func DNSRecordsCreated(m manager.Manager, res *DNSSDServiceInstance)
DNSRecordsCreated records an event indicating that new DNS records were created.
func DNSRecordsCreatedCondition ¶ added in v0.2.0
DNSRecordsCreatedCondition returns a condition indicating that the instance's DNS records have been created.
func DNSRecordsDeleted ¶ added in v0.2.0
func DNSRecordsDeleted(m manager.Manager, res *DNSSDServiceInstance)
DNSRecordsDeleted records an event indicating that existing DNS records were deleted.
func DNSRecordsDeletedCondition ¶ added in v0.2.0
DNSRecordsDeletedCondition returns a condition indicating that the instance's DNS records have been removed.
func DNSRecordsDoNotExistCondition ¶ added in v0.4.1
DNSRecordsDoNotExistCondition returns a condition indicating that the instance's DNS records do not exist, either because they never did or they have already been removed.
func DNSRecordsObservedCondition ¶ added in v0.2.0
DNSRecordsObservedCondition returns a condition indicating that the instance's DNS records have been observed to already exist.
func DNSRecordsUpdated ¶ added in v0.2.0
func DNSRecordsUpdated(m manager.Manager, res *DNSSDServiceInstance)
DNSRecordsUpdated records an event indicating that existing DNS records were updated.
func DNSRecordsUpdatedCondition ¶ added in v0.2.0
DNSRecordsUpdatedCondition returns a condition indicating that the instance's DNS records have been updated.
func DNSRecordsVerified ¶ added in v0.2.0
func DNSRecordsVerified(m manager.Manager, res *DNSSDServiceInstance)
DNSRecordsVerified records an event indicating that existing DNS records were verified to match the service instance spec.
func Discovered ¶ added in v0.2.0
func Discovered(m manager.Manager, res *DNSSDServiceInstance)
Discovered records an event indicating that the service instance was discovered via DNS-SD.
func DiscoveredCondition ¶ added in v0.2.0
DiscoveredCondition returns a condition indicating that the DNS-SD discovery results match the advertised DNS records.
func DiscoveryError ¶ added in v0.2.0
func DiscoveryError( m manager.Manager, res *DNSSDServiceInstance, err error, )
DiscoveryError records an event indicating that an error occurred while performing DNS-SD discovery.
func DiscoveryErrorCondition ¶ added in v0.2.0
DiscoveryErrorCondition returns a condition indicating that the DNS-SD discovery failed with the given error.
func InstanceAdopted ¶ added in v0.2.0
func InstanceAdopted(m manager.Manager, res *DNSSDServiceInstance)
InstanceAdopted records an event indicating that the service instance was adopted by the controller.
func InstanceAdoptedCondition ¶ added in v0.2.0
InstanceAdoptedCondition returns a condition indicating that the instance has been adopted by a provider.
func InstanceIgnored ¶ added in v0.2.0
func InstanceIgnored(m manager.Manager, res *DNSSDServiceInstance)
InstanceIgnored records an event indicating that the service instance was ignored by the controller.
func InstanceIgnoredCondition ¶ added in v0.2.0
InstanceIgnoredCondition returns a condition indicating that the instance has been ignored by all providers.
func LookupResultOutOfSync ¶ added in v0.2.0
func LookupResultOutOfSync(m manager.Manager, res *DNSSDServiceInstance)
LookupResultOutOfSync records an event indicating that the service instance was discovered via DNS-SD, but the result did not match the advertised DNS records.
func LookupResultOutOfSyncCondition ¶ added in v0.2.0
LookupResultOutOfSyncCondition returns a condition indicating that the instance was found by a DNS-SD lookup operation, but the result did not match the advertised DNS records.
func NegativeBrowseResult ¶ added in v0.2.0
func NegativeBrowseResult(m manager.Manager, res *DNSSDServiceInstance)
NegativeBrowseResult records an event indicating that the service instance was not discoverable via DNS-SD.
func NegativeBrowseResultCondition ¶ added in v0.2.0
NegativeBrowseResultCondition returns a condition indicating that the instance was not present in the result of a DNS-SD browse operation.
func NegativeLookupResult ¶ added in v0.2.0
func NegativeLookupResult(m manager.Manager, res *DNSSDServiceInstance)
NegativeLookupResult records an event indicating that the service instance was not discoverable via DNS-SD.
func NegativeLookupResultCondition ¶ added in v0.2.0
NegativeLookupResultCondition returns a condition indicating that the instance could not be found by a DNS-SD lookup operation.
func ProviderError ¶ added in v0.2.0
func ProviderError( m manager.Manager, res *DNSSDServiceInstance, id, desc string, err error, )
ProviderError records an event indicating that an error occurred while interacting with a DNS provider.
func UnadvertiseErrorCondition ¶ added in v0.2.0
UnadvertiseErrorCondition returns a condition indicating that an attempt to unadvertise the instance failed with the given error.
func UpdateStatus ¶ added in v0.2.0
func UpdateStatus( ctx context.Context, cli client.Client, res *DNSSDServiceInstance, updates ...StatusUpdate, ) error
UpdateStatus applies the given StatusUpdates to the given resource.
Types ¶
type DNSSDServiceInstance ¶
type DNSSDServiceInstance struct { metav1.TypeMeta `json:",inline"` metav1.ObjectMeta `json:"metadata,omitempty"` Spec DNSSDServiceInstanceSpec `json:"spec,omitempty"` Status DNSSDServiceInstanceStatus `json:"status,omitempty"` }
DNSSDServiceInstance is a resource that represents a DNS-SD service instance.
func (*DNSSDServiceInstance) Condition ¶ added in v0.2.0
func (res *DNSSDServiceInstance) Condition(t string) metav1.Condition
Condition returns the condition with the given type.
func (*DNSSDServiceInstance) DeepCopyObject ¶
func (i *DNSSDServiceInstance) DeepCopyObject() runtime.Object
DeepCopyObject returns a deep clone of i.
type DNSSDServiceInstanceList ¶
type DNSSDServiceInstanceList struct { metav1.TypeMeta `json:",inline"` metav1.ListMeta `json:"metadata,omitempty"` Items []DNSSDServiceInstance `json:"items"` }
DNSSDServiceInstanceList is a list of DNS-SD service instances.
func (*DNSSDServiceInstanceList) DeepCopyObject ¶
func (l *DNSSDServiceInstanceList) DeepCopyObject() runtime.Object
DeepCopyObject returns a deep clone of l.
type DNSSDServiceInstanceSpec ¶
type DNSSDServiceInstanceSpec struct {
Instance Instance `json:"instance"`
}
DNSSDServiceInstanceSpec is the specification for a service instance.
func (DNSSDServiceInstanceSpec) ToDissolve ¶ added in v0.3.0
func (s DNSSDServiceInstanceSpec) ToDissolve() dnssd.ServiceInstance
ToDissolve returns a Dissolve dnssd.Instance from a CRD service instance specification.
type DNSSDServiceInstanceStatus ¶
type DNSSDServiceInstanceStatus struct { Conditions []metav1.Condition `json:"conditions,omitempty"` ProviderDescription string `json:"providerDescription,omitempty"` Provider string `json:"provider,omitempty"` Advertiser map[string]any `json:"advertiser,omitempty"` }
DNSSDServiceInstanceStatus contains the status of a service instance.
type Instance ¶ added in v0.2.0
type Instance struct { Name string `json:"name"` ServiceType string `json:"serviceType"` Domain string `json:"domain"` TTL metav1.Duration `json:"ttl,omitempty"` Targets [1]Target `json:"targets"` Attributes []map[string]any `json:"attributes,omitempty"` }
Instance is a DNS-SD service instance.
type StatusUpdate ¶ added in v0.2.0
type StatusUpdate func(*DNSSDServiceInstance)
StatusUpdate is a function that updates a resource's status in some way.
func AssociateProvider ¶ added in v0.2.0
func AssociateProvider(provider string, advertiser map[string]any) StatusUpdate
AssociateProvider is an StatusUpdate that sets the Provider and Advertiser fields of the resource's status.
func If ¶ added in v0.2.0
func If(test bool, updates ...StatusUpdate) StatusUpdate
If is an StatusUpdate that conditionally applies other StatusUpdates.
func MergeCondition ¶ added in v0.2.0
func MergeCondition(c metav1.Condition) StatusUpdate
MergeCondition is an StatusUpdate that merges a new Condition into the resource's status.
If a Condition with the same type already exists, it is replaced with the new Condition, otherwise the new Condition is appended.
func UpdateProviderDescription ¶ added in v0.2.0
func UpdateProviderDescription(desc string) StatusUpdate
UpdateProviderDescription is an StatusUpdate that sets the ProviderDescription field of the resource's status.