initial commit
This commit is contained in:
40
api/v1/groupversion_info.go
Normal file
40
api/v1/groupversion_info.go
Normal file
@@ -0,0 +1,40 @@
|
||||
/*
|
||||
Copyright 2026.
|
||||
|
||||
Licensed under the Apache License, Version 2.0 (the "License");
|
||||
you may not use this file except in compliance with the License.
|
||||
You may obtain a copy of the License at
|
||||
|
||||
http://www.apache.org/licenses/LICENSE-2.0
|
||||
|
||||
Unless required by applicable law or agreed to in writing, software
|
||||
distributed under the License is distributed on an "AS IS" BASIS,
|
||||
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
See the License for the specific language governing permissions and
|
||||
limitations under the License.
|
||||
*/
|
||||
|
||||
// Package v1 contains API Schema definitions for the dns v1 API group.
|
||||
// +kubebuilder:object:generate=true
|
||||
// +groupName=dns.stinnesbeck.com
|
||||
package v1
|
||||
|
||||
import (
|
||||
"k8s.io/apimachinery/pkg/runtime/schema"
|
||||
"sigs.k8s.io/controller-runtime/pkg/scheme"
|
||||
)
|
||||
|
||||
var (
|
||||
// SchemeGroupVersion is group version used to register these objects.
|
||||
// This name is used by applyconfiguration generators (e.g. controller-gen).
|
||||
SchemeGroupVersion = schema.GroupVersion{Group: "dns.stinnesbeck.com", Version: "v1"}
|
||||
|
||||
// GroupVersion is an alias for SchemeGroupVersion, for backward compatibility.
|
||||
GroupVersion = SchemeGroupVersion
|
||||
|
||||
// SchemeBuilder is used to add go types to the GroupVersionKind scheme.
|
||||
SchemeBuilder = &scheme.Builder{GroupVersion: SchemeGroupVersion}
|
||||
|
||||
// AddToScheme adds the types in this group-version to the given scheme.
|
||||
AddToScheme = SchemeBuilder.AddToScheme
|
||||
)
|
||||
101
api/v1/resolution_types.go
Normal file
101
api/v1/resolution_types.go
Normal file
@@ -0,0 +1,101 @@
|
||||
/*
|
||||
Copyright 2026.
|
||||
|
||||
Licensed under the Apache License, Version 2.0 (the "License");
|
||||
you may not use this file except in compliance with the License.
|
||||
You may obtain a copy of the License at
|
||||
|
||||
http://www.apache.org/licenses/LICENSE-2.0
|
||||
|
||||
Unless required by applicable law or agreed to in writing, software
|
||||
distributed under the License is distributed on an "AS IS" BASIS,
|
||||
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
See the License for the specific language governing permissions and
|
||||
limitations under the License.
|
||||
*/
|
||||
|
||||
package v1
|
||||
|
||||
import (
|
||||
"net"
|
||||
|
||||
metav1 "k8s.io/apimachinery/pkg/apis/meta/v1"
|
||||
)
|
||||
|
||||
// EDIT THIS FILE! THIS IS SCAFFOLDING FOR YOU TO OWN!
|
||||
// NOTE: json tags are required. Any new fields you add must have json tags for the fields to be serialized.
|
||||
|
||||
// ResolutionSpec defines the desired state of Resolution
|
||||
type ResolutionSpec struct {
|
||||
// INSERT ADDITIONAL SPEC FIELDS - desired state of cluster
|
||||
// Important: Run "make" to regenerate code after modifying this file
|
||||
// The following markers will use OpenAPI v3 schema to validate the value
|
||||
// More info: https://book.kubebuilder.io/reference/markers/crd-validation.html
|
||||
|
||||
// Address to be queried for IP
|
||||
// +required
|
||||
Address string `json:"address"`
|
||||
}
|
||||
|
||||
// ResolutionStatus defines the observed state of Resolution.
|
||||
type ResolutionStatus struct {
|
||||
// INSERT ADDITIONAL STATUS FIELD - define observed state of cluster
|
||||
// Important: Run "make" to regenerate code after modifying this file
|
||||
|
||||
// For Kubernetes API conventions, see:
|
||||
// https://github.com/kubernetes/community/blob/master/contributors/devel/sig-architecture/api-conventions.md#typical-status-properties
|
||||
|
||||
// conditions represent the current state of the Resolution resource.
|
||||
// Each condition has a unique type and reflects the status of a specific aspect of the resource.
|
||||
//
|
||||
// Standard condition types include:
|
||||
// - "Available": the resource is fully functional
|
||||
// - "Progressing": the resource is being created or updated
|
||||
// - "Degraded": the resource failed to reach or maintain its desired state
|
||||
//
|
||||
// The status of each condition is one of True, False, or Unknown.
|
||||
// +listType=map
|
||||
// +listMapKey=type
|
||||
// +optional
|
||||
Conditions []metav1.Condition `json:"conditions,omitempty"`
|
||||
|
||||
// IPAddresses contains all IP addresses that were looked up
|
||||
// +kubebuilder:title=`IP Addresses`
|
||||
// +optional
|
||||
IPAddresses []net.IP `json:"ipAddresses,omitempty"`
|
||||
}
|
||||
|
||||
// +kubebuilder:object:root=true
|
||||
// +kubebuilder:subresource:status
|
||||
// +kubebuilder:printcolumn:name="Address",type=string,JSONPath=`.spec.address`
|
||||
// +kubebuilder:printcolumn:name="IPs",type=string,JSONPath=`.status.ipAddresses`
|
||||
|
||||
// Resolution is the Schema for the resolutions API
|
||||
type Resolution struct {
|
||||
metav1.TypeMeta `json:",inline"`
|
||||
|
||||
// metadata is a standard object metadata
|
||||
// +optional
|
||||
metav1.ObjectMeta `json:"metadata,omitzero"`
|
||||
|
||||
// spec defines the desired state of Resolution
|
||||
// +required
|
||||
Spec ResolutionSpec `json:"spec"`
|
||||
|
||||
// status defines the observed state of Resolution
|
||||
// +optional
|
||||
Status ResolutionStatus `json:"status,omitzero"`
|
||||
}
|
||||
|
||||
// +kubebuilder:object:root=true
|
||||
|
||||
// ResolutionList contains a list of Resolution
|
||||
type ResolutionList struct {
|
||||
metav1.TypeMeta `json:",inline"`
|
||||
metav1.ListMeta `json:"metadata,omitzero"`
|
||||
Items []Resolution `json:"items"`
|
||||
}
|
||||
|
||||
func init() {
|
||||
SchemeBuilder.Register(&Resolution{}, &ResolutionList{})
|
||||
}
|
||||
94
api/v1/resolver_types.go
Normal file
94
api/v1/resolver_types.go
Normal file
@@ -0,0 +1,94 @@
|
||||
/*
|
||||
Copyright 2026.
|
||||
|
||||
Licensed under the Apache License, Version 2.0 (the "License");
|
||||
you may not use this file except in compliance with the License.
|
||||
You may obtain a copy of the License at
|
||||
|
||||
http://www.apache.org/licenses/LICENSE-2.0
|
||||
|
||||
Unless required by applicable law or agreed to in writing, software
|
||||
distributed under the License is distributed on an "AS IS" BASIS,
|
||||
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
See the License for the specific language governing permissions and
|
||||
limitations under the License.
|
||||
*/
|
||||
|
||||
package v1
|
||||
|
||||
import (
|
||||
"net"
|
||||
|
||||
metav1 "k8s.io/apimachinery/pkg/apis/meta/v1"
|
||||
)
|
||||
|
||||
// EDIT THIS FILE! THIS IS SCAFFOLDING FOR YOU TO OWN!
|
||||
// NOTE: json tags are required. Any new fields you add must have json tags for the fields to be serialized.
|
||||
|
||||
// ResolverSpec defines the desired state of Resolver
|
||||
type ResolverSpec struct {
|
||||
// INSERT ADDITIONAL SPEC FIELDS - desired state of cluster
|
||||
// Important: Run "make" to regenerate code after modifying this file
|
||||
// The following markers will use OpenAPI v3 schema to validate the value
|
||||
// More info: https://book.kubebuilder.io/reference/markers/crd-validation.html
|
||||
|
||||
// IPAddress is the main field for a resolver. This will be used to run queries against.
|
||||
// +required
|
||||
IPAddress net.IP `json:"ipAddress"`
|
||||
}
|
||||
|
||||
// ResolverStatus defines the observed state of Resolver.
|
||||
type ResolverStatus struct {
|
||||
// INSERT ADDITIONAL STATUS FIELD - define observed state of cluster
|
||||
// Important: Run "make" to regenerate code after modifying this file
|
||||
|
||||
// For Kubernetes API conventions, see:
|
||||
// https://github.com/kubernetes/community/blob/master/contributors/devel/sig-architecture/api-conventions.md#typical-status-properties
|
||||
|
||||
// conditions represent the current state of the Resolver resource.
|
||||
// Each condition has a unique type and reflects the status of a specific aspect of the resource.
|
||||
//
|
||||
// Standard condition types include:
|
||||
// - "Available": the resource is fully functional
|
||||
// - "Progressing": the resource is being created or updated
|
||||
// - "Degraded": the resource failed to reach or maintain its desired state
|
||||
//
|
||||
// The status of each condition is one of True, False, or Unknown.
|
||||
// +listType=map
|
||||
// +listMapKey=type
|
||||
// +optional
|
||||
Conditions []metav1.Condition `json:"conditions,omitempty"`
|
||||
}
|
||||
|
||||
// +kubebuilder:object:root=true
|
||||
// +kubebuilder:subresource:status
|
||||
|
||||
// Resolver is the Schema for the resolvers API
|
||||
type Resolver struct {
|
||||
metav1.TypeMeta `json:",inline"`
|
||||
|
||||
// metadata is a standard object metadata
|
||||
// +optional
|
||||
metav1.ObjectMeta `json:"metadata,omitzero"`
|
||||
|
||||
// spec defines the desired state of Resolver
|
||||
// +required
|
||||
Spec ResolverSpec `json:"spec"`
|
||||
|
||||
// status defines the observed state of Resolver
|
||||
// +optional
|
||||
Status ResolverStatus `json:"status,omitzero"`
|
||||
}
|
||||
|
||||
// +kubebuilder:object:root=true
|
||||
|
||||
// ResolverList contains a list of Resolver
|
||||
type ResolverList struct {
|
||||
metav1.TypeMeta `json:",inline"`
|
||||
metav1.ListMeta `json:"metadata,omitzero"`
|
||||
Items []Resolver `json:"items"`
|
||||
}
|
||||
|
||||
func init() {
|
||||
SchemeBuilder.Register(&Resolver{}, &ResolverList{})
|
||||
}
|
||||
235
api/v1/zz_generated.deepcopy.go
Normal file
235
api/v1/zz_generated.deepcopy.go
Normal file
@@ -0,0 +1,235 @@
|
||||
//go:build !ignore_autogenerated
|
||||
|
||||
/*
|
||||
Copyright 2026.
|
||||
|
||||
Licensed under the Apache License, Version 2.0 (the "License");
|
||||
you may not use this file except in compliance with the License.
|
||||
You may obtain a copy of the License at
|
||||
|
||||
http://www.apache.org/licenses/LICENSE-2.0
|
||||
|
||||
Unless required by applicable law or agreed to in writing, software
|
||||
distributed under the License is distributed on an "AS IS" BASIS,
|
||||
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
See the License for the specific language governing permissions and
|
||||
limitations under the License.
|
||||
*/
|
||||
|
||||
// Code generated by controller-gen. DO NOT EDIT.
|
||||
|
||||
package v1
|
||||
|
||||
import (
|
||||
metav1 "k8s.io/apimachinery/pkg/apis/meta/v1"
|
||||
runtime "k8s.io/apimachinery/pkg/runtime"
|
||||
netx "net"
|
||||
)
|
||||
|
||||
// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.
|
||||
func (in *Resolution) DeepCopyInto(out *Resolution) {
|
||||
*out = *in
|
||||
out.TypeMeta = in.TypeMeta
|
||||
in.ObjectMeta.DeepCopyInto(&out.ObjectMeta)
|
||||
out.Spec = in.Spec
|
||||
in.Status.DeepCopyInto(&out.Status)
|
||||
}
|
||||
|
||||
// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new Resolution.
|
||||
func (in *Resolution) DeepCopy() *Resolution {
|
||||
if in == nil {
|
||||
return nil
|
||||
}
|
||||
out := new(Resolution)
|
||||
in.DeepCopyInto(out)
|
||||
return out
|
||||
}
|
||||
|
||||
// DeepCopyObject is an autogenerated deepcopy function, copying the receiver, creating a new runtime.Object.
|
||||
func (in *Resolution) DeepCopyObject() runtime.Object {
|
||||
if c := in.DeepCopy(); c != nil {
|
||||
return c
|
||||
}
|
||||
return nil
|
||||
}
|
||||
|
||||
// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.
|
||||
func (in *ResolutionList) DeepCopyInto(out *ResolutionList) {
|
||||
*out = *in
|
||||
out.TypeMeta = in.TypeMeta
|
||||
in.ListMeta.DeepCopyInto(&out.ListMeta)
|
||||
if in.Items != nil {
|
||||
in, out := &in.Items, &out.Items
|
||||
*out = make([]Resolution, len(*in))
|
||||
for i := range *in {
|
||||
(*in)[i].DeepCopyInto(&(*out)[i])
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new ResolutionList.
|
||||
func (in *ResolutionList) DeepCopy() *ResolutionList {
|
||||
if in == nil {
|
||||
return nil
|
||||
}
|
||||
out := new(ResolutionList)
|
||||
in.DeepCopyInto(out)
|
||||
return out
|
||||
}
|
||||
|
||||
// DeepCopyObject is an autogenerated deepcopy function, copying the receiver, creating a new runtime.Object.
|
||||
func (in *ResolutionList) DeepCopyObject() runtime.Object {
|
||||
if c := in.DeepCopy(); c != nil {
|
||||
return c
|
||||
}
|
||||
return nil
|
||||
}
|
||||
|
||||
// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.
|
||||
func (in *ResolutionSpec) DeepCopyInto(out *ResolutionSpec) {
|
||||
*out = *in
|
||||
}
|
||||
|
||||
// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new ResolutionSpec.
|
||||
func (in *ResolutionSpec) DeepCopy() *ResolutionSpec {
|
||||
if in == nil {
|
||||
return nil
|
||||
}
|
||||
out := new(ResolutionSpec)
|
||||
in.DeepCopyInto(out)
|
||||
return out
|
||||
}
|
||||
|
||||
// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.
|
||||
func (in *ResolutionStatus) DeepCopyInto(out *ResolutionStatus) {
|
||||
*out = *in
|
||||
if in.Conditions != nil {
|
||||
in, out := &in.Conditions, &out.Conditions
|
||||
*out = make([]metav1.Condition, len(*in))
|
||||
for i := range *in {
|
||||
(*in)[i].DeepCopyInto(&(*out)[i])
|
||||
}
|
||||
}
|
||||
if in.IPAddresses != nil {
|
||||
in, out := &in.IPAddresses, &out.IPAddresses
|
||||
*out = make([]netx.IP, len(*in))
|
||||
for i := range *in {
|
||||
if (*in)[i] != nil {
|
||||
in, out := &(*in)[i], &(*out)[i]
|
||||
*out = make(netx.IP, len(*in))
|
||||
copy(*out, *in)
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new ResolutionStatus.
|
||||
func (in *ResolutionStatus) DeepCopy() *ResolutionStatus {
|
||||
if in == nil {
|
||||
return nil
|
||||
}
|
||||
out := new(ResolutionStatus)
|
||||
in.DeepCopyInto(out)
|
||||
return out
|
||||
}
|
||||
|
||||
// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.
|
||||
func (in *Resolver) DeepCopyInto(out *Resolver) {
|
||||
*out = *in
|
||||
out.TypeMeta = in.TypeMeta
|
||||
in.ObjectMeta.DeepCopyInto(&out.ObjectMeta)
|
||||
in.Spec.DeepCopyInto(&out.Spec)
|
||||
in.Status.DeepCopyInto(&out.Status)
|
||||
}
|
||||
|
||||
// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new Resolver.
|
||||
func (in *Resolver) DeepCopy() *Resolver {
|
||||
if in == nil {
|
||||
return nil
|
||||
}
|
||||
out := new(Resolver)
|
||||
in.DeepCopyInto(out)
|
||||
return out
|
||||
}
|
||||
|
||||
// DeepCopyObject is an autogenerated deepcopy function, copying the receiver, creating a new runtime.Object.
|
||||
func (in *Resolver) DeepCopyObject() runtime.Object {
|
||||
if c := in.DeepCopy(); c != nil {
|
||||
return c
|
||||
}
|
||||
return nil
|
||||
}
|
||||
|
||||
// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.
|
||||
func (in *ResolverList) DeepCopyInto(out *ResolverList) {
|
||||
*out = *in
|
||||
out.TypeMeta = in.TypeMeta
|
||||
in.ListMeta.DeepCopyInto(&out.ListMeta)
|
||||
if in.Items != nil {
|
||||
in, out := &in.Items, &out.Items
|
||||
*out = make([]Resolver, len(*in))
|
||||
for i := range *in {
|
||||
(*in)[i].DeepCopyInto(&(*out)[i])
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new ResolverList.
|
||||
func (in *ResolverList) DeepCopy() *ResolverList {
|
||||
if in == nil {
|
||||
return nil
|
||||
}
|
||||
out := new(ResolverList)
|
||||
in.DeepCopyInto(out)
|
||||
return out
|
||||
}
|
||||
|
||||
// DeepCopyObject is an autogenerated deepcopy function, copying the receiver, creating a new runtime.Object.
|
||||
func (in *ResolverList) DeepCopyObject() runtime.Object {
|
||||
if c := in.DeepCopy(); c != nil {
|
||||
return c
|
||||
}
|
||||
return nil
|
||||
}
|
||||
|
||||
// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.
|
||||
func (in *ResolverSpec) DeepCopyInto(out *ResolverSpec) {
|
||||
*out = *in
|
||||
if in.IPAddress != nil {
|
||||
in, out := &in.IPAddress, &out.IPAddress
|
||||
*out = make(netx.IP, len(*in))
|
||||
copy(*out, *in)
|
||||
}
|
||||
}
|
||||
|
||||
// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new ResolverSpec.
|
||||
func (in *ResolverSpec) DeepCopy() *ResolverSpec {
|
||||
if in == nil {
|
||||
return nil
|
||||
}
|
||||
out := new(ResolverSpec)
|
||||
in.DeepCopyInto(out)
|
||||
return out
|
||||
}
|
||||
|
||||
// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.
|
||||
func (in *ResolverStatus) DeepCopyInto(out *ResolverStatus) {
|
||||
*out = *in
|
||||
if in.Conditions != nil {
|
||||
in, out := &in.Conditions, &out.Conditions
|
||||
*out = make([]metav1.Condition, len(*in))
|
||||
for i := range *in {
|
||||
(*in)[i].DeepCopyInto(&(*out)[i])
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new ResolverStatus.
|
||||
func (in *ResolverStatus) DeepCopy() *ResolverStatus {
|
||||
if in == nil {
|
||||
return nil
|
||||
}
|
||||
out := new(ResolverStatus)
|
||||
in.DeepCopyInto(out)
|
||||
return out
|
||||
}
|
||||
Reference in New Issue
Block a user