diff --git a/api/v1alpha1/technitiumauthority_types.go b/api/v1alpha1/technitiumauthority_types.go index 7ce23de..2492991 100644 --- a/api/v1alpha1/technitiumauthority_types.go +++ b/api/v1alpha1/technitiumauthority_types.go @@ -1,41 +1,32 @@ -/* -Copyright 2025. - -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 v1alpha1 import ( 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. - // TechnitiumAuthoritySpec defines the desired state of TechnitiumAuthority type TechnitiumAuthoritySpec struct { - // INSERT ADDITIONAL SPEC FIELDS - desired state of cluster - // Important: Run "make" to regenerate code after modifying this file + Zone string `json:"zone"` + Primary AuthorityEndpoint `json:"primary"` + Secondaries []AuthorityEndpoint `json:"secondaries,omitempty"` + DNSAppConfig string `json:"dnsApp.config"` +} - // Foo is an example field of TechnitiumAuthority. Edit technitiumauthority_types.go to remove/update - Foo string `json:"foo,omitempty"` +// AuthorityEndpoint defines the API endpoint and credentials +type AuthorityEndpoint struct { + Endpoint string `json:"endpoint"` + APIKeySecretRef SecretKeySelector `json:"apiKeySecretRef"` +} + +// SecretKeySelector defines the reference to a key inside a Kubernetes Secret +type SecretKeySelector struct { + Name string `json:"name"` + Key string `json:"key"` } // TechnitiumAuthorityStatus defines the observed state of TechnitiumAuthority type TechnitiumAuthorityStatus struct { - // INSERT ADDITIONAL STATUS FIELD - define observed state of cluster - // Important: Run "make" to regenerate code after modifying this file + // Add any observed status fields here } // +kubebuilder:object:root=true diff --git a/api/v1alpha1/technitiumrecord_types.go b/api/v1alpha1/technitiumrecord_types.go index a903ca0..ebc44ed 100644 --- a/api/v1alpha1/technitiumrecord_types.go +++ b/api/v1alpha1/technitiumrecord_types.go @@ -1,41 +1,26 @@ -/* -Copyright 2025. - -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 v1alpha1 import ( 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. - // TechnitiumRecordSpec defines the desired state of TechnitiumRecord type TechnitiumRecordSpec struct { - // INSERT ADDITIONAL SPEC FIELDS - desired state of cluster - // Important: Run "make" to regenerate code after modifying this file + AuthorityRef AuthorityReference `json:"authorityRef"` + Name string `json:"name"` + TTL int `json:"ttl"` + ClassPath string `json:"classPath"` + RecordData map[string][]string `json:"recordData,omitempty"` +} - // Foo is an example field of TechnitiumRecord. Edit technitiumrecord_types.go to remove/update - Foo string `json:"foo,omitempty"` +// AuthorityReference references a TechnitiumAuthority +type AuthorityReference struct { + Name string `json:"name"` } // TechnitiumRecordStatus defines the observed state of TechnitiumRecord type TechnitiumRecordStatus struct { - // INSERT ADDITIONAL STATUS FIELD - define observed state of cluster - // Important: Run "make" to regenerate code after modifying this file + // Define observed status fields here } // +kubebuilder:object:root=true diff --git a/config/samples/dns_v1alpha1_technitiumrecord.yaml b/config/samples/dns_v1alpha1_technitiumrecord.yaml index 1b8958e..03d1d51 100644 --- a/config/samples/dns_v1alpha1_technitiumrecord.yaml +++ b/config/samples/dns_v1alpha1_technitiumrecord.yaml @@ -14,7 +14,8 @@ spec: classPath: SimpleAddress recordData: - public: - - 93.184.216.34 - vpn: - - 10.0.0.99 \ No newline at end of file + # These are examples and might be renamed by the user + # public: + # - 93.184.216.34 + # vpn: + # - 10.0.0.99 \ No newline at end of file