Skip to content

Commit

Permalink
Add Solr API (#1110)
Browse files Browse the repository at this point in the history
* Add solr api.

Signed-off-by: pritamdas99 <pritam@appscode.com>
Co-authored-by: raihankhan <raihan@appscode.com>
  • Loading branch information
pritamdas99 and raihankhan authored Jan 19, 2024
1 parent 9d68704 commit a73a825
Show file tree
Hide file tree
Showing 33 changed files with 17,464 additions and 0 deletions.
221 changes: 221 additions & 0 deletions apis/catalog/v1alpha1/openapi_generated.go

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

4 changes: 4 additions & 0 deletions apis/catalog/v1alpha1/register.go
Original file line number Diff line number Diff line change
Expand Up @@ -86,6 +86,10 @@ func addKnownTypes(scheme *runtime.Scheme) error {
&SinglestoreVersionList{},
&ZooKeeperVersion{},
&ZooKeeperVersionList{},
&KafkaConnectorVersion{},
&KafkaConnectorVersionList{},
&SolrVersion{},
&SolrVersionList{},
)

scheme.AddKnownTypes(SchemeGroupVersion,
Expand Down
63 changes: 63 additions & 0 deletions apis/catalog/v1alpha1/solr_version_helpers.go
Original file line number Diff line number Diff line change
@@ -0,0 +1,63 @@
/*
Copyright AppsCode Inc. and Contributors
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 v1alpha1

import (
"fmt"

"kubedb.dev/apimachinery/apis"
"kubedb.dev/apimachinery/apis/catalog"
"kubedb.dev/apimachinery/crds"

"kmodules.xyz/client-go/apiextensions"
)

func (s SolrVersion) CustomResourceDefinition() *apiextensions.CustomResourceDefinition {
return crds.MustCustomResourceDefinition(SchemeGroupVersion.WithResource(ResourcePluralSolrVersion))
}

var _ apis.ResourceInfo = &SolrVersion{}

func (s SolrVersion) ResourceFQN() string {
return fmt.Sprintf("%s.%s", ResourcePluralSolrVersion, catalog.GroupName)
}

func (s SolrVersion) ResourceShortCode() string {
return ResourceCodeSolrVersion
}

func (s SolrVersion) ResourceKind() string {
return ResourceKindSolrVersion
}

func (s SolrVersion) ResourceSingular() string {
return ResourceSingularSolrVersion
}

func (s SolrVersion) ResourcePlural() string {
return ResourcePluralSolrVersion
}

func (s SolrVersion) ValidateSpecs() error {
if s.Spec.Version == "" ||
s.Spec.DB.Image == "" {
return fmt.Errorf(`atleast one of the following specs is not set for solrVersion "%v":
spec.version,
spec.db.image`, s.Name)
}
return nil
}
Loading

0 comments on commit a73a825

Please sign in to comment.