Skip to content

Commit

Permalink
Merge pull request #782 from RainbowMango/pr_deprecate_rsp
Browse files Browse the repository at this point in the history
Deprecate ReplicaSchedulingPolicy API
  • Loading branch information
karmada-bot authored Sep 30, 2021
2 parents 3f275c5 + 1a60ade commit 721215c
Show file tree
Hide file tree
Showing 12 changed files with 16 additions and 13 deletions.
2 changes: 1 addition & 1 deletion charts/_crds/bases/cluster.karmada.io_clusters.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ apiVersion: apiextensions.k8s.io/v1
kind: CustomResourceDefinition
metadata:
annotations:
controller-gen.kubebuilder.io/version: v0.4.1
controller-gen.kubebuilder.io/version: v0.6.2
creationTimestamp: null
name: clusters.cluster.karmada.io
spec:
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ apiVersion: apiextensions.k8s.io/v1
kind: CustomResourceDefinition
metadata:
annotations:
controller-gen.kubebuilder.io/version: v0.4.1
controller-gen.kubebuilder.io/version: v0.6.2
creationTimestamp: null
name: clusteroverridepolicies.policy.karmada.io
spec:
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ apiVersion: apiextensions.k8s.io/v1
kind: CustomResourceDefinition
metadata:
annotations:
controller-gen.kubebuilder.io/version: v0.4.1
controller-gen.kubebuilder.io/version: v0.6.2
creationTimestamp: null
name: clusterpropagationpolicies.policy.karmada.io
spec:
Expand Down
2 changes: 1 addition & 1 deletion charts/_crds/bases/policy.karmada.io_overridepolicies.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ apiVersion: apiextensions.k8s.io/v1
kind: CustomResourceDefinition
metadata:
annotations:
controller-gen.kubebuilder.io/version: v0.4.1
controller-gen.kubebuilder.io/version: v0.6.2
creationTimestamp: null
name: overridepolicies.policy.karmada.io
spec:
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ apiVersion: apiextensions.k8s.io/v1
kind: CustomResourceDefinition
metadata:
annotations:
controller-gen.kubebuilder.io/version: v0.4.1
controller-gen.kubebuilder.io/version: v0.6.2
creationTimestamp: null
name: propagationpolicies.policy.karmada.io
spec:
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ apiVersion: apiextensions.k8s.io/v1
kind: CustomResourceDefinition
metadata:
annotations:
controller-gen.kubebuilder.io/version: v0.4.1
controller-gen.kubebuilder.io/version: v0.6.2
creationTimestamp: null
name: replicaschedulingpolicies.policy.karmada.io
spec:
Expand All @@ -18,7 +18,8 @@ spec:
singular: replicaschedulingpolicy
scope: Namespaced
versions:
- name: v1alpha1
- deprecated: true
name: v1alpha1
schema:
openAPIV3Schema:
description: ReplicaSchedulingPolicy represents the policy that propagates
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ apiVersion: apiextensions.k8s.io/v1
kind: CustomResourceDefinition
metadata:
annotations:
controller-gen.kubebuilder.io/version: v0.4.1
controller-gen.kubebuilder.io/version: v0.6.2
creationTimestamp: null
name: clusterresourcebindings.work.karmada.io
spec:
Expand Down
2 changes: 1 addition & 1 deletion charts/_crds/bases/work.karmada.io_resourcebindings.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ apiVersion: apiextensions.k8s.io/v1
kind: CustomResourceDefinition
metadata:
annotations:
controller-gen.kubebuilder.io/version: v0.4.1
controller-gen.kubebuilder.io/version: v0.6.2
creationTimestamp: null
name: resourcebindings.work.karmada.io
spec:
Expand Down
2 changes: 1 addition & 1 deletion charts/_crds/bases/work.karmada.io_works.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ apiVersion: apiextensions.k8s.io/v1
kind: CustomResourceDefinition
metadata:
annotations:
controller-gen.kubebuilder.io/version: v0.4.1
controller-gen.kubebuilder.io/version: v0.6.2
creationTimestamp: null
name: works.work.karmada.io
spec:
Expand Down
2 changes: 1 addition & 1 deletion hack/update-crdgen.sh
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ set -o nounset
set -o pipefail

CONTROLLER_GEN_PKG="sigs.k8s.io/controller-tools/cmd/controller-gen"
CONTROLLER_GEN_VER="v0.4.1"
CONTROLLER_GEN_VER="v0.6.2"

source hack/util.sh

Expand Down
1 change: 1 addition & 0 deletions pkg/apis/policy/v1alpha1/replicascheduling_types.go
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@ import metav1 "k8s.io/apimachinery/pkg/apis/meta/v1"
// +genclient
// +k8s:deepcopy-gen:interfaces=k8s.io/apimachinery/pkg/runtime.Object
// +kubebuilder:resource:shortName=rsp
// +kubebuilder:deprecatedversion

// ReplicaSchedulingPolicy represents the policy that propagates total number of replicas for deployment.
type ReplicaSchedulingPolicy struct {
Expand Down
5 changes: 3 additions & 2 deletions pkg/controllers/hpa/hpa_controller.go
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,7 @@ import (
controllerruntime "sigs.k8s.io/controller-runtime"
"sigs.k8s.io/controller-runtime/pkg/client"

workv1alpha1 "github.com/karmada-io/karmada/pkg/apis/work/v1alpha1"
workv1alpha2 "github.com/karmada-io/karmada/pkg/apis/work/v1alpha2"
"github.com/karmada-io/karmada/pkg/util"
"github.com/karmada-io/karmada/pkg/util/helper"
Expand Down Expand Up @@ -98,8 +99,8 @@ func (c *HorizontalPodAutoscalerController) buildWorks(hpa *autoscalingv1.Horizo
Finalizers: []string{util.ExecutionControllerFinalizer},
}

util.MergeLabel(hpaObj, workv1alpha2.WorkNamespaceLabel, workNamespace)
util.MergeLabel(hpaObj, workv1alpha2.WorkNameLabel, workName)
util.MergeLabel(hpaObj, workv1alpha1.WorkNamespaceLabel, workNamespace)
util.MergeLabel(hpaObj, workv1alpha1.WorkNameLabel, workName)

if err = helper.CreateOrUpdateWork(c.Client, objectMeta, hpaObj); err != nil {
return err
Expand Down

0 comments on commit 721215c

Please sign in to comment.