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

Fixing HPA not converting apiGroup for deploymentconfigs #126

Merged
merged 6 commits into from
Apr 20, 2022

Conversation

ammachado
Copy link
Contributor

ApiGroup for HPA ScaleTargetRef when it is a deploymentconfig is not changed to the new version.

@pranavgaikwad
Copy link
Contributor

@ammachado Thank you for the fix.

velero-plugins/horizontalpodautoscaler/restore.go Outdated Show resolved Hide resolved
velero-plugins/horizontalpodautoscaler/restore.go Outdated Show resolved Hide resolved
velero-plugins/horizontalpodautoscaler/restore.go Outdated Show resolved Hide resolved
@@ -41,7 +41,8 @@ func (p *RestorePlugin) AppliesTo() (velero.ResourceSelector, error) {
"replicasets.extensions",
"replicationcontroller",
"buildconfigs",
"buildconfigs.build.openshift.io"},
"buildconfigs.build.openshift.io",
"horizontalpodautoscalers"},
Copy link
Contributor

Choose a reason for hiding this comment

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

Why is this needed? I don't see anything in the below horizontalpodautoscaler restore plugin that relies on the actions of the common restore plugin here.

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 am not sure if it is needed, but on this list is all of the plugins that are present in the application.

Copy link
Contributor

Choose a reason for hiding this comment

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

@ammachado This can be removed from the common plugin since we have a separate plugin registered for hpa

Copy link
Contributor

Choose a reason for hiding this comment

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

@ammachado This list the resources that specifically need the actions taken in this plugin. Originally we applied these actions to all resources, but that resulted in poor performance when there were large numbers of resources being backed up and restored that didn't benefit from the actions of this plugin. Unless there's something this plugin does that your plugin relies on (and I don't think that's the case), then this is unnecessary.

@@ -41,7 +41,8 @@ func (p *RestorePlugin) AppliesTo() (velero.ResourceSelector, error) {
"replicasets.extensions",
"replicationcontroller",
"buildconfigs",
"buildconfigs.build.openshift.io"},
"buildconfigs.build.openshift.io",
"horizontalpodautoscalers"},
Copy link
Contributor

Choose a reason for hiding this comment

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

@ammachado This can be removed from the common plugin since we have a separate plugin registered for hpa

@pranavgaikwad pranavgaikwad merged commit 18b2491 into openshift:master Apr 20, 2022
rayfordj pushed a commit to rayfordj/openshift-velero-plugin that referenced this pull request Apr 20, 2022
* Fixing HPA not converting apiGroup for deploymentconfigs

* Fixing typos

* Update velero-plugins/horizontalpodautoscaler/restore.go

Co-authored-by: Pranav Gaikwad <pgaikwad@redhat.com>

* Update velero-plugins/horizontalpodautoscaler/restore.go

Co-authored-by: Pranav Gaikwad <pgaikwad@redhat.com>

* Throwing error when it's not possible to parse APIVersion of hpa.spec.scaleTargetRef

* Excluding HPA from common restore plugin

Co-authored-by: Adriano Marcondes Machado <admachad@redhat.com>
Co-authored-by: Pranav Gaikwad <pgaikwad@redhat.com>
rayfordj pushed a commit to rayfordj/openshift-velero-plugin that referenced this pull request Apr 20, 2022
* Fixing HPA not converting apiGroup for deploymentconfigs

* Fixing typos

* Update velero-plugins/horizontalpodautoscaler/restore.go

Co-authored-by: Pranav Gaikwad <pgaikwad@redhat.com>

* Update velero-plugins/horizontalpodautoscaler/restore.go

Co-authored-by: Pranav Gaikwad <pgaikwad@redhat.com>

* Throwing error when it's not possible to parse APIVersion of hpa.spec.scaleTargetRef

* Excluding HPA from common restore plugin

