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

fix: Change project domain #96

Merged
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
6 changes: 3 additions & 3 deletions PROJECT
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
# This file is used to track the info used to scaffold your project
# and allow the plugins properly work.
# More info: https://book.kubebuilder.io/reference/project-config.html
domain: oadp.openshift.io
domain: openshift.io
layout:
- go.kubebuilder.io/v4
projectName: oadp-nac
Expand All @@ -12,8 +12,8 @@ resources:
crdVersion: v1
namespaced: true
controller: true
domain: oadp.openshift.io
group: nac
domain: openshift.io
group: oadp
kind: NonAdminBackup
path: github.com/migtools/oadp-non-admin/api/v1alpha1
version: v1alpha1
Expand Down
6 changes: 3 additions & 3 deletions api/v1alpha1/groupversion_info.go
Original file line number Diff line number Diff line change
Expand Up @@ -14,9 +14,9 @@ See the License for the specific language governing permissions and
limitations under the License.
*/

// Package v1alpha1 contains API Schema definitions for the nac v1alpha1 API group
// Package v1alpha1 contains API Schema definitions for the oadp v1alpha1 API group
// +kubebuilder:object:generate=true
// +groupName=nac.oadp.openshift.io
// +groupName=oadp.openshift.io
package v1alpha1

import (
Expand All @@ -26,7 +26,7 @@ import (

var (
// GroupVersion is group version used to register these objects
GroupVersion = schema.GroupVersion{Group: "nac.oadp.openshift.io", Version: "v1alpha1"}
GroupVersion = schema.GroupVersion{Group: "oadp.openshift.io", Version: "v1alpha1"}

// SchemeBuilder is used to add go types to the GroupVersionKind scheme
SchemeBuilder = &scheme.Builder{GroupVersion: GroupVersion}
Expand Down
2 changes: 1 addition & 1 deletion cmd/main.go
Original file line number Diff line number Diff line change
Expand Up @@ -114,7 +114,7 @@ func main() {
WebhookServer: webhookServer,
HealthProbeBindAddress: probeAddr,
LeaderElection: enableLeaderElection,
LeaderElectionID: "393da43e.oadp.openshift.io",
LeaderElectionID: "393da43e.openshift.io",
// LeaderElectionReleaseOnCancel defines if the leader should step down voluntarily
// when the Manager ends. This requires the binary to immediately end when the
// Manager is stopped, otherwise, this setting is unsafe. Setting this significantly
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,9 +4,9 @@ kind: CustomResourceDefinition
metadata:
annotations:
controller-gen.kubebuilder.io/version: v0.14.0
name: nonadminbackups.nac.oadp.openshift.io
name: nonadminbackups.oadp.openshift.io
spec:
group: nac.oadp.openshift.io
group: oadp.openshift.io
names:
kind: NonAdminBackup
listKind: NonAdminBackupList
Expand Down
2 changes: 1 addition & 1 deletion config/crd/kustomization.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
# since it depends on service name and namespace that are out of this kustomize package.
# It should be run by config/default
resources:
- bases/nac.oadp.openshift.io_nonadminbackups.yaml
- bases/oadp.openshift.io_nonadminbackups.yaml
#+kubebuilder:scaffold:crdkustomizeresource

patches:
Expand Down
4 changes: 2 additions & 2 deletions config/rbac/nonadminbackup_editor_role.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ metadata:
name: nonadminbackup-editor-role
rules:
- apiGroups:
- nac.oadp.openshift.io
- oadp.openshift.io
resources:
- nonadminbackups
verbs:
Expand All @@ -24,7 +24,7 @@ rules:
- update
- watch
- apiGroups:
- nac.oadp.openshift.io
- oadp.openshift.io
resources:
- nonadminbackups/status
verbs:
Expand Down
4 changes: 2 additions & 2 deletions config/rbac/nonadminbackup_viewer_role.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -12,15 +12,15 @@ metadata:
name: nonadminbackup-viewer-role
rules:
- apiGroups:
- nac.oadp.openshift.io
- oadp.openshift.io
resources:
- nonadminbackups
verbs:
- get
- list
- watch
- apiGroups:
- nac.oadp.openshift.io
- oadp.openshift.io
resources:
- nonadminbackups/status
verbs:
Expand Down
6 changes: 3 additions & 3 deletions config/rbac/role.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ metadata:
name: non-admin-controller-role
rules:
- apiGroups:
- nac.oadp.openshift.io
- oadp.openshift.io
resources:
- nonadminbackups
verbs:
Expand All @@ -17,13 +17,13 @@ rules:
- update
- watch
- apiGroups:
- nac.oadp.openshift.io
- oadp.openshift.io
resources:
- nonadminbackups/finalizers
verbs:
- update
- apiGroups:
- nac.oadp.openshift.io
- oadp.openshift.io
resources:
- nonadminbackups/status
verbs:
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:
- nac_v1alpha1_nonadminbackup.yaml
- oadp_v1alpha1_nonadminbackup.yaml
#+kubebuilder:scaffold:manifestskustomizesamples
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
apiVersion: nac.oadp.openshift.io/v1alpha1
apiVersion: oadp.openshift.io/v1alpha1
kind: NonAdminBackup
metadata:
labels:
Expand Down
17 changes: 16 additions & 1 deletion docs/CONTRIBUTING.md
Original file line number Diff line number Diff line change
Expand Up @@ -137,4 +137,19 @@ If Velero version or its objects needs changes, follow this workflow:

## Upgrade kubebuilder version

To upgrade kubebuilder version, create kubebuilder structure using the current kubebuilder version and the upgrade version, using the same commands presented in [kubebuilder architecture documentation](architecture.md#kubebuilder), in two different folders. Then generate a `diff` file from the two folders and apply changes to project code.
To upgrade kubebuilder version, create kubebuilder structure using the current kubebuilder version and the upgrade version (get kubebuilder executables in https://github.com/kubernetes-sigs/kubebuilder/releases), using the same commands presented in [kubebuilder architecture documentation](architecture.md#kubebuilder), in two different folders. Then generate a `diff` file from the two folders and apply changes to project code.

Example
```sh
mkdir current
mkdir new
cd current
# Run kubebuilder commands pointing to kubebuilder executable with the current version
cd ..
cd new
# Run kubebuilder commands pointing to kubebuilder executable with the new version
cd ..
diff -ruN current new > kubebuilder-upgrade.diff
patch -p1 --verbose -d ./ -i kubebuilder-upgrade.diff
# Resolve possible conflicts
```
4 changes: 2 additions & 2 deletions docs/architecture.md
Original file line number Diff line number Diff line change
Expand Up @@ -36,10 +36,10 @@ kubebuilder init \
--project-version 3 \
--project-name=oadp-nac \
--repo=github.com/migtools/oadp-non-admin \
--domain=oadp.openshift.io
--domain=openshift.io
kubebuilder create api \
--plugins go.kubebuilder.io/v4 \
--group nac \
--group oadp \
--version v1alpha1 \
--kind NonAdminBackup \
--resource --controller
Expand Down
6 changes: 3 additions & 3 deletions docs/design/Non_Admin_Controller_design.md
Original file line number Diff line number Diff line change
Expand Up @@ -58,7 +58,7 @@ This design intends to enable non-admin users the ability to perform Backup and
name: nonadminbackup-editor-role
rules:
- apiGroups:
- nac.oadp.openshift.io
- oadp.openshift.io
resources:
- nonadminbackups
- nonadminrestores
Expand All @@ -72,7 +72,7 @@ This design intends to enable non-admin users the ability to perform Backup and
- update
- watch
- apiGroups:
- nac.oadp.openshift.io
- oadp.openshift.io
resources:
- nonadminbackups/status
- nonadminrestores/status
Expand Down Expand Up @@ -122,7 +122,7 @@ This design intends to enable non-admin users the ability to perform Backup and
- **Non-Admin user creates a Non-Admin backup CR:** The user creates a NonAdminBackup custom resource object in the Namespace on which the backup will run within the Kubernetes cluster. The `NonAdminBackup` schema has the `backupSpec`, which is the same as `Backup` CR from the `velero.io/v1` apiVersion.

```yaml
apiVersion: nac.oadp.openshift.io/v1alpha1
apiVersion: oadp.openshift.io/v1alpha1
kind: NonAdminBackup
metadata:
name: example
Expand Down
6 changes: 3 additions & 3 deletions docs/non_admin_user.md
Original file line number Diff line number Diff line change
Expand Up @@ -39,13 +39,13 @@ Choose one of the authentication method sections to follow.
oc create namespace <non-admin-user-namespace>
```
- Ensure non admin user have appropriate permissions in its namespace, i.e., non admin user have editor roles for the following objects
- `nonadminbackups.nac.oadp.openshift.io`
- `nonadminbackups.oadp.openshift.io`

For example
```yaml
# config/rbac/nonadminbackup_editor_role.yaml
- apiGroups:
- nac.oadp.openshift.io
- oadp.openshift.io
resources:
- nonadminbackups
verbs:
Expand All @@ -57,7 +57,7 @@ Choose one of the authentication method sections to follow.
- update
- watch
- apiGroups:
- nac.oadp.openshift.io
- oadp.openshift.io
resources:
- nonadminbackups/status
verbs:
Expand Down
2 changes: 1 addition & 1 deletion hack/samples/backups/file-system.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ kind: Template
metadata:
name: fs-nonadminbackup
objects:
- apiVersion: nac.oadp.openshift.io/v1alpha1
- apiVersion: oadp.openshift.io/v1alpha1
kind: NonAdminBackup
metadata:
name: nonadminbackup-sample-${SUFFIX}
Expand Down
6 changes: 3 additions & 3 deletions internal/controller/nonadminbackup_controller.go
Original file line number Diff line number Diff line change
Expand Up @@ -64,9 +64,9 @@ const (
nameString = "name"
)

// +kubebuilder:rbac:groups=nac.oadp.openshift.io,resources=nonadminbackups,verbs=get;list;watch;create;update;patch;delete
// +kubebuilder:rbac:groups=nac.oadp.openshift.io,resources=nonadminbackups/status,verbs=get;update;patch
// +kubebuilder:rbac:groups=nac.oadp.openshift.io,resources=nonadminbackups/finalizers,verbs=update
// +kubebuilder:rbac:groups=oadp.openshift.io,resources=nonadminbackups,verbs=get;list;watch;create;update;patch;delete
// +kubebuilder:rbac:groups=oadp.openshift.io,resources=nonadminbackups/status,verbs=get;update;patch
// +kubebuilder:rbac:groups=oadp.openshift.io,resources=nonadminbackups/finalizers,verbs=update

// +kubebuilder:rbac:groups=velero.io,resources=backups,verbs=get;list;watch;create;update;patch;delete
// +kubebuilder:rbac:groups=velero.io,resources=deletebackuprequests,verbs=get;list;watch;create;update;patch;delete
Expand Down