Skip to content

Commit

Permalink
Merge pull request #1 from mateusoliveira43/fix/generate-fix
Browse files Browse the repository at this point in the history
fix: kubebuilder generate fix
  • Loading branch information
mpryc authored Mar 1, 2024
2 parents 616315a + 78696d1 commit d512d57
Show file tree
Hide file tree
Showing 15 changed files with 41 additions and 22 deletions.
6 changes: 3 additions & 3 deletions PROJECT
Original file line number Diff line number Diff line change
Expand Up @@ -6,16 +6,16 @@ domain: oadp.openshift.io
layout:
- go.kubebuilder.io/v4
projectName: oadp-nac
repo: oadp.openshift.io/nac
repo: github.com/migtools/oadp-non-admin
resources:
- api:
crdVersion: v1
namespaced: true
controller: true
domain: oadp.openshift.io
group: oadp.openshift.io
group: nac
kind: NonAdminBackup
path: github.com/openshift/oadp-non-admin/api/v1alpha1
path: github.com/migtools/oadp-non-admin/api/v1alpha1
version: v1alpha1
- controller: true
domain: oadp.openshift.io
Expand Down
22 changes: 22 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -216,6 +216,28 @@ kubectl apply -f https://raw.githubusercontent.com/<org>/oadp-nac/<tag or branch

More information can be found via the [Kubebuilder Documentation](https://book.kubebuilder.io/introduction.html)

## Architecture

The project was generated using kubebuilder version `v3.14.0`, running the following commands
```sh
kubebuilder init \
--plugins go.kubebuilder.io/v4 \
--project-version 3 \
--project-name=oadp-nac \
--repo=github.com/migtools/oadp-non-admin \
--domain=oadp.openshift.io
kubebuilder create api \
--plugins go.kubebuilder.io/v4 \
--group nac \
--version v1alpha1 \
--kind NonAdminBackup \
--resource --controller
make manifests
```
> **NOTE:** The information about plugin and project version, as well as project name, repo and domain, is stored in [PROJECT](PROJECT) file
To upgrade kubebuilder version, create kubebuilder structure using the current kubebuilder version and the upgrade version, using the same commands presented earlier, in two different folders. Then generate a `diff` file from the two folders and apply changes to project code.

## License

Copyright 2024.
Expand Down
2 changes: 1 addition & 1 deletion api/v1alpha1/groupversion_info.go
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 v1alpha1 contains API Schema definitions for the oadp.openshift.io v1alpha1 API group
// Package v1alpha1 contains API Schema definitions for the nac v1alpha1 API group
// +kubebuilder:object:generate=true
// +groupName=nac.oadp.openshift.io
package v1alpha1
Expand Down
4 changes: 2 additions & 2 deletions cmd/main.go
Original file line number Diff line number Diff line change
Expand Up @@ -36,8 +36,8 @@ import (
metricsserver "sigs.k8s.io/controller-runtime/pkg/metrics/server"
"sigs.k8s.io/controller-runtime/pkg/webhook"

nacv1alpha1 "github.com/openshift/oadp-non-admin/api/v1alpha1"
"github.com/openshift/oadp-non-admin/internal/controller"
nacv1alpha1 "github.com/migtools/oadp-non-admin/api/v1alpha1"
"github.com/migtools/oadp-non-admin/internal/controller"
//+kubebuilder:scaffold:imports
)

Expand Down
2 changes: 1 addition & 1 deletion config/samples/kustomization.yaml
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
## Append samples of your project ##
resources:
- oadp.openshift.io_v1alpha1_nonadminbackup.yaml
- nac_v1alpha1_nonadminbackup.yaml
#+kubebuilder:scaffold:manifestskustomizesamples
11 changes: 4 additions & 7 deletions go.mod
Original file line number Diff line number Diff line change
@@ -1,21 +1,18 @@
module github.com/openshift/oadp-non-admin
module github.com/migtools/oadp-non-admin

go 1.21

require (
github.com/go-logr/logr v1.4.1
github.com/onsi/ginkgo/v2 v2.14.0
github.com/onsi/gomega v1.30.0
github.com/stretchr/testify v1.8.4
github.com/vmware-tanzu/velero v1.12.0
k8s.io/apimachinery v0.29.0
k8s.io/client-go v0.29.0
sigs.k8s.io/controller-runtime v0.17.0
)

require (
github.com/go-logr/logr v1.4.1
github.com/stretchr/testify v1.8.4
github.com/vmware-tanzu/velero v1.12.0
)

require (
github.com/beorn7/perks v1.0.1 // indirect
github.com/cespare/xxhash/v2 v2.2.0 // indirect
Expand Down
2 changes: 1 addition & 1 deletion internal/controller/common_nab.go
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ import (

velerov1api "github.com/vmware-tanzu/velero/pkg/apis/velero/v1"

nacv1alpha1 "github.com/openshift/oadp-non-admin/api/v1alpha1"
nacv1alpha1 "github.com/migtools/oadp-non-admin/api/v1alpha1"
)

func GetVeleroBackupSpecFromNonAdminBackup(nonAdminBackup *nacv1alpha1.NonAdminBackup) (*velerov1api.BackupSpec, error) {
Expand Down
2 changes: 1 addition & 1 deletion internal/controller/common_nab_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ import (
"fmt"
"testing"

nacv1alpha1 "github.com/openshift/oadp-non-admin/api/v1alpha1"
nacv1alpha1 "github.com/migtools/oadp-non-admin/api/v1alpha1"
"github.com/stretchr/testify/assert"
velerov1api "github.com/vmware-tanzu/velero/pkg/apis/velero/v1"
)
Expand Down
2 changes: 1 addition & 1 deletion internal/controller/common_velero.go
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ import (
"sigs.k8s.io/controller-runtime/pkg/client"
"sigs.k8s.io/controller-runtime/pkg/log"

nacv1alpha1 "github.com/openshift/oadp-non-admin/api/v1alpha1"
nacv1alpha1 "github.com/migtools/oadp-non-admin/api/v1alpha1"
velerov1api "github.com/vmware-tanzu/velero/pkg/apis/velero/v1"
)

Expand Down
2 changes: 1 addition & 1 deletion internal/controller/common_velero_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ import (

metav1 "k8s.io/apimachinery/pkg/apis/meta/v1"

nacv1alpha1 "github.com/openshift/oadp-non-admin/api/v1alpha1"
nacv1alpha1 "github.com/migtools/oadp-non-admin/api/v1alpha1"
velerov1api "github.com/vmware-tanzu/velero/pkg/apis/velero/v1"
)

Expand Down
2 changes: 1 addition & 1 deletion internal/controller/nonadminbackup_controller.go
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ import (
"sigs.k8s.io/controller-runtime/pkg/client"
"sigs.k8s.io/controller-runtime/pkg/log"

nacv1alpha1 "github.com/openshift/oadp-non-admin/api/v1alpha1"
nacv1alpha1 "github.com/migtools/oadp-non-admin/api/v1alpha1"
velerov1api "github.com/vmware-tanzu/velero/pkg/apis/velero/v1"
"sigs.k8s.io/controller-runtime/pkg/controller/controllerutil"

Expand Down
2 changes: 1 addition & 1 deletion internal/controller/nonadminbackup_controller_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ import (

metav1 "k8s.io/apimachinery/pkg/apis/meta/v1"

nacv1alpha1 "github.com/openshift/oadp-non-admin/api/v1alpha1"
nacv1alpha1 "github.com/migtools/oadp-non-admin/api/v1alpha1"
)

var _ = Describe("NonAdminBackup Controller", func() {
Expand Down
2 changes: 1 addition & 1 deletion internal/controller/suite_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@ import (
logf "sigs.k8s.io/controller-runtime/pkg/log"
"sigs.k8s.io/controller-runtime/pkg/log/zap"

nacv1alpha1 "github.com/openshift/oadp-non-admin/api/v1alpha1"
nacv1alpha1 "github.com/migtools/oadp-non-admin/api/v1alpha1"
//+kubebuilder:scaffold:imports
)

Expand Down
2 changes: 1 addition & 1 deletion test/e2e/e2e_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ import (
. "github.com/onsi/ginkgo/v2"
. "github.com/onsi/gomega"

"github.com/openshift/oadp-non-admin/test/utils"
"github.com/migtools/oadp-non-admin/test/utils"
)

const namespace = "oadp-nac-system"
Expand Down

0 comments on commit d512d57

Please sign in to comment.