-
Notifications
You must be signed in to change notification settings - Fork 203
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
MAJOR: crd: add v1 crd and deprecate alpha2
with this change, v1 of backends, defaults and global are introduced, and at the same time alpha2 versions are deprecated Co-authored-by: Helene Durand <[email protected]>
- Loading branch information
1 parent
72314fd
commit c01d3b3
Showing
137 changed files
with
9,854 additions
and
6,453 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
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,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"` | ||
} |
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,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"` | ||
} |
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,5 @@ | ||
// Package v1 contains the core v1 API group | ||
// | ||
// +k8s:deepcopy-gen=package | ||
// +groupName=ingress.v1.haproxy.org | ||
package v1 |
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,68 @@ | ||
// 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].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"` | ||
} |
Oops, something went wrong.