Skip to content
Open
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
2 changes: 1 addition & 1 deletion Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ RUN go mod download

# Copy the go source
COPY main.go main.go
COPY api/ api/
COPY apis/ apis/
COPY controllers/ controllers/

# Build
Expand Down
5 changes: 3 additions & 2 deletions PROJECT
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
domain: zachfi
layout:
- go.kubebuilder.io/v3
multigroup: true
projectName: nodemanager
repo: github.com/zachfi/nodemanager
resources:
Expand All @@ -11,7 +12,7 @@ resources:
domain: zachfi
group: common
kind: ConfigSet
path: github.com/zachfi/nodemanager/api/v1
path: github.com/zachfi/nodemanager/apis/common/v1
version: v1
- api:
crdVersion: v1
Expand All @@ -20,6 +21,6 @@ resources:
domain: zachfi
group: common
kind: ManagedNode
path: github.com/zachfi/nodemanager/api/v1
path: github.com/zachfi/nodemanager/apis/common/v1
version: v1
version: "3"
File renamed without changes.
File renamed without changes.
File renamed without changes.
4 changes: 2 additions & 2 deletions controllers/common.go → controllers/common/common.go
Original file line number Diff line number Diff line change
@@ -1,11 +1,11 @@
package controllers
package common

import (
"context"
"fmt"
"os"

commonv1 "github.com/zachfi/nodemanager/api/v1"
commonv1 "github.com/zachfi/nodemanager/apis/common/v1"

"github.com/go-logr/logr"
"github.com/pkg/errors"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ See the License for the specific language governing permissions and
limitations under the License.
*/

package controllers
package common

import (
"bytes"
Expand All @@ -37,7 +37,7 @@ import (
"sigs.k8s.io/controller-runtime/pkg/client"
"sigs.k8s.io/controller-runtime/pkg/log"

commonv1 "github.com/zachfi/nodemanager/api/v1"
commonv1 "github.com/zachfi/nodemanager/apis/common/v1"

"github.com/zachfi/nodemanager/pkg/common"
)
Expand Down
2 changes: 1 addition & 1 deletion controllers/errors.go → controllers/common/errors.go
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
package controllers
package common

import "fmt"

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ See the License for the specific language governing permissions and
limitations under the License.
*/

package controllers
package common

import (
"context"
Expand All @@ -29,7 +29,7 @@ import (
"sigs.k8s.io/controller-runtime/pkg/client"
"sigs.k8s.io/controller-runtime/pkg/log"

commonv1 "github.com/zachfi/nodemanager/api/v1"
commonv1 "github.com/zachfi/nodemanager/apis/common/v1"
"github.com/zachfi/nodemanager/pkg/common"
)

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ See the License for the specific language governing permissions and
limitations under the License.
*/

package controllers
package common

import (
"path/filepath"
Expand All @@ -31,7 +31,7 @@ import (
logf "sigs.k8s.io/controller-runtime/pkg/log"
"sigs.k8s.io/controller-runtime/pkg/log/zap"

commonv1 "github.com/zachfi/nodemanager/api/v1"
commonv1 "github.com/zachfi/nodemanager/apis/common/v1"
//+kubebuilder:scaffold:imports
)

Expand All @@ -55,7 +55,7 @@ var _ = BeforeSuite(func() {

By("bootstrapping test environment")
testEnv = &envtest.Environment{
CRDDirectoryPaths: []string{filepath.Join("..", "config", "crd", "bases")},
CRDDirectoryPaths: []string{filepath.Join("..", "..", "config", "crd", "bases")},
ErrorIfCRDPathMissing: true,
}

Expand Down
8 changes: 4 additions & 4 deletions main.go
Original file line number Diff line number Diff line change
Expand Up @@ -35,8 +35,8 @@ import (

"go.opentelemetry.io/otel"

commonv1 "github.com/zachfi/nodemanager/api/v1"
"github.com/zachfi/nodemanager/controllers"
commonv1 "github.com/zachfi/nodemanager/apis/common/v1"
commoncontrollers "github.com/zachfi/nodemanager/controllers/common"

//+kubebuilder:scaffold:imports

Expand Down Expand Up @@ -132,15 +132,15 @@ func main() {
os.Exit(1)
}

if err = (&controllers.ConfigSetReconciler{
if err = (&commoncontrollers.ConfigSetReconciler{
Client: mgr.GetClient(),
Scheme: mgr.GetScheme(),
Tracer: otel.Tracer("ConfigSet"),
}).SetupWithManager(mgr); err != nil {
setupLog.Error(err, "unable to create controller", "controller", "ConfigSet")
os.Exit(1)
}
if err = (&controllers.ManagedNodeReconciler{
if err = (&commoncontrollers.ManagedNodeReconciler{
Client: mgr.GetClient(),
Scheme: mgr.GetScheme(),
Tracer: otel.Tracer("ManagedNode"),
Expand Down