openpitrix crd

Signed-off-by: LiHui <andrewli@yunify.com>

delete helm repo, release and app

Signed-off-by: LiHui <andrewli@yunify.com>

Fix Dockerfile

Signed-off-by: LiHui <andrewli@yunify.com>

add unit test for category controller

Signed-off-by: LiHui <andrewli@yunify.com>

resource api

Signed-off-by: LiHui <andrewli@yunify.com>

miscellaneous

Signed-off-by: LiHui <andrewli@yunify.com>

resource api

Signed-off-by: LiHui <andrewli@yunify.com>

add s3 repo indx

Signed-off-by: LiHui <andrewli@yunify.com>

attachment api

Signed-off-by: LiHui <andrewli@yunify.com>

repo controller test

Signed-off-by: LiHui <andrewli@yunify.com>

application controller test

Signed-off-by: LiHui <andrewli@yunify.com>

release metric

Signed-off-by: LiHui <andrewli@yunify.com>

helm release controller test

Signed-off-by: LiHui <andrewli@yunify.com>

move constants to /pkg/apis/application

Signed-off-by: LiHui <andrewli@yunify.com>

remove unused code

Signed-off-by: LiHui <andrewli@yunify.com>

add license header

Signed-off-by: LiHui <andrewli@yunify.com>

Fix bugs

Signed-off-by: LiHui <andrewli@yunify.com>

cluster cluent

Signed-off-by: LiHui <andrewli@yunify.com>

format code

Signed-off-by: LiHui <andrewli@yunify.com>

move workspace,cluster from spec to labels

Signed-off-by: LiHui <andrewli@yunify.com>

add license header

Signed-off-by: LiHui <andrewli@yunify.com>

openpitrix test

Signed-off-by: LiHui <andrewli@yunify.com>

add worksapce labels for app in appstore

Signed-off-by: LiHui <andrewli@yunify.com>
This commit is contained in:
LiHui
2020-12-23 15:24:30 +08:00
parent 737639020b
commit 83e6221f3a
193 changed files with 19634 additions and 6039 deletions

View File

@@ -0,0 +1,89 @@
/*
Copyright 2020 The KubeSphere Authors.
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.
*/
// Code generated by informer-gen. DO NOT EDIT.
package v1alpha1
import (
"context"
time "time"
v1 "k8s.io/apimachinery/pkg/apis/meta/v1"
runtime "k8s.io/apimachinery/pkg/runtime"
watch "k8s.io/apimachinery/pkg/watch"
cache "k8s.io/client-go/tools/cache"
applicationv1alpha1 "kubesphere.io/kubesphere/pkg/apis/application/v1alpha1"
versioned "kubesphere.io/kubesphere/pkg/client/clientset/versioned"
internalinterfaces "kubesphere.io/kubesphere/pkg/client/informers/externalversions/internalinterfaces"
v1alpha1 "kubesphere.io/kubesphere/pkg/client/listers/application/v1alpha1"
)
// HelmApplicationInformer provides access to a shared informer and lister for
// HelmApplications.
type HelmApplicationInformer interface {
Informer() cache.SharedIndexInformer
Lister() v1alpha1.HelmApplicationLister
}
type helmApplicationInformer struct {
factory internalinterfaces.SharedInformerFactory
tweakListOptions internalinterfaces.TweakListOptionsFunc
}
// NewHelmApplicationInformer constructs a new informer for HelmApplication type.
// Always prefer using an informer factory to get a shared informer instead of getting an independent
// one. This reduces memory footprint and number of connections to the server.
func NewHelmApplicationInformer(client versioned.Interface, resyncPeriod time.Duration, indexers cache.Indexers) cache.SharedIndexInformer {
return NewFilteredHelmApplicationInformer(client, resyncPeriod, indexers, nil)
}
// NewFilteredHelmApplicationInformer constructs a new informer for HelmApplication type.
// Always prefer using an informer factory to get a shared informer instead of getting an independent
// one. This reduces memory footprint and number of connections to the server.
func NewFilteredHelmApplicationInformer(client versioned.Interface, resyncPeriod time.Duration, indexers cache.Indexers, tweakListOptions internalinterfaces.TweakListOptionsFunc) cache.SharedIndexInformer {
return cache.NewSharedIndexInformer(
&cache.ListWatch{
ListFunc: func(options v1.ListOptions) (runtime.Object, error) {
if tweakListOptions != nil {
tweakListOptions(&options)
}
return client.ApplicationV1alpha1().HelmApplications().List(context.TODO(), options)
},
WatchFunc: func(options v1.ListOptions) (watch.Interface, error) {
if tweakListOptions != nil {
tweakListOptions(&options)
}
return client.ApplicationV1alpha1().HelmApplications().Watch(context.TODO(), options)
},
},
&applicationv1alpha1.HelmApplication{},
resyncPeriod,
indexers,
)
}
func (f *helmApplicationInformer) defaultInformer(client versioned.Interface, resyncPeriod time.Duration) cache.SharedIndexInformer {
return NewFilteredHelmApplicationInformer(client, resyncPeriod, cache.Indexers{cache.NamespaceIndex: cache.MetaNamespaceIndexFunc}, f.tweakListOptions)
}
func (f *helmApplicationInformer) Informer() cache.SharedIndexInformer {
return f.factory.InformerFor(&applicationv1alpha1.HelmApplication{}, f.defaultInformer)
}
func (f *helmApplicationInformer) Lister() v1alpha1.HelmApplicationLister {
return v1alpha1.NewHelmApplicationLister(f.Informer().GetIndexer())
}

