Skip to content
This repository has been archived by the owner on May 3, 2022. It is now read-only.

Commit

Permalink
fix merge cherry-pick
Browse files Browse the repository at this point in the history
  • Loading branch information
hihilla committed Oct 12, 2020
1 parent 9f00217 commit 2fc229b
Showing 1 changed file with 3 additions and 12 deletions.
15 changes: 3 additions & 12 deletions cmd/shipperctl/configurator/cluster.go
Original file line number Diff line number Diff line change
@@ -1,9 +1,7 @@
package configurator

import (
"encoding/hex"
"fmt"
"hash/crc32"
"time"

certificatesv1beta1 "k8s.io/api/certificates/v1beta1"
Expand Down Expand Up @@ -184,17 +182,10 @@ func (c *Cluster) FetchCluster(clusterName string) (*shipper.Cluster, error) {
}

func (c *Cluster) CopySecret(cluster *shipper.Cluster, newNamespace string, secret *corev1.Secret) error {
hash := crc32.NewIEEE()
hash.Write(secret.Data["ca.crt"])
hash.Write(secret.Data["token"])

newSecret := &corev1.Secret{
ObjectMeta: metav1.ObjectMeta{
Name: cluster.Name,
Namespace: newNamespace,
Annotations: map[string]string{
shipper.SecretChecksumAnnotation: hex.EncodeToString(hash.Sum(nil)),
},
OwnerReferences: []metav1.OwnerReference{
metav1.OwnerReference{
APIVersion: "shipper.booking.com/v1",
Expand Down Expand Up @@ -254,17 +245,17 @@ func NewClusterConfiguratorFromKubeConfig(kubeConfigFile, context string) (*Clus
}

func NewClusterConfigurator(restConfig *rest.Config) (*Cluster, error) {
clientset, err := client.NewKubeClient(AgentName, restConfig)
clientset, err := client.NewKubeClient(restConfig, AgentName, nil)
if err != nil {
return nil, err
}

shipperClient, err := client.NewShipperClient(AgentName, restConfig)
shipperClient, err := client.NewShipperClient(restConfig, AgentName, nil)
if err != nil {
return nil, err
}

apiExtensionClient, err := client.NewApiExtensionClient(AgentName, restConfig)
apiExtensionClient, err := client.NewApiExtensionClient(restConfig, AgentName, nil)
if err != nil {
return nil, err
}
Expand Down

0 comments on commit 2fc229b

Please sign in to comment.