Skip to content

Apiv1beta1 #2

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

Merged
merged 38 commits into from
Jan 30, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
38 commits
Select commit Hold shift + click to select a range
2b7484e
BUG/MINOR: prevents port conflicts on startup when using hostNetwork
fabianonunes Sep 5, 2023
a538809
BUILD/MINOR: go.mod: update golang.org/x packages
Oct 10, 2023
2f4e14f
BUILD/MINOR: go.mod: update k8s.io packages
Oct 10, 2023
cf7dae5
BUILD/MEDIUM: github: use latest patch version of go
oktalz Oct 11, 2023
857d0f8
MINOR: add transactionID in all logs
hdurand0710 Oct 10, 2023
f39d5c8
BUG/MINOR: fix logic for detecting updates on namespace events
hdurand0710 Oct 30, 2023
798e3f6
BUG/MINOR: revert changes in EventPublishService done in commit f39d5…
hdurand0710 Oct 31, 2023
f329042
BUG: propagate the Ingress Controller LB external address to all ingr…
hdurand0710 Oct 30, 2023
302a139
MINOR: ensure both ClusterIP and ExternalIPs are added in publish ser…
hdurand0710 Nov 3, 2023
6ddc870
DOC: document incompatibilty between route-acl annotation and multipl…
hdurand0710 Nov 8, 2023
bc89768
MINOR: add reload/restart configuration manager
ivanmatmati Nov 6, 2023
9572d4d
MINOR: various logger amendments
ivanmatmati Nov 6, 2023
dbf51c4
MINOR: align permissions needed for techdump for consistency
hdurand0710 Nov 7, 2023
dfa899d
MINOR: move version.go to package version
ivanmatmati Nov 13, 2023
b0fb94e
BUILD/MINOR: go.mod: update golang.org/x packages
Nov 13, 2023
d7c0024
BUILD/MINOR: go.mod: update k8s.io packages
Nov 13, 2023
312e53a
MAJOR: crd: add job for custom resource definition handling
oktalz Nov 6, 2023
f37b279
BUILD/MINOR: ci: increase timeout for golang linters
oktalz Nov 6, 2023
8cd1851
BUILD/MINOR: update commit commit check tool
oktalz Nov 6, 2023
0a82ea7
BUG/MINOR: logs: do not add brackets to logs that do not have any labels
oktalz Nov 6, 2023
9e83018
BUG: fix cluster ip from publish service
ivanmatmati Dec 7, 2023
17ea85e
TEST: make access control e2e tests more robust
hdurand0710 Dec 5, 2023
d421ee3
BUG: recovers global and frontend config snippets after a faulty tran…
ivanmatmati Nov 30, 2023
72314fd
BUG/MINOR: fix panic in Global CR DeepCopy
hdurand0710 Dec 15, 2023
c01d3b3
MAJOR: crd: add v1 crd and deprecate alpha2
oktalz Dec 1, 2023
f5409a5
BUG/MINOR: fix panic in Global CR DeppCopy for v1
hdurand0710 Dec 18, 2023
9fc8d9c
MINOR: 6060 as default controller port, fix pprof missing in maps, ad…
hdurand0710 Dec 21, 2023
6e27721
BUILD: order api pkgs for code-generator consistency
hdurand0710 Dec 22, 2023
29d6445
MINOR: fix controller-gen version to v0.13.0
hdurand0710 Jan 15, 2024
b133f15
CLEANUP/MINOR: ci: remove deprecated gitlab token usage
oktalz Jan 17, 2024
83dd6ec
TEST: add e2e tests for Global CR
hdurand0710 Jan 8, 2024
7cebb7a
BUG: manage TuneOptions and SSL default dh param
ivanmatmati Jan 8, 2024
f35ac19
MINOR: use copy instead of loops in CRD converters
ivanmatmati Jan 10, 2024
cc6be55
BUG: remove unnecessary reload from handleDefaultService
ivanmatmati Jan 11, 2024
9f9191e
MINOR: add reload in gateway
ivanmatmati Jan 12, 2024
d45dfe4
BUG: fix listner missing on CR if CRDs added after controller startup
hdurand0710 Jan 18, 2024
2d268e3
init removing v1alpha2 deprecated apis
eltorio Jan 30, 2024
ae5b3da
Merge branch 'master' into apiv1beta1
eltorio Jan 30, 2024
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
1 change: 1 addition & 0 deletions .github/workflows/.goreleaser.yml
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,7 @@ jobs:
uses: actions/setup-go@v4
with:
go-version-file: 'go.mod'
check-latest: true
- name: Run GoReleaser
uses: goreleaser/goreleaser-action@v4
with:
Expand Down
8 changes: 7 additions & 1 deletion .github/workflows/actions.yml
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ jobs:
runs-on: ubuntu-latest
steps:
- name: commit-check
uses: docker://ghcr.io/haproxytech/commit-check:3.0.0
uses: docker://ghcr.io/haproxytech/commit-check:3.0.1
env:
API_TOKEN: ${{ secrets.GITHUB_TOKEN }}
generate:
Expand All @@ -23,6 +23,7 @@ jobs:
uses: actions/setup-go@v4
with:
go-version-file: 'go.mod'
check-latest: true
- name: generating documentation
run: cd documentation/gen && go run .
- name: changes
Expand All @@ -39,6 +40,7 @@ jobs:
uses: actions/setup-go@v4
with:
go-version-file: 'go.mod'
check-latest: true
- uses: actions/cache@v2
with:
path: |
Expand All @@ -61,6 +63,7 @@ jobs:
uses: actions/setup-go@v4
with:
go-version-file: 'go.mod'
check-latest: true
- uses: actions/cache@v2
with:
path: |
Expand All @@ -84,6 +87,7 @@ jobs:
uses: actions/setup-go@v4
with:
go-version-file: 'go.mod'
check-latest: true
- uses: actions/cache@v2
with:
path: |
Expand All @@ -106,6 +110,7 @@ jobs:
uses: actions/setup-go@v4
with:
go-version-file: 'go.mod'
check-latest: true
- uses: actions/cache@v2
with:
path: |
Expand Down Expand Up @@ -133,6 +138,7 @@ jobs:
uses: actions/setup-go@v4
with:
go-version-file: 'go.mod'
check-latest: true
- uses: actions/cache@v2
with:
path: |
Expand Down
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -5,3 +5,4 @@ kubernetes-ingress
dist/
.code-generator/
bin/golangci-lint
.local/*
23 changes: 20 additions & 3 deletions .gitlab-ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,23 @@ diff:
script:
- test -z "$(git diff 2> /dev/null)" || exit "Documentation is not generated, issue \`cd documentation/gen && go run .\` and commit the result"
- test -z "$(git ls-files --others --exclude-standard 2> /dev/null)" || exit "Documentation created untracked files, cannot proceed"
diff-crd:
stage: diff
rules:
- if: $CI_PIPELINE_SOURCE == 'merge_request_event'
- if: $CI_PIPELINE_SOURCE == 'push'
image:
name: $CI_REGISTRY_GO/golang:$GO_VERSION
entrypoint: [ "" ]
tags:
- go
before_script:
- go version
- make cr_generate
script:
- git diff
- test -z "$(git diff 2> /dev/null)" || exit "CRD generation was not generated, issue \`make cr_generate\` and commit the result"
- test -z "$(git ls-files --others --exclude-standard 2> /dev/null)" || exit "CRD generation created untracked files, cannot proceed"
tidy:
stage: lint
needs: []
Expand Down Expand Up @@ -108,7 +125,7 @@ docker-build:
tags:
- go
before_script:
- docker login -u gitlab-ci-token -p $CI_BUILD_TOKEN $CI_REGISTRY_GO
- docker login -u gitlab-ci-token -p $CI_JOB_TOKEN $CI_REGISTRY_GO
- go version
- docker pull -q $CI_REGISTRY_GO/alpine:3
- docker image tag $CI_REGISTRY_GO/alpine:3 alpine:3
Expand Down Expand Up @@ -137,7 +154,7 @@ docker-build-sch:
tags:
- go
before_script:
- docker login -u gitlab-ci-token -p $CI_BUILD_TOKEN $CI_REGISTRY_GO
- docker login -u gitlab-ci-token -p $CI_JOB_TOKEN $CI_REGISTRY_GO
- go version
- docker pull -q $CI_REGISTRY_GO/alpine:3
- docker image tag $CI_REGISTRY_GO/alpine:3 alpine:3
Expand Down Expand Up @@ -174,7 +191,7 @@ docker-build-sch:
exclude:
- tar/*
before_script:
- docker login -u gitlab-ci-token -p $CI_BUILD_TOKEN $CI_REGISTRY_GO
- docker login -u gitlab-ci-token -p $CI_JOB_TOKEN $CI_REGISTRY_GO
- docker load -i tar/k8sIC.tar
- go version
- go mod download &
Expand Down
4 changes: 1 addition & 3 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ doc:
.PHONY: lint
lint:
cd bin;GOLANGCI_LINT_VERSION=${GOLANGCI_LINT_VERSION} sh lint-check.sh
bin/golangci-lint run --timeout 5m --color always --max-issues-per-linter 0 --max-same-issues 0
bin/golangci-lint run --timeout 10m --color always --max-issues-per-linter 0 --max-same-issues 0

.PHONY: yaml-lint
yaml-lint:
Expand Down Expand Up @@ -78,8 +78,6 @@ publish:
.PHONY: cr_generate
cr_generate:
crs/code-generator.sh
grep -lir defaultses crs/* | xargs sed -i 's/Defaultses/Defaults/g'
grep -lir defaultses crs/* | xargs sed -i 's/defaultses/defaults/g'

.PHONY: gofumpt
gofumpt:
Expand Down
2 changes: 1 addition & 1 deletion build/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@ RUN mkdir -p /var/run/vars && \
git diff --quiet > /var/run/vars/GIT_MODIFIED2 || echo '.dirty' > /var/run/vars/GIT_MODIFIED2 && \
cat /var/run/vars/GIT_MODIFIED1 /var/run/vars/GIT_MODIFIED2 | tr -d '\n' > /var/run/vars/GIT_MODIFIED && \
CGO_ENABLED=0 go build \
-ldflags "-X main.GitRepo=$(cat /var/run/vars/GIT_REPO) -X main.GitTag=$(cat /var/run/vars/GIT_LAST_TAG) -X main.GitCommit=$(cat /var/run/vars/GIT_HEAD_COMMIT) -X main.GitDirty=$(cat /var/run/vars/GIT_MODIFIED) -X \"main.GitCommitDate=$(cat /var/run/vars/GIT_DATE_LAST_COMMIT)\"" \
-ldflags "-X pkg.version.GitRepo=$(cat /var/run/vars/GIT_REPO) -X pkg.version.GitTag=$(cat /var/run/vars/GIT_LAST_TAG) -X pkg.version.GitCommit=$(cat /var/run/vars/GIT_HEAD_COMMIT) -X pkg.version.GitDirty=$(cat /var/run/vars/GIT_MODIFIED) -X \"pkg.version.GitCommitDate=$(cat /var/run/vars/GIT_DATE_LAST_COMMIT)\"" \
-o fs/haproxy-ingress-controller .

FROM haproxytech/haproxy-alpine:2.8
Expand Down
2 changes: 1 addition & 1 deletion build/Dockerfile.pebble
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@ RUN mkdir -p /var/run/vars && \
git diff --quiet > /var/run/vars/GIT_MODIFIED2 || echo '.dirty' > /var/run/vars/GIT_MODIFIED2 && \
cat /var/run/vars/GIT_MODIFIED1 /var/run/vars/GIT_MODIFIED2 | tr -d '\n' > /var/run/vars/GIT_MODIFIED && \
CGO_ENABLED=0 go build \
-ldflags "-X main.GitRepo=$(cat /var/run/vars/GIT_REPO) -X main.GitTag=$(cat /var/run/vars/GIT_LAST_TAG) -X main.GitCommit=$(cat /var/run/vars/GIT_HEAD_COMMIT) -X main.GitDirty=$(cat /var/run/vars/GIT_MODIFIED) -X \"main.GitCommitDate=$(cat /var/run/vars/GIT_DATE_LAST_COMMIT)\"" \
-ldflags "-X pkg.version.GitRepo=$(cat /var/run/vars/GIT_REPO) -X pkg.version.GitTag=$(cat /var/run/vars/GIT_LAST_TAG) -X pkg.version.GitCommit=$(cat /var/run/vars/GIT_HEAD_COMMIT) -X pkg.version.GitDirty=$(cat /var/run/vars/GIT_MODIFIED) -X \"pkg.version.GitCommitDate=$(cat /var/run/vars/GIT_DATE_LAST_COMMIT)\"" \
-o fs/haproxy-ingress-controller .

FROM haproxytech/haproxy-alpine:2.8
Expand Down
1 change: 1 addition & 0 deletions crs/api/core/v1alpha1/global.go
Original file line number Diff line number Diff line change
Expand Up @@ -47,6 +47,7 @@ func (in *GlobalSpec) DeepCopyInto(out *GlobalSpec) {
out.LogTargets = make([]*models.LogTarget, len(in.LogTargets))
for i, v := range in.LogTargets {
b, _ := v.MarshalBinary()
out.LogTargets[i] = &models.LogTarget{}
_ = out.LogTargets[i].UnmarshalBinary(b)
}
}
Expand Down
1 change: 1 addition & 0 deletions crs/api/core/v1alpha2/global.go
Original file line number Diff line number Diff line change
Expand Up @@ -47,6 +47,7 @@ func (in *GlobalSpec) DeepCopyInto(out *GlobalSpec) {
out.LogTargets = make([]*models.LogTarget, len(in.LogTargets))
for i, v := range in.LogTargets {
b, _ := v.MarshalBinary()
out.LogTargets[i] = &models.LogTarget{}
_ = out.LogTargets[i].UnmarshalBinary(b)
}
}
Expand Down
56 changes: 56 additions & 0 deletions crs/api/ingress/v1/backend.go
Original file line number Diff line number Diff line change
@@ -0,0 +1,56 @@
// Copyright 2019 HAProxy Technologies
//
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
// You may obtain a copy of the License at
//
// http://www.apache.org/licenses/LICENSE-2.0
//
// Unless required by applicable law or agreed to in writing, software
// distributed under the License is distributed on an "AS IS" BASIS,
// 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.
//

package v1

import (
"github.com/haproxytech/client-native/v5/models"
metav1 "k8s.io/apimachinery/pkg/apis/meta/v1"
)

// +genclient
// +k8s:deepcopy-gen:interfaces=k8s.io/apimachinery/pkg/runtime.Object
// +kubebuilder:metadata:annotations="haproxy.org/client-native=v5.0.3"

// Backend is a specification for a Backend resource
type Backend struct {
Spec BackendSpec `json:"spec"`
metav1.TypeMeta `json:",inline"`
metav1.ObjectMeta `json:"metadata,omitempty"`
}

// BackendSpec defines the desired state of Backend
type BackendSpec struct {
Config *models.Backend `json:"config"`
}

// DeepCopyInto deepcopying the receiver into out. in must be non-nil.
func (in *BackendSpec) DeepCopyInto(out *BackendSpec) {
*out = *in
if in.Config != nil {
b, _ := in.Config.MarshalBinary()
_ = out.Config.UnmarshalBinary(b)
}
}

// +k8s:deepcopy-gen:interfaces=k8s.io/apimachinery/pkg/runtime.Object

// BackendList is a list of Backend resources
type BackendList struct {
metav1.TypeMeta `json:",inline"`
metav1.ListMeta `json:"metadata"`

Items []Backend `json:"items"`
}
56 changes: 56 additions & 0 deletions crs/api/ingress/v1/defaults.go
Original file line number Diff line number Diff line change
@@ -0,0 +1,56 @@
// Copyright 2019 HAProxy Technologies
//
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
// You may obtain a copy of the License at
//
// http://www.apache.org/licenses/LICENSE-2.0
//
// Unless required by applicable law or agreed to in writing, software
// distributed under the License is distributed on an "AS IS" BASIS,
// 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.
//

package v1

import (
"github.com/haproxytech/client-native/v5/models"
metav1 "k8s.io/apimachinery/pkg/apis/meta/v1"
)

// +genclient
// +k8s:deepcopy-gen:interfaces=k8s.io/apimachinery/pkg/runtime.Object
// +kubebuilder:metadata:annotations="haproxy.org/client-native=v5.0.3"

// Defaults is a specification for a Defaults resource
type Defaults struct {
Spec DefaultsSpec `json:"spec"`
metav1.TypeMeta `json:",inline"`
metav1.ObjectMeta `json:"metadata,omitempty"`
}

// DefaultsSpec defines the desired state of Defaults
type DefaultsSpec struct {
Config *models.Defaults `json:"config"`
}

// DeepCopyInto deepcopying the receiver into out. in must be non-nil.
func (in *DefaultsSpec) DeepCopyInto(out *DefaultsSpec) {
*out = *in
if in.Config != nil {
b, _ := in.Config.MarshalBinary()
_ = out.Config.UnmarshalBinary(b)
}
}

// +k8s:deepcopy-gen:interfaces=k8s.io/apimachinery/pkg/runtime.Object

// DefaultsList is a list of Defaults resources
type DefaultsList struct {
metav1.TypeMeta `json:",inline"`
metav1.ListMeta `json:"metadata"`

Items []Defaults `json:"items"`
}
5 changes: 5 additions & 0 deletions crs/api/ingress/v1/doc.go
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
// Package v1 contains the core v1 API group
//
// +k8s:deepcopy-gen=package
// +groupName=ingress.v1.haproxy.org
package v1
69 changes: 69 additions & 0 deletions crs/api/ingress/v1/global.go
Original file line number Diff line number Diff line change
@@ -0,0 +1,69 @@
// Copyright 2019 HAProxy Technologies
//
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
// You may obtain a copy of the License at
//
// http://www.apache.org/licenses/LICENSE-2.0
//
// Unless required by applicable law or agreed to in writing, software
// distributed under the License is distributed on an "AS IS" BASIS,
// 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.
//

package v1

import (
"github.com/haproxytech/client-native/v5/models"
metav1 "k8s.io/apimachinery/pkg/apis/meta/v1"
)

// +genclient
// +k8s:deepcopy-gen:interfaces=k8s.io/apimachinery/pkg/runtime.Object
// +kubebuilder:metadata:annotations="haproxy.org/client-native=v5.0.3"
// +kubebuilder:validation:XValidation:rule="!has(self.spec.config.default_path)", message="spec.config.default_path is set by ingress controller internally"
// +kubebuilder:validation:XValidation:rule="!has(self.spec.config.master__dash__worker)", message="spec.config.master-worker is set by ingress controller internally"
// +kubebuilder:validation:XValidation:rule="!has(self.spec.config.pidfile)", message="spec.config.pidfile is set by ingress controller internally"
// +kubebuilder:validation:XValidation:rule="!has(self.spec.config.localpeer)", message="spec.config.localpeer is set by ingress controller internally"

// Global is a specification for a Global resource
type Global struct {
metav1.TypeMeta `json:",inline"`
metav1.ObjectMeta `json:"metadata,omitempty"`

Spec GlobalSpec `json:"spec"`
}

// GlobalSpec defines the desired state of Global
type GlobalSpec struct {
Config *models.Global `json:"config"`
LogTargets models.LogTargets `json:"log_targets,omitempty"` //nolint:tagliatelle
}

// DeepCopyInto deepcopying the receiver into out. in must be non-nil.
func (in *GlobalSpec) DeepCopyInto(out *GlobalSpec) {
if in.Config != nil {
b, _ := in.Config.MarshalBinary()
_ = out.Config.UnmarshalBinary(b)
}
if in.LogTargets != nil {
out.LogTargets = make([]*models.LogTarget, len(in.LogTargets))
for i, v := range in.LogTargets {
b, _ := v.MarshalBinary()
out.LogTargets[i] = &models.LogTarget{}
_ = out.LogTargets[i].UnmarshalBinary(b)
}
}
}

// +k8s:deepcopy-gen:interfaces=k8s.io/apimachinery/pkg/runtime.Object

// GlobalList is a list of Global resources
type GlobalList struct {
metav1.TypeMeta `json:",inline"`
metav1.ListMeta `json:"metadata"`

Items []Global `json:"items"`
}
Loading