Skip to content

Commit

Permalink
feature: image loader support gamestatefulset, issue TencentBlueKing#684
Browse files Browse the repository at this point in the history
  • Loading branch information
stonewesley committed Dec 29, 2020
1 parent 4f7af61 commit 541cb77
Show file tree
Hide file tree
Showing 4 changed files with 397 additions and 3 deletions.
3 changes: 2 additions & 1 deletion bcs-services/bcs-webhook-server/go.mod
Original file line number Diff line number Diff line change
Expand Up @@ -3,9 +3,10 @@ module github.com/Tencent/bk-bcs/bcs-services/bcs-webhook-server
go 1.14

replace (
bitbucket.org/ww/goautoneg => github.com/adjust/goautoneg v0.0.0-20150426214442-d788f35a0315
bitbucket.org/ww/goautoneg => github.com/adjust/goautoneg v0.0.0-20150426214442-d788f35a0315
github.com/Tencent/bk-bcs => ../../../bk-bcs
github.com/Tencent/bk-bcs/bcs-k8s/bcs-gamedeployment-operator => ../../bcs-k8s/bcs-gamedeployment-operator
github.com/Tencent/bk-bcs/bcs-k8s/bcs-gamestatefulset-operator => ../../bcs-k8s/bcs-gamestatefulset-operator
github.com/Tencent/bk-bcs/bcs-k8s/kubernetes => ../../bcs-k8s/kubernetes
github.com/Tencent/bk-bcs/bcs-k8s/kubernetes/common => ../../bcs-k8s/kubernetes/common
github.com/coreos/bbolt v1.3.4 => go.etcd.io/bbolt v1.3.4
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -157,7 +157,7 @@ func (b *bcsgdWorkload) LoadImageBeforeUpdate(ar v1beta1.AdmissionReview) *v1bet
// user request during image loading
// caculate diff between new and old's imageUpdateAnno
// patch imageUpdateAnno to updateOld, then diff new and updateOld
updateOld, err := applyPatch(oldGD, updatePatch)
updateOld, err := applyPatchToGD(oldGD, updatePatch)
if err != nil {
blog.Errorf("apply patch %s to bcsgd failed: %v", updatePatch, oldGD)
return toAdmissionResponse(err)
Expand Down Expand Up @@ -295,7 +295,7 @@ func (b *bcsgdWorkload) JobDoneHook(namespace, name string, event *corev1.Event)
return nil
}

func applyPatch(old *tkexv1alpha1.GameDeployment, patch string) (*tkexv1alpha1.GameDeployment, error) {
func applyPatchToGD(old *tkexv1alpha1.GameDeployment, patch string) (*tkexv1alpha1.GameDeployment, error) {
updateOld := &tkexv1alpha1.GameDeployment{}
// transfer old object to json
oldJS, err := runtime.Encode(bcsCodec, old)
Expand Down

0 comments on commit 541cb77

Please sign in to comment.