This repository has been archived by the owner on Jul 29, 2024. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 11
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
set entire ingress spec to configurable var (#109)
Solves #92
- Loading branch information
1 parent
663949d
commit e0a7641
Showing
12 changed files
with
398 additions
and
4 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,32 @@ | ||
{{/* | ||
Return if ingress is stable. | ||
*/}} | ||
{{- define "rollup.ingress.isStable" -}} | ||
{{- eq (include "rollup.ingress.apiVersion" .) "networking.k8s.io/v1" }} | ||
{{- end }} | ||
|
||
{{/* | ||
Return if ingress supports ingressClassName. | ||
*/}} | ||
{{- define "rollup.ingress.supportsIngressClassName" -}} | ||
{{- or (eq (include "rollup.ingress.isStable" .) "true") (and (eq (include "rollup.ingress.apiVersion" .) "networking.k8s.io/v1beta1") (semverCompare ">= 1.18-0" .Capabilities.KubeVersion.Version)) }} | ||
{{- end }} | ||
|
||
{{/* | ||
Return if ingress supports pathType. | ||
*/}} | ||
{{- define "rollup.ingress.supportsPathType" -}} | ||
{{- or (eq (include "rollup.ingress.isStable" .) "true") (and (eq (include "rollup.ingress.apiVersion" .) "networking.k8s.io/v1beta1") (semverCompare ">= 1.18-0" .Capabilities.KubeVersion.Version)) }} | ||
{{- end }} | ||
|
||
Return the appropriate apiVersion for ingress. | ||
*/}} | ||
{{- define "rollup.ingress.apiVersion" -}} | ||
{{- if and ($.Capabilities.APIVersions.Has "networking.k8s.io/v1") (semverCompare ">= 1.19-0" .Capabilities.KubeVersion.Version) }} | ||
{{- print "networking.k8s.io/v1" }} | ||
{{- else if $.Capabilities.APIVersions.Has "networking.k8s.io/v1beta1" }} | ||
{{- print "networking.k8s.io/v1beta1" }} | ||
{{- else }} | ||
{{- print "extensions/v1beta1" }} | ||
{{- end }} | ||
{{- end }} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,32 @@ | ||
{{/* | ||
Return if ingress is stable. | ||
*/}} | ||
{{- define "sequencer.ingress.isStable" -}} | ||
{{- eq (include "sequencer.ingress.apiVersion" .) "networking.k8s.io/v1" }} | ||
{{- end }} | ||
|
||
{{/* | ||
Return if ingress supports ingressClassName. | ||
*/}} | ||
{{- define "sequencer.ingress.supportsIngressClassName" -}} | ||
{{- or (eq (include "sequencer.ingress.isStable" .) "true") (and (eq (include "sequencer.ingress.apiVersion" .) "networking.k8s.io/v1beta1") (semverCompare ">= 1.18-0" .Capabilities.KubeVersion.Version)) }} | ||
{{- end }} | ||
|
||
{{/* | ||
Return if ingress supports pathType. | ||
*/}} | ||
{{- define "sequencer.ingress.supportsPathType" -}} | ||
{{- or (eq (include "sequencer.ingress.isStable" .) "true") (and (eq (include "sequencer.ingress.apiVersion" .) "networking.k8s.io/v1beta1") (semverCompare ">= 1.18-0" .Capabilities.KubeVersion.Version)) }} | ||
{{- end }} | ||
|
||
Return the appropriate apiVersion for ingress. | ||
*/}} | ||
{{- define "sequencer.ingress.apiVersion" -}} | ||
{{- if and ($.Capabilities.APIVersions.Has "networking.k8s.io/v1") (semverCompare ">= 1.19-0" .Capabilities.KubeVersion.Version) }} | ||
{{- print "networking.k8s.io/v1" }} | ||
{{- else if $.Capabilities.APIVersions.Has "networking.k8s.io/v1beta1" }} | ||
{{- print "networking.k8s.io/v1beta1" }} | ||
{{- else }} | ||
{{- print "extensions/v1beta1" }} | ||
{{- end }} | ||
{{- end }} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,32 @@ | ||
{{/* | ||
Return if ingress is stable. | ||
*/}} | ||
{{- define "sequencer.ingress.isStable" -}} | ||
{{- eq (include "sequencer.ingress.apiVersion" .) "networking.k8s.io/v1" }} | ||
{{- end }} | ||
|
||
{{/* | ||
Return if ingress supports ingressClassName. | ||
*/}} | ||
{{- define "sequencer.ingress.supportsIngressClassName" -}} | ||
{{- or (eq (include "sequencer.ingress.isStable" .) "true") (and (eq (include "sequencer.ingress.apiVersion" .) "networking.k8s.io/v1beta1") (semverCompare ">= 1.18-0" .Capabilities.KubeVersion.Version)) }} | ||
{{- end }} | ||
|
||
{{/* | ||
Return if ingress supports pathType. | ||
*/}} | ||
{{- define "sequencer.ingress.supportsPathType" -}} | ||
{{- or (eq (include "sequencer.ingress.isStable" .) "true") (and (eq (include "sequencer.ingress.apiVersion" .) "networking.k8s.io/v1beta1") (semverCompare ">= 1.18-0" .Capabilities.KubeVersion.Version)) }} | ||
{{- end }} | ||
|
||
Return the appropriate apiVersion for ingress. | ||
*/}} | ||
{{- define "sequencer.ingress.apiVersion" -}} | ||
{{- if and ($.Capabilities.APIVersions.Has "networking.k8s.io/v1") (semverCompare ">= 1.19-0" .Capabilities.KubeVersion.Version) }} | ||
{{- print "networking.k8s.io/v1" }} | ||
{{- else if $.Capabilities.APIVersions.Has "networking.k8s.io/v1beta1" }} | ||
{{- print "networking.k8s.io/v1beta1" }} | ||
{{- else }} | ||
{{- print "extensions/v1beta1" }} | ||
{{- end }} | ||
{{- end }} |
Oops, something went wrong.