Skip to content

Commit 4371a7a

Browse files
deps
Signed-off-by: HiranmoyChowdhury <[email protected]>
1 parent cfbe3e1 commit 4371a7a

File tree

140 files changed

+30752
-479
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

140 files changed

+30752
-479
lines changed

go.mod

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -38,7 +38,7 @@ require (
3838
k8s.io/klog/v2 v2.130.1
3939
kmodules.xyz/client-go v0.32.9
4040
kmodules.xyz/custom-resources v0.32.2
41-
kubedb.dev/apimachinery v0.59.0
41+
kubedb.dev/apimachinery v0.59.1-0.20251205110528-3d10db600e5d
4242
sigs.k8s.io/controller-runtime v0.20.4
4343
xorm.io/xorm v1.3.9
4444
)
@@ -198,5 +198,3 @@ replace sigs.k8s.io/controller-runtime => github.com/kmodules/controller-runtime
198198
replace github.com/imdario/mergo => github.com/imdario/mergo v0.3.6
199199

200200
replace k8s.io/apiserver => github.com/kmodules/apiserver v0.32.3-0.20250221062720-35dc674c7dd6
201-
202-
replace kubedb.dev/apimachinery => ../apimachinery

go.sum

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -580,6 +580,8 @@ kmodules.xyz/prober v0.32.0 h1:8Z6pFRAu8kP0wwX2BooPCRy2SE6ZkUMHQmZDH5VUEGY=
580580
kmodules.xyz/prober v0.32.0/go.mod h1:h0fH4m9DaIwuNZq85zOlWUvBycyy4LvCPMUUhpS3iSE=
581581
kmodules.xyz/resource-metadata v0.32.1 h1:hWQbL0Xb+GaF7qn+rY0CNh7FUfKZw29VBUKTxjHFGYI=
582582
kmodules.xyz/resource-metadata v0.32.1/go.mod h1:wHC24BVzKb1gzkDCSI5l9CXK4AKD5gMamxEqVys50lI=
583+
kubedb.dev/apimachinery v0.59.1-0.20251205110528-3d10db600e5d h1:RFsZrXvM52Sz7joiRV2/d+Mt1sl3zV/BhmRjCypZxdA=
584+
kubedb.dev/apimachinery v0.59.1-0.20251205110528-3d10db600e5d/go.mod h1:8zu7zUBEd2PQsI0JZJFmxzglf63zxbwlAJIJlY77UqM=
583585
kubeops.dev/operator-shard-manager v0.0.3 h1:Z2YOAfyQIjvHMwT4O56lR0l9z25s2tCVDO22u/XuYnw=
584586
kubeops.dev/operator-shard-manager v0.0.3/go.mod h1:2oRq5vnCaUxzE+qIiRuzB34PlqahiynE+sYqWu6AMIY=
585587
kubeops.dev/petset v0.0.14 h1:Lk3prjtm5AgR44qr2SX8elx6sF9PK1G0GYlv8AZd9OY=
Lines changed: 63 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,63 @@
1+
/*
2+
Copyright AppsCode Inc. and Contributors
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+
"fmt"
21+
22+
"kubedb.dev/apimachinery/apis"
23+
"kubedb.dev/apimachinery/apis/catalog"
24+
"kubedb.dev/apimachinery/crds"
25+
26+
"kmodules.xyz/client-go/apiextensions"
27+
)
28+
29+
func (_ DB2Version) CustomResourceDefinition() *apiextensions.CustomResourceDefinition {
30+
return crds.MustCustomResourceDefinition(SchemeGroupVersion.WithResource(ResourcePluralDB2Version))
31+
}
32+
33+
var _ apis.ResourceInfo = &DB2Version{}
34+
35+
func (d DB2Version) ResourceFQN() string {
36+
return fmt.Sprintf("%s.%s", ResourcePluralDB2Version, catalog.GroupName)
37+
}
38+
39+
func (d DB2Version) ResourceShortCode() string {
40+
return ResourceCodeDB2Version
41+
}
42+
43+
func (d DB2Version) ResourceKind() string {
44+
return ResourceKindDB2Version
45+
}
46+
47+
func (d DB2Version) ResourceSingular() string {
48+
return ResourceSingularDB2Version
49+
}
50+
51+
func (d DB2Version) ResourcePlural() string {
52+
return ResourcePluralDB2Version
53+
}
54+
55+
func (d DB2Version) ValidateSpecs() error {
56+
if d.Spec.Version == "" || d.Spec.DB.Image == "" || d.Spec.Coordinator.Image == "" {
57+
return fmt.Errorf(`at least one of the following specs is not set for DB2 "%v":
58+
spec.version,
59+
spec.coordinator.image`, d.Name)
60+
}
61+
// TODO: add m.spec.exporter.image check FOR monitoring
62+
return nil
63+
}
Lines changed: 90 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,90 @@
1+
/*
2+
Copyright 2025.
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+
const (
24+
ResourceCodeDB2Version = "db2v"
25+
ResourceKindDB2Version = "DB2Version"
26+
ResourceSingularDB2Version = "db2version"
27+
ResourcePluralDB2Version = "db2versions"
28+
)
29+
30+
// DB2Version defines a DB2 database version.
31+
32+
// +genclient
33+
// +genclient:nonNamespaced
34+
// +genclient:skipVerbs=updateStatus
35+
// +k8s:openapi-gen=true
36+
// +k8s:deepcopy-gen:interfaces=k8s.io/apimachinery/pkg/runtime.Object
37+
38+
// +kubebuilder:object:root=true
39+
// +kubebuilder:resource:path=db2versions,singular=db2version,scope=Cluster,shortName=db2v,categories={catalog,kubedb,appscode}
40+
// +kubebuilder:printcolumn:name="Version",type="string",JSONPath=".spec.version"
41+
// +kubebuilder:printcolumn:name="DB_IMAGE",type="string",JSONPath=".spec.db.image"
42+
// +kubebuilder:printcolumn:name="Deprecated",type="boolean",JSONPath=".spec.deprecated"
43+
// +kubebuilder:printcolumn:name="Age",type="date",JSONPath=".metadata.creationTimestamp"
44+
type DB2Version struct {
45+
metav1.TypeMeta `json:",inline,omitempty"`
46+
metav1.ObjectMeta `json:"metadata,omitempty"`
47+
Spec DB2VersionSpec `json:"spec,omitempty"`
48+
}
49+
50+
// DB2VersionSpec is the spec for oracle version
51+
type DB2VersionSpec struct {
52+
// Version
53+
Version string `json:"version"`
54+
// Database Image
55+
DB DB2VersionDatabase `json:"db"`
56+
// Coordinator Image
57+
// +optional
58+
Coordinator DB2Coordinator `json:"coordinator,omitempty"`
59+
// Deprecated versions usable but regarded as obsolete and best avoided, typically due to having been superseded.
60+
// +optional
61+
Deprecated bool `json:"deprecated,omitempty"`
62+
63+
// SecurityContext is for the additional config for oracle DB container
64+
// +optional
65+
SecurityContext SecurityContext `json:"securityContext"`
66+
67+
// update constraints
68+
UpdateConstraints UpdateConstraints `json:"updateConstraints,omitempty"`
69+
70+
// +optional
71+
UI []ChartInfo `json:"ui,omitempty"`
72+
}
73+
74+
// DB2VersionDatabase is the DB2 Database image
75+
type DB2VersionDatabase struct {
76+
Image string `json:"image"`
77+
}
78+
type DB2Coordinator struct {
79+
Image string `json:"image"`
80+
}
81+
82+
// +k8s:deepcopy-gen:interfaces=k8s.io/apimachinery/pkg/runtime.Object
83+
84+
// DB2VersionList is a list of DB2Versions
85+
type DB2VersionList struct {
86+
metav1.TypeMeta `json:",inline"`
87+
metav1.ListMeta `json:"metadata,omitempty"`
88+
// Items is a list of DB2Version CRD objects
89+
Items []DB2Version `json:"items,omitempty"`
90+
}
Lines changed: 63 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,63 @@
1+
/*
2+
Copyright AppsCode Inc. and Contributors
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+
"fmt"
21+
22+
"kubedb.dev/apimachinery/apis"
23+
"kubedb.dev/apimachinery/apis/catalog"
24+
"kubedb.dev/apimachinery/crds"
25+
26+
"kmodules.xyz/client-go/apiextensions"
27+
)
28+
29+
func (_ HanaDBVersion) CustomResourceDefinition() *apiextensions.CustomResourceDefinition {
30+
return crds.MustCustomResourceDefinition(SchemeGroupVersion.WithResource(ResourcePluralHanaDBVersion))
31+
}
32+
33+
var _ apis.ResourceInfo = &HanaDBVersion{}
34+
35+
func (h HanaDBVersion) ResourceFQN() string {
36+
return fmt.Sprintf("%s.%s", ResourcePluralHanaDBVersion, catalog.GroupName)
37+
}
38+
39+
func (h HanaDBVersion) ResourceShortCode() string {
40+
return ResourceCodeHanaDBVersion
41+
}
42+
43+
func (h HanaDBVersion) ResourceKind() string {
44+
return ResourceKindHanaDBVersion
45+
}
46+
47+
func (h HanaDBVersion) ResourceSingular() string {
48+
return ResourceSingularHanaDBVersion
49+
}
50+
51+
func (h HanaDBVersion) ResourcePlural() string {
52+
return ResourcePluralHanaDBVersion
53+
}
54+
55+
func (h HanaDBVersion) ValidateSpecs() error {
56+
if h.Spec.Version == "" ||
57+
h.Spec.DB.Image == "" {
58+
return fmt.Errorf(`atleast one of the following specs is not set for HanaDBVersion "%v":
59+
spec.version,
60+
spec.db.image,`, h.Name)
61+
}
62+
return nil
63+
}
Lines changed: 83 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,83 @@
1+
/*
2+
Copyright AppsCode Inc. and Contributors
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+
const (
24+
ResourceCodeHanaDBVersion = "hdbversion"
25+
ResourceKindHanaDBVersion = "HanaDBVersion"
26+
ResourceSingularHanaDBVersion = "hanadbversion"
27+
ResourcePluralHanaDBVersion = "hanadbversions"
28+
)
29+
30+
// HanaDBVersion defines a HanaDB database version
31+
// +genclient
32+
// +genclient:nonNamespaced
33+
// +genclient:skipVerbs=updateStatus
34+
// +k8s:openapi-gen=true
35+
// +k8s:deepcopy-gen:interfaces=k8s.io/apimachinery/pkg/runtime.Object
36+
// +kubebuilder:object:root=true
37+
// +kubebuilder:resource:path=hanadbversions,singular=hanadbversion,scope=Cluster,shortName=hdbversion,categories={catalog,kubedb,appscode}
38+
// +kubebuilder:printcolumn:name="Version",type="string",JSONPath=".spec.version"
39+
// +kubebuilder:printcolumn:name="DB_IMAGE",type="string",JSONPath=".spec.db.image"
40+
// +kubebuilder:printcolumn:name="Deprecated",type="boolean",JSONPath=".spec.deprecated"
41+
// +kubebuilder:printcolumn:name="Age",type="date",JSONPath=".metadata.creationTimestamp"
42+
type HanaDBVersion struct {
43+
metav1.TypeMeta `json:",inline,omitempty"`
44+
metav1.ObjectMeta `json:"metadata,omitempty"`
45+
Spec HanaDBVersionSpec `json:"spec,omitempty"`
46+
}
47+
48+
// HanaDBVersionSpec is the spec for HanaDB version
49+
type HanaDBVersionSpec struct {
50+
// Version
51+
Version string `json:"version"`
52+
// Database Image
53+
DB HanaDatabase `json:"db"`
54+
// Deprecated versions usable but considered as obsolete and best avoided typically superseded
55+
Deprecated bool `json:"deprecated,omitempty"`
56+
// SecurityContext is for the additional config for the DB container
57+
// +optional
58+
SecurityContext HanaDBSecurityContext `json:"securityContext"`
59+
// +optional
60+
UI []ChartInfo `json:"ui,omitempty"`
61+
// update constraints
62+
UpdateConstraints UpdateConstraints `json:"updateConstraints,omitempty"`
63+
}
64+
65+
// HanaDBSecurityContext is for the additional config for the DB container
66+
type HanaDBSecurityContext struct {
67+
RunAsUser *int64 `json:"runAsUser,omitempty"`
68+
RunAsGroup *int64 `json:"runAsGroup,omitempty"`
69+
}
70+
71+
// HanaDBVersionDatabase is the HanaDB Database image
72+
type HanaDatabase struct {
73+
Image string `json:"image"`
74+
}
75+
76+
// +k8s:deepcopy-gen:interfaces=k8s.io/apimachinery/pkg/runtime.Object
77+
78+
// HanaDBVersionList is a list of HanaDBVersions
79+
type HanaDBVersionList struct {
80+
metav1.TypeMeta `json:",inline"`
81+
metav1.ListMeta `json:"metadata,omitempty"`
82+
Items []HanaDBVersion `json:"items,omitempty"`
83+
}
Lines changed: 63 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,63 @@
1+
/*
2+
Copyright AppsCode Inc. and Contributors
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+
"fmt"
21+
22+
"kubedb.dev/apimachinery/apis"
23+
"kubedb.dev/apimachinery/apis/catalog"
24+
"kubedb.dev/apimachinery/crds"
25+
26+
"kmodules.xyz/client-go/apiextensions"
27+
)
28+
29+
func (_ MilvusVersion) CustomResourceDefinition() *apiextensions.CustomResourceDefinition {
30+
return crds.MustCustomResourceDefinition(SchemeGroupVersion.WithResource(ResourcePluralMilvusVersion))
31+
}
32+
33+
var _ apis.ResourceInfo = &MilvusVersion{}
34+
35+
func (m MilvusVersion) ResourceFQN() string {
36+
return fmt.Sprintf("%s.%s", ResourcePluralMilvusVersion, catalog.GroupName)
37+
}
38+
39+
func (m MilvusVersion) ResourceShortCode() string {
40+
return ResourceCodeMilvusVersion
41+
}
42+
43+
func (m MilvusVersion) ResourceKind() string {
44+
return ResourceKindMilvusVersion
45+
}
46+
47+
func (m MilvusVersion) ResourceSingular() string {
48+
return ResourceSingularMilvusVersion
49+
}
50+
51+
func (m MilvusVersion) ResourcePlural() string {
52+
return ResourcePluralMilvusVersion
53+
}
54+
55+
func (m MilvusVersion) ValidateSpecs() error {
56+
if m.Spec.Version == "" ||
57+
m.Spec.DB.Image == "" {
58+
return fmt.Errorf(`atleast one of the following specs is not set for MilvusVersion "%v":
59+
spec.version,
60+
spec.db.image,`, m.Name)
61+
}
62+
return nil
63+
}

0 commit comments

Comments
 (0)