Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix Control Ingress Creation #783

Open
wants to merge 3 commits into
base: master
Choose a base branch
from
Open
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
2 changes: 1 addition & 1 deletion charts/apisix/templates/ingress-control.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@

{{- if (and .Values.control.enabled .Values.control.ingress.enabled) -}}
{{- $fullName := include "apisix.fullname" . -}}
{{- $svcPort := .Values.control.servicePort -}}
{{- $svcPort := .Values.control.service.servicePort -}}
{{- if and .Values.control.ingress.className (not (semverCompare ">=1.18-0" .Capabilities.KubeVersion.GitVersion)) }}
{{- if not (hasKey .Values.control.ingress.annotations "kubernetes.io/ingress.class") }}
{{- $_ := set .Values.control.ingress.annotations "kubernetes.io/ingress.class" .Values.control.ingress.className}}
Expand Down
2 changes: 1 addition & 1 deletion charts/apisix/templates/service-control.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.
{{ if (and .Values.apisix.enabled .Values.control.enabled) }}
{{ if .Values.control.enabled }}
apiVersion: v1
kind: Service
metadata:
Expand Down
20 changes: 20 additions & 0 deletions charts/apisix/tests/ingress-control_test.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
suite: Control Ingress Configuation
templates:
- ingress-control.yaml
tests:
- it: should be disabled by default
asserts:
- hasDocuments:
count: 0
- it: should provide a working Ingress when enabled
set:
control:
ingress:
enabled: true
asserts:
- containsDocument:
kind: Ingress
apiVersion: networking.k8s.io/v1
- equal:
path: spec.rules[0].http.paths[0].backend.service.port.number
value: 9090