Skip to content
Permalink
Browse files

- Changed the deployment and service and the bash script to work with

  names similar to the ones created by shipperctl. This is meant to be
  a half fix for #74.
- Fixed the issues raised by @icanhazbroccoli
  • Loading branch information...
parhamdoustdar committed Mar 19, 2019
1 parent 674694b commit ad05272e49e5374e7c53e72531b53411b4ff69c5
@@ -16,7 +16,7 @@ shipper-state-metrics:
restart:
# Delete all Pods in namespace, to force the ReplicaSet to spawn new ones
# with the new latest image (assuming that imagePullPolicy is set to Always).
$(KUBECTL) delete po --all
$(KUBECTL) delete pods --all

certs:
./hack/webhook/webhook-create-signed-cert.sh --namespace $(SHIPPER_NAMESPACE)
@@ -17,8 +17,8 @@ while [[ $# -gt 0 ]]; do
shift
done

[[ -z ${service} ]] && service=shipper-webhook-svc
[[ -z ${secret} ]] && secret=shipper-webhook-certs
[[ -z ${service} ]] && service=shipper-validating-webhook
[[ -z ${secret} ]] && secret=shipper-validating-webhook
[[ -z ${namespace} ]] && namespace=shipper-system

csrName=${service}.${namespace}
@@ -20,9 +20,9 @@ spec:
imagePullPolicy: Always
args:
- "-webhook-cert"
- "/etc/webhook/certs/cert.pem"
- "/etc/webhook/certs/tls.crt"
- "-webhook-key"
- "/etc/webhook/certs/key.pem"
- "/etc/webhook/certs/tls.key"
- "-webhook-port"
- "9443"
ports:
@@ -34,4 +34,4 @@ spec:
volumes:
- name: webhook-certs
secret:
secretName: shipper-webhook-certs
secretName: shipper-validating-webhook
@@ -1,7 +1,7 @@
apiVersion: v1
kind: Service
metadata:
name: shipper-webhook-svc
name: shipper-validating-webhook
namespace: shipper-system
labels:
app: shipper
@@ -14,7 +14,7 @@ import (
"k8s.io/apimachinery/pkg/runtime"
"k8s.io/apimachinery/pkg/runtime/serializer"

shipper_v1alpha1 "github.com/bookingcom/shipper/pkg/apis/shipper/v1alpha1"
shipper "github.com/bookingcom/shipper/pkg/apis/shipper/v1alpha1"
)

type Controller struct {
@@ -137,22 +137,22 @@ func (c *Controller) validateHandlerFunc(review *admission_v1beta1.AdmissionRevi

switch request.Kind.Kind {
case "Application":
var application shipper_v1alpha1.Application
var application shipper.Application
err = json.Unmarshal(request.Object.Raw, &application)
case "Release":
var release shipper_v1alpha1.Release
var release shipper.Release
err = json.Unmarshal(request.Object.Raw, &release)
case "Cluster":
var cluster shipper_v1alpha1.Cluster
var cluster shipper.Cluster
err = json.Unmarshal(request.Object.Raw, &cluster)
case "InstallationTarget":
var installationTarget shipper_v1alpha1.InstallationTarget
var installationTarget shipper.InstallationTarget
err = json.Unmarshal(request.Object.Raw, &installationTarget)
case "CapacityTarget":
var capacityTarget shipper_v1alpha1.CapacityTarget
var capacityTarget shipper.CapacityTarget
err = json.Unmarshal(request.Object.Raw, &capacityTarget)
case "TrafficTarget":
var trafficTarget shipper_v1alpha1.TrafficTarget
var trafficTarget shipper.TrafficTarget
err = json.Unmarshal(request.Object.Raw, &trafficTarget)
}

0 comments on commit ad05272

Please sign in to comment.
You can’t perform that action at this time.