Skip to content
This repository has been archived by the owner on Nov 6, 2019. It is now read-only.

Don't enforce AvailabilityPolicy. #28

Merged
merged 2 commits into from
May 9, 2018
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 1 addition & 2 deletions pkg/api/v1alpha1/microservice.go
Original file line number Diff line number Diff line change
Expand Up @@ -47,8 +47,7 @@ var MicroserviceValidationSchema = &v1beta1.CustomResourceValidation{
"spec": {
Required: []string{"imagePolicy"},
Properties: map[string]v1beta1.JSONSchemaProps{
"imagePolicy": requiredObjectReference,
"availabilityPolicy": requiredObjectReference,
"imagePolicy": requiredObjectReference,
},
},
"status": ReleaseValidationSchema,
Expand Down
50 changes: 33 additions & 17 deletions pkg/api/v1alpha1/zz_generated.go
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@ OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*/

// Code generated by deepcopy-gen. DO NOT EDIT.
// This file was autogenerated by deepcopy-gen. Do not edit it manually!

package v1alpha1

Expand Down Expand Up @@ -67,8 +67,9 @@ func (in *AvailabilityPolicy) DeepCopy() *AvailabilityPolicy {
func (in *AvailabilityPolicy) DeepCopyObject() runtime.Object {
if c := in.DeepCopy(); c != nil {
return c
} else {
return nil
}
return nil
}

// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.
Expand Down Expand Up @@ -100,8 +101,9 @@ func (in *AvailabilityPolicyList) DeepCopy() *AvailabilityPolicyList {
func (in *AvailabilityPolicyList) DeepCopyObject() runtime.Object {
if c := in.DeepCopy(); c != nil {
return c
} else {
return nil
}
return nil
}

// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.
Expand Down Expand Up @@ -181,8 +183,9 @@ func (in *ConfigPolicy) DeepCopy() *ConfigPolicy {
func (in *ConfigPolicy) DeepCopyObject() runtime.Object {
if c := in.DeepCopy(); c != nil {
return c
} else {
return nil
}
return nil
}

// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.
Expand Down Expand Up @@ -214,8 +217,9 @@ func (in *ConfigPolicyList) DeepCopy() *ConfigPolicyList {
func (in *ConfigPolicyList) DeepCopyObject() runtime.Object {
if c := in.DeepCopy(); c != nil {
return c
} else {
return nil
}
return nil
}

// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.
Expand Down Expand Up @@ -319,8 +323,9 @@ func (in *ImagePolicy) DeepCopy() *ImagePolicy {
func (in *ImagePolicy) DeepCopyObject() runtime.Object {
if c := in.DeepCopy(); c != nil {
return c
} else {
return nil
}
return nil
}

// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.
Expand Down Expand Up @@ -352,8 +357,9 @@ func (in *ImagePolicyList) DeepCopy() *ImagePolicyList {
func (in *ImagePolicyList) DeepCopyObject() runtime.Object {
if c := in.DeepCopy(); c != nil {
return c
} else {
return nil
}
return nil
}

// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.
Expand Down Expand Up @@ -466,8 +472,9 @@ func (in *Microservice) DeepCopy() *Microservice {
func (in *Microservice) DeepCopyObject() runtime.Object {
if c := in.DeepCopy(); c != nil {
return c
} else {
return nil
}
return nil
}

// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.
Expand Down Expand Up @@ -499,8 +506,9 @@ func (in *MicroserviceList) DeepCopy() *MicroserviceList {
func (in *MicroserviceList) DeepCopyObject() runtime.Object {
if c := in.DeepCopy(); c != nil {
return c
} else {
return nil
}
return nil
}

// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.
Expand Down Expand Up @@ -569,8 +577,9 @@ func (in *NetworkPolicy) DeepCopy() *NetworkPolicy {
func (in *NetworkPolicy) DeepCopyObject() runtime.Object {
if c := in.DeepCopy(); c != nil {
return c
} else {
return nil
}
return nil
}

// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.
Expand Down Expand Up @@ -602,8 +611,9 @@ func (in *NetworkPolicyList) DeepCopy() *NetworkPolicyList {
func (in *NetworkPolicyList) DeepCopyObject() runtime.Object {
if c := in.DeepCopy(); c != nil {
return c
} else {
return nil
}
return nil
}

// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.
Expand Down Expand Up @@ -714,8 +724,9 @@ func (in *SecurityPolicy) DeepCopy() *SecurityPolicy {
func (in *SecurityPolicy) DeepCopyObject() runtime.Object {
if c := in.DeepCopy(); c != nil {
return c
} else {
return nil
}
return nil
}

// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.
Expand Down Expand Up @@ -747,8 +758,9 @@ func (in *SecurityPolicyList) DeepCopy() *SecurityPolicyList {
func (in *SecurityPolicyList) DeepCopyObject() runtime.Object {
if c := in.DeepCopy(); c != nil {
return c
} else {
return nil
}
return nil
}

// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.
Expand Down Expand Up @@ -865,8 +877,9 @@ func (in *VersionedMicroservice) DeepCopy() *VersionedMicroservice {
func (in *VersionedMicroservice) DeepCopyObject() runtime.Object {
if c := in.DeepCopy(); c != nil {
return c
} else {
return nil
}
return nil
}

// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.
Expand Down Expand Up @@ -898,8 +911,9 @@ func (in *VersionedMicroserviceList) DeepCopy() *VersionedMicroserviceList {
func (in *VersionedMicroserviceList) DeepCopyObject() runtime.Object {
if c := in.DeepCopy(); c != nil {
return c
} else {
return nil
}
return nil
}

// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.
Expand Down Expand Up @@ -975,8 +989,9 @@ func (in *VersioningPolicy) DeepCopy() *VersioningPolicy {
func (in *VersioningPolicy) DeepCopyObject() runtime.Object {
if c := in.DeepCopy(); c != nil {
return c
} else {
return nil
}
return nil
}

// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.
Expand Down Expand Up @@ -1008,8 +1023,9 @@ func (in *VersioningPolicyList) DeepCopy() *VersioningPolicyList {
func (in *VersioningPolicyList) DeepCopyObject() runtime.Object {
if c := in.DeepCopy(); c != nil {
return c
} else {
return nil
}
return nil
}

// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.
Expand Down
4 changes: 4 additions & 0 deletions pkg/networkpolicy/controller.go
Original file line number Diff line number Diff line change
Expand Up @@ -109,6 +109,10 @@ func (c *Controller) syncNetworking(obj interface{}) error {
}
}

if len(releaseGroups) == 0 {
log.Printf("No release groups to sync")
}

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

want to keep this?

return nil
}

Expand Down
5 changes: 5 additions & 0 deletions pkg/networkpolicy/ingress.go
Original file line number Diff line number Diff line change
Expand Up @@ -42,6 +42,11 @@ func buildIngressForRelease(ms *v1alpha1.Microservice, np *v1alpha1.NetworkPolic
// TODO (jelmer): different TTLs should mean different Ingresses
annotations["external-dns.alpha.kubernetes.io/ttl"] = ttlValue(np.Spec.ExternalDNS[0].TTL)

// Disable SSL redirects when we don't have TLS enabled.
if np.Spec.ExternalDNS[0].DisableTLS {
annotations["nginx.ingress.kubernetes.io/ssl-redirect"] = "false"
}

ingressTLS, err := getIngressTLS(ms, release, np.Spec.ExternalDNS)
if err != nil {
return nil, err
Expand Down