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
10 changes: 5 additions & 5 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -3,11 +3,11 @@ name: Continuous Integration
on:
push:
branches:
- master
- oadp-dev
- oadp-1.5
pull_request:
branches:
- master
- oadp-dev
Comment thread
coderabbitai[bot] marked this conversation as resolved.
- oadp-1.5
schedule:
- cron: '0 0 * * 1' # Every Monday at 00:00 UTC
Expand All @@ -29,10 +29,10 @@ jobs:
- name: Go unit and integration tests
run: make simulation-test

# Built from source with the repo's Go toolchain (the prebuilt golangci-lint v2.0.2
# release binary is built with Go 1.24 and cannot lint a go 1.26 module).
- name: Go linters
uses: golangci/golangci-lint-action@v9
with:
version: v2.0.2
run: make lint

- name: Go dependencies
run: make check-go-dependencies
Expand Down
4 changes: 3 additions & 1 deletion Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -224,7 +224,9 @@ editorconfig: $(LOCALBIN) ## Download editorconfig locally if necessary.
mv $(LOCALBIN)/$${ec_binary} $(EC) ;\
}

COVERAGE_THRESHOLD=60
# Temporary: lowered from 60. Prow tide counts optional GitHub Actions jobs as blocking,
# see https://github.com/kubernetes-sigs/prow/issues/915. Raise again later.
COVERAGE_THRESHOLD=40
Comment thread
coderabbitai[bot] marked this conversation as resolved.

.PHONY: ci
ci: simulation-test lint docker-build hadolint check-generate check-manifests ec check-go-dependencies check-images ## Run all project continuous integration (CI) checks locally.
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 @@ -29,7 +29,7 @@ var (
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}
SchemeBuilder = &scheme.Builder{GroupVersion: GroupVersion} //nolint:staticcheck // kubebuilder scaffold, replacement touches every *_types.go init

// AddToScheme adds the types in this group-version to the given scheme.
AddToScheme = SchemeBuilder.AddToScheme
Expand Down
8 changes: 4 additions & 4 deletions api/v1alpha1/nonadminbackup_types.go
Original file line number Diff line number Diff line change
Expand Up @@ -117,6 +117,10 @@ type DataMoverDataUploads struct {

// FileSystemPodVolumeBackups contains information of the related Velero PodVolumeBackup objects.
type FileSystemPodVolumeBackups struct {
// type of uploader used for pod volume backups (e.g., kopia, restic)
// +optional
UploaderType string `json:"uploaderType,omitempty"`

// number of PodVolumeBackups related to this NonAdminBackup's Backup
// +optional
Total int `json:"total,omitempty"`
Expand All @@ -136,10 +140,6 @@ type FileSystemPodVolumeBackups struct {
// number of PodVolumeBackups related to this NonAdminBackup's Backup in phase Completed
// +optional
Completed int `json:"completed,omitempty"`

// type of uploader used for pod volume backups (e.g., kopia, restic)
// +optional
UploaderType string `json:"uploaderType,omitempty"`
}

// NonAdminBackupStatus defines the observed state of NonAdminBackup
Expand Down
14 changes: 14 additions & 0 deletions config/crd/bases/oadp.openshift.io_nonadminbackups.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -54,6 +54,13 @@ spec:
backupSpec:
description: BackupSpec defines the specification for a Velero backup.
properties:
backupType:
description: BackupType specifies how volume data is backed up,
with possible values including Full and Incremental.
enum:
- Full
- Incremental
type: string
csiSnapshotTimeout:
description: |-
CSISnapshotTimeout specifies the time used to wait for CSI VolumeSnapshot status turns to
Expand Down Expand Up @@ -712,6 +719,13 @@ spec:
spec:
description: spec captures the current spec of the Velero backup.
properties:
backupType:
description: BackupType specifies how volume data is backed
up, with possible values including Full and Incremental.
enum:
- Full
- Incremental
type: string
csiSnapshotTimeout:
description: |-
CSISnapshotTimeout specifies the time used to wait for CSI VolumeSnapshot status turns to
Expand Down
2 changes: 1 addition & 1 deletion config/default/kustomization.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ resources:
#- ../prometheus

patches:
# Create same deployment as OADP https://github.com/openshift/oadp-operator/blob/master/controllers/nonadmin_controller.go
# Create same deployment as OADP https://github.com/openshift/oadp-operator/blob/oadp-dev/controllers/nonadmin_controller.go
- path: manager_oadp_patch.yaml
# Protect the /metrics endpoint by putting it behind auth.
# If you want your controller-manager to expose the /metrics
Expand Down
6 changes: 3 additions & 3 deletions docs/CONTRIBUTING.md
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ If you are upgrading project's kubebuilder version, please follow [upgrade kubeb

To install OADP operator from default or a release branch in your cluster, with related OADP NAC from default or same release branch, run
```sh
git clone --depth=1 git@github.com:openshift/oadp-operator.git -b master # or appropriate branch
git clone --depth=1 git@github.com:openshift/oadp-operator.git -b oadp-dev # or appropriate branch
cd oadp-operator
make deploy-olm
```
Expand All @@ -36,7 +36,7 @@ To install OADP operator from a branch in your cluster, with OADP NAC from curre
export NAC_PATH=$PWD # or appropriate NAC repository path, already with current branch pointing to development branch
export DEV_IMG=ttl.sh/oadp-non-admin-$(git rev-parse --short HEAD)-$(echo $RANDOM):1h
IMG=$DEV_IMG make docker-build docker-push
git clone --depth=1 git@github.com:openshift/oadp-operator.git -b master # or appropriate branch
git clone --depth=1 git@github.com:openshift/oadp-operator.git -b oadp-dev # or appropriate branch
cd oadp-operator
NON_ADMIN_CONTROLLER_PATH=$NAC_PATH NON_ADMIN_CONTROLLER_IMG=$DEV_IMG make update-non-admin-manifests deploy-olm
```
Expand Down Expand Up @@ -141,7 +141,7 @@ If Velero version or its objects needs changes, follow this workflow:

To upgrade OADP version, run
```sh
go get github.com/openshift/oadp-operator@master # or appropriate branch
go get github.com/openshift/oadp-operator@oadp-dev # or appropriate branch
```

TODO when to update oadp-operator version in go.mod?
Expand Down
14 changes: 14 additions & 0 deletions internal/common/function/function_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -383,6 +383,11 @@ func TestValidateBackupSpecEnforcedFields(t *testing.T) {
enforcedValue: "enforced-label-key",
overrideValue: "user-label-key",
},
{
name: "BackupType",
enforcedValue: velerov1.BackupTypeFull,
overrideValue: velerov1.BackupTypeIncremental,
},
}
for _, test := range tests {
t.Run(test.name, func(t *testing.T) {
Expand Down Expand Up @@ -832,6 +837,15 @@ func TestValidateRestoreSpecEnforcedFields(t *testing.T) {
Name: "melon",
},
},
{
name: "ResourcePolicy",
enforcedValue: &corev1.TypedLocalObjectReference{
Name: "apple",
},
overrideValue: &corev1.TypedLocalObjectReference{
Name: "pear",
},
},
}
for _, test := range tests {
t.Run(test.name, func(t *testing.T) {
Expand Down
Loading