View File

@@ -0,0 +1,89 @@
/*
Copyright 2020 The KubeSphere Authors.
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.
*/
// Code generated by informer-gen. DO NOT EDIT.
package v1alpha1
import (
"context"
time "time"
v1 "k8s.io/apimachinery/pkg/apis/meta/v1"
runtime "k8s.io/apimachinery/pkg/runtime"
watch "k8s.io/apimachinery/pkg/watch"
cache "k8s.io/client-go/tools/cache"
applicationv1alpha1 "kubesphere.io/kubesphere/pkg/apis/application/v1alpha1"
versioned "kubesphere.io/kubesphere/pkg/client/clientset/versioned"
internalinterfaces "kubesphere.io/kubesphere/pkg/client/informers/externalversions/internalinterfaces"
v1alpha1 "kubesphere.io/kubesphere/pkg/client/listers/application/v1alpha1"
)
// HelmApplicationVersionInformer provides access to a shared informer and lister for
// HelmApplicationVersions.
type HelmApplicationVersionInformer interface {
Informer() cache.SharedIndexInformer
Lister() v1alpha1.HelmApplicationVersionLister
}
type helmApplicationVersionInformer struct {
factory internalinterfaces.SharedInformerFactory
tweakListOptions internalinterfaces.TweakListOptionsFunc
}
// NewHelmApplicationVersionInformer constructs a new informer for HelmApplicationVersion type.
// Always prefer using an informer factory to get a shared informer instead of getting an independent
// one. This reduces memory footprint and number of connections to the server.
func NewHelmApplicationVersionInformer(client versioned.Interface, resyncPeriod time.Duration, indexers cache.Indexers) cache.SharedIndexInformer {
return NewFilteredHelmApplicationVersionInformer(client, resyncPeriod, indexers, nil)
}
// NewFilteredHelmApplicationVersionInformer constructs a new informer for HelmApplicationVersion type.
// Always prefer using an informer factory to get a shared informer instead of getting an independent
// one. This reduces memory footprint and number of connections to the server.
func NewFilteredHelmApplicationVersionInformer(client versioned.Interface, resyncPeriod time.Duration, indexers cache.Indexers, tweakListOptions internalinterfaces.TweakListOptionsFunc) cache.SharedIndexInformer {
return cache.NewSharedIndexInformer(
&cache.ListWatch{
ListFunc: func(options v1.ListOptions) (runtime.Object, error) {
if tweakListOptions != nil {
tweakListOptions(&options)
}
return client.ApplicationV1alpha1().HelmApplicationVersions().List(context.TODO(), options)
},
WatchFunc: func(options v1.ListOptions) (watch.Interface, error) {
if tweakListOptions != nil {
tweakListOptions(&options)
}
return client.ApplicationV1alpha1().HelmApplicationVersions().Watch(context.TODO(), options)
},
},
&applicationv1alpha1.HelmApplicationVersion{},
resyncPeriod,
indexers,
)
}
func (f *helmApplicationVersionInformer) defaultInformer(client versioned.Interface, resyncPeriod time.Duration) cache.SharedIndexInformer {
return NewFilteredHelmApplicationVersionInformer(client, resyncPeriod, cache.Indexers{cache.NamespaceIndex: cache.MetaNamespaceIndexFunc}, f.tweakListOptions)
}
func (f *helmApplicationVersionInformer) Informer() cache.SharedIndexInformer {
return f.factory.InformerFor(&applicationv1alpha1.HelmApplicationVersion{}, f.defaultInformer)
}
func (f *helmApplicationVersionInformer) Lister() v1alpha1.HelmApplicationVersionLister {
return v1alpha1.NewHelmApplicationVersionLister(f.Informer().GetIndexer())
}

