Skip to content

Commit

Permalink
replace 3rd party deepcopy with k8s native
Browse files Browse the repository at this point in the history
  • Loading branch information
lwolf committed Apr 14, 2018
1 parent e87e725 commit 9fff8e0
Show file tree
Hide file tree
Showing 2 changed files with 23 additions and 3 deletions.
22 changes: 22 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,20 @@ Kubereplay aims to make integration of [Goreplay](https://github.com/buger/gorep

This is an early alpha version. It is *not* meant to run in production.

# About

Kubereplay is Kubernetes add-on to automate capturing and redirection of traffic using [Goreplay](https://github.com/buger/goreplay).
It consist of 2 parts that need to run in the cluster - controller-manager and initializer-controller.

## How it works:

Kubereplay creates and manage 2 CRDs: Harvesters and Refineries.

Harvester - ...

Refinery - ...


# Quickstart

```
Expand Down Expand Up @@ -40,9 +54,17 @@ $ kubectl create -f sample/echoserver.yaml

# Troubleshooting

If you encounter any issues while using Kubereplay, and your issue is not documented, please file an [issue](https://github.com/lwolf/kubereplay/issues).

# Contributing

All kinds of contributions are very much welcome!

* Fork it
* Create your feature branch (git checkout -b my-new-feature)
* Commit your changes (git commit -am 'Added some feature')
* Push to the branch (git push origin my-new-feature)
* Create new Pull Request

# Changelog
The list of [releases](https://github.com/lwolf/kubereplay/releases) is the best place to look for information on changes between releases.
Expand Down
4 changes: 1 addition & 3 deletions cmd/initializer-controller/main.go
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,6 @@ import (
"github.com/lwolf/kubereplay/pkg/client/clientset/versioned"
"github.com/lwolf/kubereplay/pkg/client/informers/externalversions"
kubereplayv1alpha1lister "github.com/lwolf/kubereplay/pkg/client/listers/kubereplay/v1alpha1"
"github.com/mohae/deepcopy"
"k8s.io/api/apps/v1beta1"
corev1 "k8s.io/api/core/v1"
metav1 "k8s.io/apimachinery/pkg/apis/meta/v1"
Expand Down Expand Up @@ -73,8 +72,7 @@ func initializeDeployment(deployment *v1beta1.Deployment, clientset *kubernetes.
if initializerName == pendingInitializers[0].Name {
log.Printf("Initializing deployment: %s", deployment.Name)

green := deepcopy.Copy(deployment)
initializedDeploymentGreen := green.(*v1beta1.Deployment)
initializedDeploymentGreen := deployment.DeepCopy()

// Remove self from the list of pending Initializers while preserving ordering.
if len(pendingInitializers) == 1 {
Expand Down

0 comments on commit 9fff8e0

Please sign in to comment.