-
Notifications
You must be signed in to change notification settings - Fork 72
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
OADP-5158: Do not allow restic config use in OADP 1.5+; Deprecate restic for file system backups #1235
base: master
Are you sure you want to change the base?
Conversation
1587d2c
to
7f9b1e9
Compare
This comment was marked as outdated.
This comment was marked as outdated.
This comment was marked as outdated.
This comment was marked as outdated.
This comment was marked as outdated.
This comment was marked as outdated.
This comment was marked as outdated.
This comment was marked as outdated.
This comment was marked as outdated.
This comment was marked as outdated.
This comment was marked as outdated.
This comment was marked as outdated.
This comment was marked as outdated.
This comment was marked as outdated.
This comment was marked as outdated.
This comment was marked as outdated.
This comment was marked as outdated.
This comment was marked as outdated.
This comment was marked as outdated.
This comment was marked as outdated.
This comment was marked as outdated.
This comment was marked as outdated.
This comment was marked as outdated.
This comment was marked as outdated.
This comment was marked as outdated.
This comment was marked as outdated.
This comment was marked as outdated.
This comment was marked as outdated.
This comment was marked as outdated.
This comment was marked as outdated.
This comment was marked as outdated.
This comment was marked as outdated.
controllers/nodeagent.go
Outdated
@@ -62,10 +60,6 @@ func getFsPvHostPath(platformType string) string { | |||
return envFs | |||
} | |||
|
|||
if env := os.Getenv(ResticPVHostPathEnvVar); env != "" { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
still not sure if I should delete this
f88e2d2
to
085c01c
Compare
This comment was marked as outdated.
This comment was marked as outdated.
api/v1alpha1/oadp_types.go
Outdated
// restic is for backwards compatibility and is replaced by the nodeAgent | ||
// restic will be removed in the future | ||
// +kubebuilder:deprecatedversion:warning=1.3 | ||
// (do not use warning) restic field is for backwards compatibility and |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
What does (do not use warning) mean here ?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think the intend here should be that "If a user uses restic config then the operator should do a No-Op and should add a warning on DPA that use node-agent config instead of restic"
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
So, the current idea is that user can only use restic through node-agent config, this is a way to tell user not to use restic config
If user tries to use, DPA want reconcile telling user to use node-agent config instead
This comment was marked as outdated.
This comment was marked as outdated.
085c01c
to
5ac138b
Compare
@mateusoliveira43: This pull request references OADP-5158 which is a valid jira issue. Warning: The referenced jira issue has an invalid target version for the target branch this PR targets: expected the bug to target the "4.19.0" version, but no target version was set. In response to this:
Instructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the openshift-eng/jira-lifecycle-plugin repository. |
This comment was marked as resolved.
This comment was marked as resolved.
@mateusoliveira43: This pull request references OADP-5158 which is a valid jira issue. Warning: The referenced jira issue has an invalid target version for the target branch this PR targets: expected the bug to target the "4.19.0" version, but no target version was set. In response to this:
Instructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the openshift-eng/jira-lifecycle-plugin repository. |
Signed-off-by: Mateus Oliveira <[email protected]>
6c5473d
to
cbd019d
Compare
@mateusoliveira43: The following tests failed, say
Full PR test history. Your PR dashboard. Instructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the kubernetes-sigs/prow repository. I understand the commands that are listed here. |
// restic is for backwards compatibility and is replaced by the nodeAgent | ||
// restic will be removed in the future | ||
// +kubebuilder:deprecatedversion:warning=1.3 | ||
// (do not use warning) restic field is for backwards compatibility and |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
s/field/spec
at both places
@@ -37,7 +35,6 @@ const ( | |||
IBMCloudPVHostPath = "/var/data/kubelet/pods" | |||
GenericPluginsHostPath = "/var/lib/kubelet/plugins" | |||
IBMCloudPluginsHostPath = "/var/data/kubelet/plugins" | |||
ResticPVHostPathEnvVar = "RESTIC_PV_HOSTPATH" |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think you will also need to remove RESTIC_PV_HOSTPATH
from manager.yaml and operator csv
// check for VSM/Volsync DataMover (OADP 1.2 or below) syntax | ||
if r.dpa.Spec.Features != nil && r.dpa.Spec.Features.DataMover != nil { | ||
return false, errors.New("Delete vsm from spec.configuration.velero.defaultPlugins and dataMover object from spec.features. Use Velero Built-in Data Mover instead") | ||
} | ||
|
||
// check for ResticConfig (OADP 1.4 or below) syntax | ||
if r.dpa.Spec.Configuration.Restic != nil { | ||
return false, errors.New("Delete restic object from spec.configuration, use spec.configuration.nodeAgent instead") |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
s/object/spec
@@ -16,6 +17,8 @@ import ( | |||
"github.com/openshift/oadp-operator/pkg/credentials" | |||
) | |||
|
|||
var wasRestic bool |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Should we explicitly set this as false ? (I think default is false but still)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
If we do, it would fail https://revive.run/r#var-declaration linter that was recently merged https://github.com/vmware-tanzu/velero/pull/8636/files#diff-9917ddc9f1c3304218f7269265b746d997c5c0615478177b5fceecd33ef47cb5
specifically because we are declaring "zeroLiteral"
var zeroLiteral = map[string]bool{
"false": true, // bool
// runes
`'\x00'`: true,
`'\000'`: true,
// strings
`""`: true,
"``": true,
// numerics
"0": true,
"0.": true,
"0.0": true,
"0i": true,
}
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
im ok with it either way.
Description
This PR removes logic of using old restic field (it should use nodeAgent field instead) from 1.5+ code. But it does not remove old restic field from DPA (which should only be removed when DPA version is updated), for a safe upgrade and better user experience for the users.
Also, log a Deprecation Warning when using restic in NodeAgent config.
How to test
OADP 1.5
run
make deploy-olm
and test thatspec.configuration.restic
) is presentspec.configuration.nodeAgent.uploaderType
is set torestic
Simulate a upgrade
Simulate a upgrade from OADP 1.4 to 1.5 (this PR branch), by
make catalog-test-upgrade
More info
Update should finish successfully and DPA should: