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

Add missing file licences and do some clean works. #6843

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
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.
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

According to https://www.apache.org/licenses/LICENSE-2.0#apply

Year is required. Thoughts?

Copyright [yyyy] [name of copyright owner]

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I just like the license can be forever.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Rebased , add the years.

Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Actually, according to the project code standards, copyright year is to be omitted.
https://velero.io/docs/v1.12/code-standards/#copyright-header

Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'm not sure what led to the code standards decision to remove the year. It probably should be there, but the fix to that is to change the code standards (a separate issue from this).

Copy link
Contributor Author

@yanggangtony yanggangtony Sep 29, 2023

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

yes, so how to handle this case , revert to last commit? i delete the year? WDYT @sseago

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Follow the code standards guide, delete the year..🥲🥲


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
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 @@
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())

Check warning on line 147 in pkg/controller/download_request_controller.go

View check run for this annotation

Codecov / codecov/patch

pkg/controller/download_request_controller.go#L147

Added line #L147 was not covered by tests
return ctrl.Result{}, errors.WithStack(err)
}
backupName = restore.Spec.BackupName
Expand Down Expand Up @@ -172,7 +172,7 @@
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())

Check warning on line 175 in pkg/controller/download_request_controller.go

View check run for this annotation

Codecov / codecov/patch

pkg/controller/download_request_controller.go#L175

Added line #L175 was not covered by tests
return ctrl.Result{}, errors.WithStack(err)
}

Expand Down
Loading