Skip to content

Commit

Permalink
Add missing file licences and do some clean works.
Browse files Browse the repository at this point in the history
Signed-off-by: yanggang <[email protected]>
  • Loading branch information
yanggang committed Sep 19, 2023
1 parent b42fb23 commit ea02aa1
Show file tree
Hide file tree
Showing 14 changed files with 157 additions and 4 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -397,7 +397,7 @@ Target volume information includes PVC and PV that represents the volume and the
The data mover information and backup repository information are the same with DataUpload CRD.
DataDownload CRD defines the same status as DataUpload CRD with nearly the same meanings.

Below is the full spec of DataUpload CRD:
Below is the full spec of DataDownload CRD:
```
apiVersion: apiextensions.k8s.io/v1alpha1
kind: CustomResourceDefinition
Expand Down
15 changes: 15 additions & 0 deletions internal/resourcemodifiers/resource_modifiers.go
Original file line number Diff line number Diff line change
@@ -1,3 +1,18 @@
/*
Copyright The Velero Contributors.
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License.
*/
package resourcemodifiers

import (
Expand Down
15 changes: 15 additions & 0 deletions internal/resourcemodifiers/resource_modifiers_test.go
Original file line number Diff line number Diff line change
@@ -1,3 +1,18 @@
/*
Copyright The Velero Contributors.
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License.
*/
package resourcemodifiers

import (
Expand Down
15 changes: 15 additions & 0 deletions internal/resourcemodifiers/resource_modifiers_validator.go
Original file line number Diff line number Diff line change
@@ -1,3 +1,18 @@
/*
Copyright The Velero Contributors.
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License.
*/
package resourcemodifiers

import (
Expand Down
15 changes: 15 additions & 0 deletions internal/resourcemodifiers/resource_modifiers_validator_test.go
Original file line number Diff line number Diff line change
@@ -1,3 +1,18 @@
/*
Copyright The Velero Contributors.
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License.
*/
package resourcemodifiers

import (
Expand Down
15 changes: 15 additions & 0 deletions internal/resourcepolicies/resource_policies.go
Original file line number Diff line number Diff line change
@@ -1,3 +1,18 @@
/*
Copyright The Velero Contributors.
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License.
*/
package resourcepolicies

import (
Expand Down
15 changes: 15 additions & 0 deletions internal/resourcepolicies/resource_policies_test.go
Original file line number Diff line number Diff line change
@@ -1,3 +1,18 @@
/*
Copyright The Velero Contributors.
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License.
*/
package resourcepolicies

import (
Expand Down
15 changes: 15 additions & 0 deletions internal/resourcepolicies/volume_resources.go
Original file line number Diff line number Diff line change
@@ -1,3 +1,18 @@
/*
Copyright The Velero Contributors.
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License.
*/
package resourcepolicies

import (
Expand Down
15 changes: 15 additions & 0 deletions internal/resourcepolicies/volume_resources_test.go
Original file line number Diff line number Diff line change
@@ -1,3 +1,18 @@
/*
Copyright The Velero Contributors.
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License.
*/
package resourcepolicies

import (
Expand Down
15 changes: 15 additions & 0 deletions internal/resourcepolicies/volume_resources_validator.go
Original file line number Diff line number Diff line change
@@ -1,3 +1,18 @@
/*
Copyright The Velero Contributors.
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License.
*/
package resourcepolicies

import (
Expand Down
15 changes: 15 additions & 0 deletions internal/resourcepolicies/volume_resources_validator_test.go
Original file line number Diff line number Diff line change
@@ -1,3 +1,18 @@
/*
Copyright The Velero Contributors.
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License.
*/
package resourcepolicies

import (
Expand Down
2 changes: 1 addition & 1 deletion pkg/apis/velero/v2alpha1/data_download_types.go
Original file line number Diff line number Diff line change
Expand Up @@ -56,7 +56,7 @@ type DataDownloadSpec struct {
OperationTimeout metav1.Duration `json:"operationTimeout"`
}

// TargetPVCSpec is the specification for a target PVC.
// TargetVolumeSpec is the specification for a target PVC.
type TargetVolumeSpec struct {
// PVC is the name of the target PVC that is created by Velero restore
PVC string `json:"pvc"`
Expand Down
3 changes: 3 additions & 0 deletions pkg/controller/backup_controller.go
Original file line number Diff line number Diff line change
Expand Up @@ -195,6 +195,9 @@ func getLastSuccessBySchedule(backups []velerov1api.Backup) map[string]time.Time
}

schedule := backup.Labels[velerov1api.ScheduleNameLabel]
if schedule == "" {
continue
}
timestamp := backup.Status.CompletionTimestamp.Time

if timestamp.After(lastSuccessBySchedule[schedule]) {
Expand Down
4 changes: 2 additions & 2 deletions pkg/controller/download_request_controller.go
Original file line number Diff line number Diff line change
Expand Up @@ -144,7 +144,7 @@ func (r *downloadRequestReconciler) Reconcile(ctx context.Context, req ctrl.Requ
log.WithError(err).Error("fail to get restore for DownloadRequest")
return ctrl.Result{}, nil
}
log.Warnf("Fail to get restore for DownloadRequest %s. Retry later.", err.Error())
log.Warnf("fail to get restore for DownloadRequest %s. Retry later.", err.Error())
return ctrl.Result{}, errors.WithStack(err)
}
backupName = restore.Spec.BackupName
Expand Down Expand Up @@ -172,7 +172,7 @@ func (r *downloadRequestReconciler) Reconcile(ctx context.Context, req ctrl.Requ
log.Errorf("BSL for DownloadRequest cannot be found")
return ctrl.Result{}, nil
}
log.Warnf("Fail to get BSL for DownloadRequest: %s", err.Error())
log.Warnf("fail to get BSL for DownloadRequest: %s", err.Error())
return ctrl.Result{}, errors.WithStack(err)
}

Expand Down

0 comments on commit ea02aa1

Please sign in to comment.