Co-authored-by: Adriano Marcondes Machado <admachad@redhat.com>
Co-authored-by: Pranav Gaikwad <pgaikwad@redhat.com>
rayfordj added a commit that referenced this pull request Apr 20, 2022
* Fixing HPA not converting apiGroup for deploymentconfigs

* Fixing typos

* Update velero-plugins/horizontalpodautoscaler/restore.go

Co-authored-by: Pranav Gaikwad <pgaikwad@redhat.com>

* Update velero-plugins/horizontalpodautoscaler/restore.go

Co-authored-by: Pranav Gaikwad <pgaikwad@redhat.com>

* Throwing error when it's not possible to parse APIVersion of hpa.spec.scaleTargetRef

* Excluding HPA from common restore plugin

Co-authored-by: Adriano Marcondes Machado <admachad@redhat.com>
Co-authored-by: Pranav Gaikwad <pgaikwad@redhat.com>

Co-authored-by: Adriano Machado <60320+ammachado@users.noreply.github.com>
Co-authored-by: Adriano Marcondes Machado <admachad@redhat.com>
Co-authored-by: Pranav Gaikwad <pgaikwad@redhat.com>
rayfordj added a commit that referenced this pull request Apr 21, 2022
* Fixing HPA not converting apiGroup for deploymentconfigs

* Fixing typos

* Update velero-plugins/horizontalpodautoscaler/restore.go

Co-authored-by: Pranav Gaikwad <pgaikwad@redhat.com>

* Update velero-plugins/horizontalpodautoscaler/restore.go

Co-authored-by: Pranav Gaikwad <pgaikwad@redhat.com>

* Throwing error when it's not possible to parse APIVersion of hpa.spec.scaleTargetRef

* Excluding HPA from common restore plugin

Co-authored-by: Adriano Marcondes Machado <admachad@redhat.com>
Co-authored-by: Pranav Gaikwad <pgaikwad@redhat.com>

Co-authored-by: Adriano Machado <60320+ammachado@users.noreply.github.com>
Co-authored-by: Adriano Marcondes Machado <admachad@redhat.com>
Co-authored-by: Pranav Gaikwad <pgaikwad@redhat.com>
sseago pushed a commit to sseago/openshift-velero-plugin that referenced this pull request May 3, 2022
* Fixing HPA not converting apiGroup for deploymentconfigs

* Fixing typos

* Update velero-plugins/horizontalpodautoscaler/restore.go

Co-authored-by: Pranav Gaikwad <pgaikwad@redhat.com>

* Update velero-plugins/horizontalpodautoscaler/restore.go

Co-authored-by: Pranav Gaikwad <pgaikwad@redhat.com>

* Throwing error when it's not possible to parse APIVersion of hpa.spec.scaleTargetRef

* Excluding HPA from common restore plugin

Co-authored-by: Adriano Marcondes Machado <admachad@redhat.com>
Co-authored-by: Pranav Gaikwad <pgaikwad@redhat.com>
dymurray pushed a commit that referenced this pull request May 9, 2022
* Fixing HPA not converting apiGroup for deploymentconfigs (#126)

* Fixing HPA not converting apiGroup for deploymentconfigs

* Fixing typos

* Update velero-plugins/horizontalpodautoscaler/restore.go

Co-authored-by: Pranav Gaikwad <pgaikwad@redhat.com>

* Update velero-plugins/horizontalpodautoscaler/restore.go

Co-authored-by: Pranav Gaikwad <pgaikwad@redhat.com>

* Throwing error when it's not possible to parse APIVersion of hpa.spec.scaleTargetRef

* Excluding HPA from common restore plugin

Co-authored-by: Adriano Marcondes Machado <admachad@redhat.com>
Co-authored-by: Pranav Gaikwad <pgaikwad@redhat.com>

* run `go mod tidy`

Co-authored-by: Adriano Machado <60320+ammachado@users.noreply.github.com>
Co-authored-by: Adriano Marcondes Machado <admachad@redhat.com>
Co-authored-by: Pranav Gaikwad <pgaikwad@redhat.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants