Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Uses packages from declarative pattern repo #71

Merged
merged 1 commit into from
Jul 9, 2020
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 4 additions & 4 deletions nodelocaldns/api/v1alpha1/nodelocaldns_types.go
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ import (
// 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.

// nodelocaldnsSpec defines the desired state of nodelocaldns
// NodeLocalDNSSpec defines the desired state of NodeLocalDNS
type NodeLocalDNSSpec struct {
addonv1alpha1.CommonSpec `json:",inline"`
addonv1alpha1.PatchSpec `json:",inline"`
Expand All @@ -20,7 +20,7 @@ type NodeLocalDNSSpec struct {
ClusterIP string `json:"clusterIP,omitempty"`
}

// nodelocaldnsStatus defines the observed state of nodelocaldns
// NodeLocalDNSStatus defines the observed state of NodeLocalDNS
type NodeLocalDNSStatus struct {
addonv1alpha1.CommonStatus `json:",inline"`

Expand All @@ -30,7 +30,7 @@ type NodeLocalDNSStatus struct {

// +kubebuilder:object:root=true

// nodelocaldns is the Schema for the nodelocaldns API
// NodeLocalDNS is the Schema for the nodelocaldns API
type NodeLocalDNS struct {
metav1.TypeMeta `json:",inline"`
metav1.ObjectMeta `json:"metadata,omitempty"`
Expand Down Expand Up @@ -63,7 +63,7 @@ func (o *NodeLocalDNS) SetCommonStatus(s addonv1alpha1.CommonStatus) {

// +kubebuilder:object:root=true

// NodelocaldnsList contains a list of nodelocaldns
// NodeLocalDNSList contains a list of nodelocaldns
type NodeLocalDNSList struct {
metav1.TypeMeta `json:",inline"`
metav1.ListMeta `json:"metadata,omitempty"`
Expand Down
8 changes: 6 additions & 2 deletions nodelocaldns/controllers/nodelocaldns_controller.go
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@ import (
"sigs.k8s.io/kubebuilder-declarative-pattern/pkg/patterns/addon"
"sigs.k8s.io/kubebuilder-declarative-pattern/pkg/patterns/addon/pkg/status"
"sigs.k8s.io/kubebuilder-declarative-pattern/pkg/patterns/declarative"
"sigs.k8s.io/kubebuilder-declarative-pattern/utils"

"github.com/go-logr/logr"
"k8s.io/apimachinery/pkg/runtime"
Expand Down Expand Up @@ -94,11 +95,14 @@ func replaceVariables(mgr ctrl.Manager) declarative.ManifestOperation {
// TODO: port findClusterIP and getDNSDomain from coredns/controllers/utils in the kubebuilder-declarative
// -pattern repo and use it here
if o.Spec.DNSDomain == "" {
o.Spec.DNSDomain = "cluster.local"
o.Spec.DNSDomain = utils.GetDNSDomain()
}

if o.Spec.DNSIP == "" {
o.Spec.DNSIP = "169.254.20.10"
o.Spec.DNSIP, err = utils.FindDNSClusterIP(ctx, mgr.GetClient())
if err != nil {
return "", err
}
}

if o.Spec.ClusterIP == "" {
Expand Down
8 changes: 4 additions & 4 deletions nodelocaldns/go.mod
Original file line number Diff line number Diff line change
Expand Up @@ -7,12 +7,12 @@ require (
github.com/go-logr/logr v0.1.0
golang.org/x/tools v0.0.0-20191010075000-0337d82405ff
gonum.org/v1/netlib v0.0.0-20190331212654-76723241ea4e // indirect
k8s.io/api v0.18.2
k8s.io/apimachinery v0.18.2
k8s.io/client-go v0.18.2
k8s.io/api v0.18.4
k8s.io/apimachinery v0.18.4
k8s.io/client-go v0.18.4
k8s.io/klog v1.0.0
sigs.k8s.io/controller-runtime v0.6.0
sigs.k8s.io/kubebuilder-declarative-pattern v0.0.0-20200512162422-ce639cbf6d4c
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We should figure out when we want to create a version in kubebuilder-declarative-pattern :-)

sigs.k8s.io/kubebuilder-declarative-pattern v0.0.0-20200702123846-f7388b7841f5
sigs.k8s.io/structured-merge-diff v0.0.0-20190817042607-6149e4549fca // indirect
sigs.k8s.io/testing_frameworks v0.1.2 // indirect
)
Loading