Skip to content

Commit e11f06a

Browse files
authored
Release 1.4.0 (#65)
New Features: - Added InventoryProfile CRD Bug Fixes: - gogo/protobuf (CVE-2021-3121) vulnerability
1 parent ae4937b commit e11f06a

35 files changed

+2193
-22
lines changed

PROJECT

+18
Original file line numberDiff line numberDiff line change
@@ -205,4 +205,22 @@ resources:
205205
kind: NatMeta
206206
path: github.com/netrisai/netris-operator/api/v1alpha1
207207
version: v1alpha1
208+
- api:
209+
crdVersion: v1
210+
namespaced: true
211+
controller: true
212+
domain: netris.ai
213+
group: k8s
214+
kind: InventoryProfile
215+
path: github.com/netrisai/netris-operator/api/v1alpha1
216+
version: v1alpha1
217+
- api:
218+
crdVersion: v1
219+
namespaced: true
220+
controller: true
221+
domain: netris.ai
222+
group: k8s
223+
kind: InventoryProfileMeta
224+
path: github.com/netrisai/netris-operator/api/v1alpha1
225+
version: v1alpha1
208226
version: "3"
+102
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,102 @@
1+
/*
2+
Copyright 2021. Netris, Inc.
3+
4+
Licensed under the Apache License, Version 2.0 (the "License");
5+
you may not use this file except in compliance with the License.
6+
You may obtain a copy of the License at
7+
8+
http://www.apache.org/licenses/LICENSE-2.0
9+
10+
Unless required by applicable law or agreed to in writing, software
11+
distributed under the License is distributed on an "AS IS" BASIS,
12+
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13+
See the License for the specific language governing permissions and
14+
limitations under the License.
15+
*/
16+
17+
package v1alpha1
18+
19+
import (
20+
metav1 "k8s.io/apimachinery/pkg/apis/meta/v1"
21+
)
22+
23+
// EDIT THIS FILE! THIS IS SCAFFOLDING FOR YOU TO OWN!
24+
// NOTE: json tags are required. Any new fields you add must have json tags for the fields to be serialized.
25+
26+
// InventoryProfileSpec defines the desired state of InventoryProfile
27+
type InventoryProfileSpec struct {
28+
Description string `json:"description,omitempty"`
29+
30+
Timezone string `json:"timezone,omitempty"`
31+
32+
AllowSSHFromIPv4 []string `json:"allowSshFromIpv4"`
33+
AllowSSHFromIPv6 []string `json:"allowSshFromIpv6,omitempty"`
34+
NTPServers []NTPServer `json:"ntpServers,omitempty"`
35+
DNSServers []DNSServer `json:"dnsServers,omitempty"`
36+
CustomRules []InventoryProfileCustomRule `json:"customRules,omitempty"`
37+
}
38+
39+
type InventoryProfileCustomRule struct {
40+
// +kubebuilder:validation:Pattern=`(^(25[0-5]|2[0-4][0-9]|[01]?[0-9][0-9]?)\.(25[0-5]|2[0-4][0-9]|[01]?[0-9][0-9]?)\.(25[0-5]|2[0-4][0-9]|[01]?[0-9][0-9]?)\.(25[0-5]|2[0-4][0-9]|[01]?[0-9][0-9]?)(\/([0-9]|[12]\d|3[0-2]))?$)|(^((([0-9A-Fa-f]{1,4}:){7}([0-9A-Fa-f]{1,4}|:))|(([0-9A-Fa-f]{1,4}:){6}(:[0-9A-Fa-f]{1,4}|((25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)(\.(25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)){3})|:))|(([0-9A-Fa-f]{1,4}:){5}(((:[0-9A-Fa-f]{1,4}){1,2})|:((25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)(\.(25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)){3})|:))|(([0-9A-Fa-f]{1,4}:){4}(((:[0-9A-Fa-f]{1,4}){1,3})|((:[0-9A-Fa-f]{1,4})?:((25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)(\.(25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)){3}))|:))|(([0-9A-Fa-f]{1,4}:){3}(((:[0-9A-Fa-f]{1,4}){1,4})|((:[0-9A-Fa-f]{1,4}){0,2}:((25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)(\.(25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)){3}))|:))|(([0-9A-Fa-f]{1,4}:){2}(((:[0-9A-Fa-f]{1,4}){1,5})|((:[0-9A-Fa-f]{1,4}){0,3}:((25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)(\.(25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)){3}))|:))|(([0-9A-Fa-f]{1,4}:){1}(((:[0-9A-Fa-f]{1,4}){1,6})|((:[0-9A-Fa-f]{1,4}){0,4}:((25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)(\.(25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)){3}))|:))|(:(((:[0-9A-Fa-f]{1,4}){1,7})|((:[0-9A-Fa-f]{1,4}){0,5}:((25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)(\.(25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)){3}))|:)))(%.+)?(\/([0-9]{1,2}|1[01][0-9]|12[0-8]))?$)`
41+
SrcSubnet string `json:"srcSubnet"`
42+
43+
// +kubebuilder:validation:Pattern=`^()([1-9]|[1-5]?[0-9]{2,4}|6[1-4][0-9]{3}|65[1-4][0-9]{2}|655[1-2][0-9]|6553[1-5])$`
44+
SrcPort string `json:"srcPort,omitempty"`
45+
46+
// +kubebuilder:validation:Pattern=`^()([1-9]|[1-5]?[0-9]{2,4}|6[1-4][0-9]{3}|65[1-4][0-9]{2}|655[1-2][0-9]|6553[1-5])$`
47+
DstPort string `json:"dstPort,omitempty"`
48+
49+
// +kubebuilder:validation:Enum=tcp;udp;any
50+
Protocol string `json:"protocol"`
51+
}
52+
53+
// +kubebuilder:validation:Pattern=`((^(25[0-5]|2[0-4][0-9]|[01]?[0-9][0-9]?)\.(25[0-5]|2[0-4][0-9]|[01]?[0-9][0-9]?)\.(25[0-5]|2[0-4][0-9]|[01]?[0-9][0-9]?)\.(25[0-5]|2[0-4][0-9]|[01]?[0-9][0-9]?)(\/([0-9]|[12]\d|3[0-2]))?$)|(^((([0-9A-Fa-f]{1,4}:){7}([0-9A-Fa-f]{1,4}|:))|(([0-9A-Fa-f]{1,4}:){6}(:[0-9A-Fa-f]{1,4}|((25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)(\.(25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)){3})|:))|(([0-9A-Fa-f]{1,4}:){5}(((:[0-9A-Fa-f]{1,4}){1,2})|:((25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)(\.(25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)){3})|:))|(([0-9A-Fa-f]{1,4}:){4}(((:[0-9A-Fa-f]{1,4}){1,3})|((:[0-9A-Fa-f]{1,4})?:((25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)(\.(25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)){3}))|:))|(([0-9A-Fa-f]{1,4}:){3}(((:[0-9A-Fa-f]{1,4}){1,4})|((:[0-9A-Fa-f]{1,4}){0,2}:((25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)(\.(25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)){3}))|:))|(([0-9A-Fa-f]{1,4}:){2}(((:[0-9A-Fa-f]{1,4}){1,5})|((:[0-9A-Fa-f]{1,4}){0,3}:((25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)(\.(25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)){3}))|:))|(([0-9A-Fa-f]{1,4}:){1}(((:[0-9A-Fa-f]{1,4}){1,6})|((:[0-9A-Fa-f]{1,4}){0,4}:((25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)(\.(25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)){3}))|:))|(:(((:[0-9A-Fa-f]{1,4}){1,7})|((:[0-9A-Fa-f]{1,4}){0,5}:((25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)(\.(25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)){3}))|:)))(%.+)?(\/([0-9]|[1-5][0-9]|6[0-4]))?$)|(^(.{1,22}$)?(([a-z0-9-]{1,63}\.)?(xn--+)?[a-z0-9]+(-[a-z0-9]+)*\.)+[a-z]{2,63}$))`
54+
type NTPServer string
55+
56+
// +kubebuilder:validation:Pattern=`(^(25[0-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\d)){3}))|:))|(:(((:[0-9A-Fa-f]{1,4}){1,7})|((:[0-9A-Fa-f]{1,4}){0,5}:((25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)(\.(25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)){3}))|:)))(%.+)?(\/([0-9]|[1-5][0-9]|6[0-4]))?$)`
57+
type DNSServer string
58+
59+
// InventoryProfileStatus defines the observed state of InventoryProfile
60+
type InventoryProfileStatus struct {
61+
Status string `json:"status,omitempty"`
62+
Message string `json:"message,omitempty"`
63+
IPv4List string `json:"ipv4List,omitempty"`
64+
IPv6List string `json:"ipv6List,omitempty"`
65+
NTPServers string `json:"ntpServers,omitempty"`
66+
DNSServers string `json:"dnsServers,omitempty"`
67+
CustomRules string `json:"customRules,omitempty"`
68+
}
69+
70+
//+kubebuilder:object:root=true
71+
//+kubebuilder:subresource:status
72+
// +kubebuilder:printcolumn:name="Description",type=string,JSONPath=`.spec.description`
73+
// +kubebuilder:printcolumn:name="Timezone",type=string,JSONPath=`.spec.timezone`
74+
// +kubebuilder:printcolumn:name="NTPServers",type=string,JSONPath=`.status.ntpServers`
75+
// +kubebuilder:printcolumn:name="DNSServers",type=string,JSONPath=`.status.dnsServers`
76+
// +kubebuilder:printcolumn:name="IPv4List",type=string,JSONPath=`.status.ipv4List`,priority=1
77+
// +kubebuilder:printcolumn:name="IPv6List",type=string,JSONPath=`.status.ipv6List`,priority=1
78+
// +kubebuilder:printcolumn:name="CustomRules",type=string,JSONPath=`.status.customRules`,priority=1
79+
// +kubebuilder:printcolumn:name="Status",type=string,JSONPath=`.status.status`
80+
// +kubebuilder:printcolumn:name="Age",type=date,JSONPath=`.metadata.creationTimestamp`
81+
82+
// InventoryProfile is the Schema for the inventoryprofiles API
83+
type InventoryProfile struct {
84+
metav1.TypeMeta `json:",inline"`
85+
metav1.ObjectMeta `json:"metadata,omitempty"`
86+
87+
Spec InventoryProfileSpec `json:"spec,omitempty"`
88+
Status InventoryProfileStatus `json:"status,omitempty"`
89+
}
90+
91+
//+kubebuilder:object:root=true
92+
93+
// InventoryProfileList contains a list of InventoryProfile
94+
type InventoryProfileList struct {
95+
metav1.TypeMeta `json:",inline"`
96+
metav1.ListMeta `json:"metadata,omitempty"`
97+
Items []InventoryProfile `json:"items"`
98+
}
99+
100+
func init() {
101+
SchemeBuilder.Register(&InventoryProfile{}, &InventoryProfileList{})
102+
}
+74
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,74 @@
1+
/*
2+
Copyright 2021. Netris, Inc.
3+
4+
Licensed under the Apache License, Version 2.0 (the "License");
5+
you may not use this file except in compliance with the License.
6+
You may obtain a copy of the License at
7+
8+
http://www.apache.org/licenses/LICENSE-2.0
9+
10+
Unless required by applicable law or agreed to in writing, software
11+
distributed under the License is distributed on an "AS IS" BASIS,
12+
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13+
See the License for the specific language governing permissions and
14+
limitations under the License.
15+
*/
16+
17+
package v1alpha1
18+
19+
import (
20+
metav1 "k8s.io/apimachinery/pkg/apis/meta/v1"
21+
)
22+
23+
// EDIT THIS FILE! THIS IS SCAFFOLDING FOR YOU TO OWN!
24+
// NOTE: json tags are required. Any new fields you add must have json tags for the fields to be serialized.
25+
26+
// InventoryProfileMetaSpec defines the desired state of InventoryProfileMeta
27+
type InventoryProfileMetaSpec struct {
28+
Imported bool `json:"imported"`
29+
Reclaim bool `json:"reclaimPolicy"`
30+
InventoryProfileCRGeneration int64 `json:"inventoryProfileGeneration"`
31+
ID int `json:"id"`
32+
InventoryProfileName string `json:"inventoryProfileName"`
33+
34+
Description string `json:"description,omitempty"`
35+
36+
Timezone string `json:"timezone"`
37+
38+
AllowSSHFromIPv4 []string `json:"allowSshFromIpv4,omitempty"`
39+
AllowSSHFromIPv6 []string `json:"allowSshFromIpv6,omitempty"`
40+
NTPServers []string `json:"ntpServers,omitempty"`
41+
DNSServers []string `json:"dnsServers,omitempty"`
42+
CustomRules []InventoryProfileCustomRule `json:"customRules,omitempty"`
43+
}
44+
45+
// InventoryProfileMetaStatus defines the observed state of InventoryProfileMeta
46+
type InventoryProfileMetaStatus struct {
47+
// INSERT ADDITIONAL STATUS FIELD - define observed state of cluster
48+
// Important: Run "make" to regenerate code after modifying this file
49+
}
50+
51+
//+kubebuilder:object:root=true
52+
//+kubebuilder:subresource:status
53+
54+
// InventoryProfileMeta is the Schema for the inventoryprofilemeta API
55+
type InventoryProfileMeta struct {
56+
metav1.TypeMeta `json:",inline"`
57+
metav1.ObjectMeta `json:"metadata,omitempty"`
58+
59+
Spec InventoryProfileMetaSpec `json:"spec,omitempty"`
60+
Status InventoryProfileMetaStatus `json:"status,omitempty"`
61+
}
62+
63+
//+kubebuilder:object:root=true
64+
65+
// InventoryProfileMetaList contains a list of InventoryProfileMeta
66+
type InventoryProfileMetaList struct {
67+
metav1.TypeMeta `json:",inline"`
68+
metav1.ListMeta `json:"metadata,omitempty"`
69+
Items []InventoryProfileMeta `json:"items"`
70+
}
71+
72+
func init() {
73+
SchemeBuilder.Register(&InventoryProfileMeta{}, &InventoryProfileMetaList{})
74+
}

0 commit comments

Comments
 (0)