View File

@@ -0,0 +1,89 @@
/*
Copyright 2020 The KubeSphere Authors.
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.
*/
// Code generated by informer-gen. DO NOT EDIT.
package v1alpha1
import (
"context"
time "time"
v1 "k8s.io/apimachinery/pkg/apis/meta/v1"
runtime "k8s.io/apimachinery/pkg/runtime"
watch "k8s.io/apimachinery/pkg/watch"
cache "k8s.io/client-go/tools/cache"
applicationv1alpha1 "kubesphere.io/kubesphere/pkg/apis/application/v1alpha1"
versioned "kubesphere.io/kubesphere/pkg/client/clientset/versioned"
internalinterfaces "kubesphere.io/kubesphere/pkg/client/informers/externalversions/internalinterfaces"
v1alpha1 "kubesphere.io/kubesphere/pkg/client/listers/application/v1alpha1"
)
// HelmCategoryInformer provides access to a shared informer and lister for
// HelmCategories.
type HelmCategoryInformer interface {
Informer() cache.SharedIndexInformer
Lister() v1alpha1.HelmCategoryLister
}
type helmCategoryInformer struct {
factory internalinterfaces.SharedInformerFactory
tweakListOptions internalinterfaces.TweakListOptionsFunc
}
// NewHelmCategoryInformer constructs a new informer for HelmCategory type.
// Always prefer using an informer factory to get a shared informer instead of getting an independent
// one. This reduces memory footprint and number of connections to the server.
func NewHelmCategoryInformer(client versioned.Interface, resyncPeriod time.Duration, indexers cache.Indexers) cache.SharedIndexInformer {
return NewFilteredHelmCategoryInformer(client, resyncPeriod, indexers, nil)
}
// NewFilteredHelmCategoryInformer constructs a new informer for HelmCategory type.
// Always prefer using an informer factory to get a shared informer instead of getting an independent
// one. This reduces memory footprint and number of connections to the server.
func NewFilteredHelmCategoryInformer(client versioned.Interface, resyncPeriod time.Duration, indexers cache.Indexers, tweakListOptions internalinterfaces.TweakListOptionsFunc) cache.SharedIndexInformer {
return cache.NewSharedIndexInformer(
&cache.ListWatch{
ListFunc: func(options v1.ListOptions) (runtime.Object, error) {
if tweakListOptions != nil {
tweakListOptions(&options)
}
return client.ApplicationV1alpha1().HelmCategories().List(context.TODO(), options)
},
WatchFunc: func(options v1.ListOptions) (watch.Interface, error) {
if tweakListOptions != nil {
tweakListOptions(&options)
}
return client.ApplicationV1alpha1().HelmCategories().Watch(context.TODO(), options)
},
},
&applicationv1alpha1.HelmCategory{},
resyncPeriod,
indexers,
)
}
func (f *helmCategoryInformer) defaultInformer(client versioned.Interface, resyncPeriod time.Duration) cache.SharedIndexInformer {
return NewFilteredHelmCategoryInformer(client, resyncPeriod, cache.Indexers{cache.NamespaceIndex: cache.MetaNamespaceIndexFunc}, f.tweakListOptions)
}
func (f *helmCategoryInformer) Informer() cache.SharedIndexInformer {
return f.factory.InformerFor(&applicationv1alpha1.HelmCategory{}, f.defaultInformer)
}
func (f *helmCategoryInformer) Lister() v1alpha1.HelmCategoryLister {
return v1alpha1.NewHelmCategoryLister(f.Informer().GetIndexer())
}

View File

@@ -0,0 +1,89 @@
/*
Copyright 2020 The KubeSphere Authors.
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.
*/
// Code generated by informer-gen. DO NOT EDIT.
package v1alpha1
import (
"context"
time "time"
v1 "k8s.io/apimachinery/pkg/apis/meta/v1"
runtime "k8s.io/apimachinery/pkg/runtime"
watch "k8s.io/apimachinery/pkg/watch"
cache "k8s.io/client-go/tools/cache"
applicationv1alpha1 "kubesphere.io/kubesphere/pkg/apis/application/v1alpha1"
versioned "kubesphere.io/kubesphere/pkg/client/clientset/versioned"
internalinterfaces "kubesphere.io/kubesphere/pkg/client/informers/externalversions/internalinterfaces"
v1alpha1 "kubesphere.io/kubesphere/pkg/client/listers/application/v1alpha1"
)
// HelmReleaseInformer provides access to a shared informer and lister for
// HelmReleases.
type HelmReleaseInformer interface {
Informer() cache.SharedIndexInformer
Lister() v1alpha1.HelmReleaseLister
}
type helmReleaseInformer struct {
factory internalinterfaces.SharedInformerFactory
tweakListOptions internalinterfaces.TweakListOptionsFunc
}
// NewHelmReleaseInformer constructs a new informer for HelmRelease type.
// Always prefer using an informer factory to get a shared informer instead of getting an independent
// one. This reduces memory footprint and number of connections to the server.
func NewHelmReleaseInformer(client versioned.Interface, resyncPeriod time.Duration, indexers cache.Indexers) cache.SharedIndexInformer {
return NewFilteredHelmReleaseInformer(client, resyncPeriod, indexers, nil)
}
// NewFilteredHelmReleaseInformer constructs a new informer for HelmRelease type.
// Always prefer using an informer factory to get a shared informer instead of getting an independent
// one. This reduces memory footprint and number of connections to the server.
func NewFilteredHelmReleaseInformer(client versioned.Interface, resyncPeriod time.Duration, indexers cache.Indexers, tweakListOptions internalinterfaces.TweakListOptionsFunc) cache.SharedIndexInformer {
return cache.NewSharedIndexInformer(
&cache.ListWatch{
ListFunc: func(options v1.ListOptions) (runtime.Object, error) {
if tweakListOptions != nil {
tweakListOptions(&options)
}
return client.ApplicationV1alpha1().HelmReleases().List(context.TODO(), options)
},
WatchFunc: func(options v1.ListOptions) (watch.Interface, error) {
if tweakListOptions != nil {
tweakListOptions(&options)
}
return client.ApplicationV1alpha1().HelmReleases().Watch(context.TODO(), options)
},
},
&applicationv1alpha1.HelmRelease{},
resyncPeriod,
indexers,
)
}
func (f *helmReleaseInformer) defaultInformer(client versioned.Interface, resyncPeriod time.Duration) cache.SharedIndexInformer {
return NewFilteredHelmReleaseInformer(client, resyncPeriod, cache.Indexers{cache.NamespaceIndex: cache.MetaNamespaceIndexFunc}, f.tweakListOptions)
}
func (f *helmReleaseInformer) Informer() cache.SharedIndexInformer {
return f.factory.InformerFor(&applicationv1alpha1.HelmRelease{}, f.defaultInformer)
}
func (f *helmReleaseInformer) Lister() v1alpha1.HelmReleaseLister {
return v1alpha1.NewHelmReleaseLister(f.Informer().GetIndexer())
}

View File

@@ -0,0 +1,89 @@
/*
Copyright 2020 The KubeSphere Authors.
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.
*/
// Code generated by informer-gen. DO NOT EDIT.
package v1alpha1
import (
"context"
time "time"
v1 "k8s.io/apimachinery/pkg/apis/meta/v1"
runtime "k8s.io/apimachinery/pkg/runtime"
watch "k8s.io/apimachinery/pkg/watch"
cache "k8s.io/client-go/tools/cache"
applicationv1alpha1 "kubesphere.io/kubesphere/pkg/apis/application/v1alpha1"
versioned "kubesphere.io/kubesphere/pkg/client/clientset/versioned"
internalinterfaces "kubesphere.io/kubesphere/pkg/client/informers/externalversions/internalinterfaces"
v1alpha1 "kubesphere.io/kubesphere/pkg/client/listers/application/v1alpha1"
)
// HelmRepoInformer provides access to a shared informer and lister for
// HelmRepos.
type HelmRepoInformer interface {
Informer() cache.SharedIndexInformer
Lister() v1alpha1.HelmRepoLister
}
type helmRepoInformer struct {
factory internalinterfaces.SharedInformerFactory
tweakListOptions internalinterfaces.TweakListOptionsFunc
}
// NewHelmRepoInformer constructs a new informer for HelmRepo type.
// Always prefer using an informer factory to get a shared informer instead of getting an independent
// one. This reduces memory footprint and number of connections to the server.
func NewHelmRepoInformer(client versioned.Interface, resyncPeriod time.Duration, indexers cache.Indexers) cache.SharedIndexInformer {
return NewFilteredHelmRepoInformer(client, resyncPeriod, indexers, nil)
}
// NewFilteredHelmRepoInformer constructs a new informer for HelmRepo type.
// Always prefer using an informer factory to get a shared informer instead of getting an independent
// one. This reduces memory footprint and number of connections to the server.
func NewFilteredHelmRepoInformer(client versioned.Interface, resyncPeriod time.Duration, indexers cache.Indexers, tweakListOptions internalinterfaces.TweakListOptionsFunc) cache.SharedIndexInformer {
return cache.NewSharedIndexInformer(
&cache.ListWatch{
ListFunc: func(options v1.ListOptions) (runtime.Object, error) {
if tweakListOptions != nil {
tweakListOptions(&options)
}
return client.ApplicationV1alpha1().HelmRepos().List(context.TODO(), options)
},
WatchFunc: func(options v1.ListOptions) (watch.Interface, error) {
if tweakListOptions != nil {
tweakListOptions(&options)
}
return client.ApplicationV1alpha1().HelmRepos().Watch(context.TODO(), options)
},
},
&applicationv1alpha1.HelmRepo{},
resyncPeriod,
indexers,
)
}
func (f *helmRepoInformer) defaultInformer(client versioned.Interface, resyncPeriod time.Duration) cache.SharedIndexInformer {
return NewFilteredHelmRepoInformer(client, resyncPeriod, cache.Indexers{cache.NamespaceIndex: cache.MetaNamespaceIndexFunc}, f.tweakListOptions)
}
func (f *helmRepoInformer) Informer() cache.SharedIndexInformer {
return f.factory.InformerFor(&applicationv1alpha1.HelmRepo{}, f.defaultInformer)
}
func (f *helmRepoInformer) Lister() v1alpha1.HelmRepoLister {
return v1alpha1.NewHelmRepoLister(f.Informer().GetIndexer())
}

View File

@@ -0,0 +1,73 @@
/*
Copyright 2020 The KubeSphere Authors.
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.
*/
// Code generated by informer-gen. DO NOT EDIT.
package v1alpha1
import (
internalinterfaces "kubesphere.io/kubesphere/pkg/client/informers/externalversions/internalinterfaces"
)
// Interface provides access to all the informers in this group version.
type Interface interface {
// HelmApplications returns a HelmApplicationInformer.
HelmApplications() HelmApplicationInformer
// HelmApplicationVersions returns a HelmApplicationVersionInformer.
HelmApplicationVersions() HelmApplicationVersionInformer
// HelmCategories returns a HelmCategoryInformer.
HelmCategories() HelmCategoryInformer
// HelmReleases returns a HelmReleaseInformer.
HelmReleases() HelmReleaseInformer
// HelmRepos returns a HelmRepoInformer.
HelmRepos() HelmRepoInformer
}
type version struct {
factory internalinterfaces.SharedInformerFactory
namespace string
tweakListOptions internalinterfaces.TweakListOptionsFunc
}
// New returns a new Interface.
func New(f internalinterfaces.SharedInformerFactory, namespace string, tweakListOptions internalinterfaces.TweakListOptionsFunc) Interface {
return &version{factory: f, namespace: namespace, tweakListOptions: tweakListOptions}
}
// HelmApplications returns a HelmApplicationInformer.
func (v *version) HelmApplications() HelmApplicationInformer {
return &helmApplicationInformer{factory: v.factory, tweakListOptions: v.tweakListOptions}
}
// HelmApplicationVersions returns a HelmApplicationVersionInformer.
func (v *version) HelmApplicationVersions() HelmApplicationVersionInformer {
return &helmApplicationVersionInformer{factory: v.factory, tweakListOptions: v.tweakListOptions}
}
// HelmCategories returns a HelmCategoryInformer.
func (v *version) HelmCategories() HelmCategoryInformer {
return &helmCategoryInformer{factory: v.factory, tweakListOptions: v.tweakListOptions}
}
// HelmReleases returns a HelmReleaseInformer.
func (v *version) HelmReleases() HelmReleaseInformer {
return &helmReleaseInformer{factory: v.factory, tweakListOptions: v.tweakListOptions}
}
// HelmRepos returns a HelmRepoInformer.
func (v *version) HelmRepos() HelmRepoInformer {
return &helmRepoInformer{factory: v.factory, tweakListOptions: v.tweakListOptions}
}