提交 83e6221f 编写于 作者: L LiHui

openpitrix crd

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

delete helm repo, release and app
Signed-off-by: NLiHui <andrewli@yunify.com>

Fix Dockerfile
Signed-off-by: NLiHui <andrewli@yunify.com>

add unit test for category controller
Signed-off-by: NLiHui <andrewli@yunify.com>

resource api
Signed-off-by: NLiHui <andrewli@yunify.com>

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

resource api
Signed-off-by: NLiHui <andrewli@yunify.com>

add s3 repo indx
Signed-off-by: NLiHui <andrewli@yunify.com>

attachment api
Signed-off-by: NLiHui <andrewli@yunify.com>

repo controller test
Signed-off-by: NLiHui <andrewli@yunify.com>

application controller test
Signed-off-by: NLiHui <andrewli@yunify.com>

release metric
Signed-off-by: NLiHui <andrewli@yunify.com>

helm release controller test
Signed-off-by: NLiHui <andrewli@yunify.com>

move constants to /pkg/apis/application
Signed-off-by: NLiHui <andrewli@yunify.com>

remove unused code
Signed-off-by: NLiHui <andrewli@yunify.com>

add license header
Signed-off-by: NLiHui <andrewli@yunify.com>

Fix bugs
Signed-off-by: NLiHui <andrewli@yunify.com>

cluster cluent
Signed-off-by: NLiHui <andrewli@yunify.com>

format code
Signed-off-by: NLiHui <andrewli@yunify.com>

move workspace,cluster from spec to labels
Signed-off-by: NLiHui <andrewli@yunify.com>

add license header
Signed-off-by: NLiHui <andrewli@yunify.com>

openpitrix test
Signed-off-by: NLiHui <andrewli@yunify.com>

add worksapce labels for app in appstore
Signed-off-by: NLiHui <andrewli@yunify.com>
上级 73763902
......@@ -88,7 +88,7 @@ docker-build-no-test: ks-apiserver ks-controller-manager
# Run tests
test: fmt vet
export KUBEBUILDER_CONTROLPLANE_START_TIMEOUT=1m; go test ./pkg/... ./cmd/... -covermode=atomic -coverprofile=coverage.txt
export KUBEBUILDER_CONTROLPLANE_START_TIMEOUT=2m; go test ./pkg/... ./cmd/... -covermode=atomic -coverprofile=coverage.txt
.PHONY: clean
clean:
......
# Copyright 2020 The KubeSphere Authors. All rights reserved.
# Use of this source code is governed by an Apache license
# that can be found in the LICENSE file.
FROM alpine/helm:3.4.2 as helm-base
FROM alpine:3.11
RUN apk add --no-cache ca-certificates
COPY --from=helm-base /usr/bin/helm /usr/bin/helm
# To speed up building process, we copy binary directly from make
# result instead of building it again, so make sure you run the
# following command first before building docker image
......
# Copyright 2020 The KubeSphere Authors. All rights reserved.
# Use of this source code is governed by an Apache license
# that can be found in the LICENSE file.
FROM alpine/helm:3.4.2 as helm-base
FROM alpine:3.11
RUN apk add --no-cache ca-certificates
COPY --from=helm-base /usr/bin/helm /usr/bin/helm
COPY /bin/cmd/controller-manager /usr/local/bin/
EXPOSE 8443 8080
......
......@@ -51,7 +51,6 @@ import (
"kubesphere.io/kubesphere/pkg/simple/client/multicluster"
"kubesphere.io/kubesphere/pkg/simple/client/network"
ippoolclient "kubesphere.io/kubesphere/pkg/simple/client/network/ippool"
"kubesphere.io/kubesphere/pkg/simple/client/openpitrix"
"kubesphere.io/kubesphere/pkg/simple/client/s3"
"sigs.k8s.io/controller-runtime/pkg/manager"
"sigs.k8s.io/kubefed/pkg/controller/util"
......@@ -66,7 +65,6 @@ func addControllers(
ldapClient ldapclient.Interface,
options *k8s.KubernetesOptions,
authenticationOptions *authoptions.AuthenticationOptions,
openpitrixClient openpitrix.Client,
multiClusterOptions *multicluster.Options,
networkOptions *network.Options,
serviceMeshEnabled bool,
......@@ -233,7 +231,6 @@ func addControllers(
client.Config(),
kubesphereInformer.Cluster().V1alpha1().Clusters(),
client.KubeSphere().ClusterV1alpha1().Clusters(),
openpitrixClient,
multiClusterOptions.ClusterControllerResyncSecond)
}
......
......@@ -18,12 +18,9 @@ package app
import (
"fmt"
"github.com/spf13/cobra"
metav1 "k8s.io/apimachinery/pkg/apis/meta/v1"
"k8s.io/apimachinery/pkg/labels"
"kubesphere.io/kubesphere/pkg/controller/application"
"os"
"github.com/spf13/cobra"
utilerrors "k8s.io/apimachinery/pkg/util/errors"
cliflag "k8s.io/component-base/cli/flag"
"k8s.io/klog"
......@@ -31,8 +28,13 @@ import (
"kubesphere.io/kubesphere/cmd/controller-manager/app/options"
"kubesphere.io/kubesphere/pkg/apis"
controllerconfig "kubesphere.io/kubesphere/pkg/apiserver/config"
"kubesphere.io/kubesphere/pkg/controller/application"
"kubesphere.io/kubesphere/pkg/controller/namespace"
"kubesphere.io/kubesphere/pkg/controller/network/webhooks"
"kubesphere.io/kubesphere/pkg/controller/openpitrix/helmapplication"
"kubesphere.io/kubesphere/pkg/controller/openpitrix/helmcategory"
"kubesphere.io/kubesphere/pkg/controller/openpitrix/helmrelease"
"kubesphere.io/kubesphere/pkg/controller/openpitrix/helmrepo"
"kubesphere.io/kubesphere/pkg/controller/quota"
"kubesphere.io/kubesphere/pkg/controller/serviceaccount"
"kubesphere.io/kubesphere/pkg/controller/user"
......@@ -45,10 +47,10 @@ import (
"kubesphere.io/kubesphere/pkg/simple/client/devops/jenkins"
"kubesphere.io/kubesphere/pkg/simple/client/k8s"
ldapclient "kubesphere.io/kubesphere/pkg/simple/client/ldap"
"kubesphere.io/kubesphere/pkg/simple/client/openpitrix"
"kubesphere.io/kubesphere/pkg/simple/client/s3"
"kubesphere.io/kubesphere/pkg/utils/metrics"
"kubesphere.io/kubesphere/pkg/utils/term"
"os"
ctrl "sigs.k8s.io/controller-runtime"
"sigs.k8s.io/controller-runtime/pkg/manager"
"sigs.k8s.io/controller-runtime/pkg/runtime/signals"
......@@ -142,14 +144,6 @@ func run(s *options.KubeSphereControllerManagerOptions, stopCh <-chan struct{})
klog.Warning("ks-controller-manager starts without ldap provided, it will not sync user into ldap")
}
var openpitrixClient openpitrix.Client
if s.OpenPitrixOptions != nil && !s.OpenPitrixOptions.IsEmpty() {
openpitrixClient, err = openpitrix.NewClient(s.OpenPitrixOptions)
if err != nil {
return fmt.Errorf("failed to connect to openpitrix, please check openpitrix status, error: %v", err)
}
}
var s3Client s3.Interface
if s.S3Options != nil && len(s.S3Options.Endpoint) != 0 {
s3Client, err = s3.NewS3Client(s.S3Options)
......@@ -224,6 +218,41 @@ func run(s *options.KubeSphereControllerManagerOptions, stopCh <-chan struct{})
klog.Fatalf("Unable to create namespace controller: %v", err)
}
err = helmrepo.Add(mgr)
if err != nil {
klog.Fatal("Unable to create helm repo controller")
}
err = helmcategory.Add(mgr)
if err != nil {
klog.Fatal("Unable to create helm category controller")
}
if !s.OpenPitrixOptions.IsEmpty() {
storageClient, err := s3.NewS3Client(s.OpenPitrixOptions.S3Options)
if err != nil {
klog.Fatalf("failed to connect to s3, please check openpitrix s3 service status, error: %v", err)
}
err = (&helmapplication.ReconcileHelmApplication{}).SetupWithManager(mgr)
if err != nil {
klog.Fatalf("Unable to create helm application controller, error: %s", err)
}
err = (&helmapplication.ReconcileHelmApplicationVersion{}).SetupWithManager(mgr)
if err != nil {
klog.Fatalf("Unable to create helm application version controller, error: %s ", err)
}
err = (&helmrelease.ReconcileHelmRelease{
StorageClient: storageClient,
KsFactory: informerFactory.KubeSphereSharedInformerFactory(),
}).SetupWithManager(mgr)
if err != nil {
klog.Fatalf("Unable to create helm release controller, error: %s", err)
}
}
selector, _ := labels.Parse(s.ApplicationSelector)
applicationReconciler := &application.ApplicationReconciler{
Scheme: mgr.GetScheme(),
......@@ -255,7 +284,6 @@ func run(s *options.KubeSphereControllerManagerOptions, stopCh <-chan struct{})
ldapClient,
s.KubernetesOptions,
s.AuthenticationOptions,
openpitrixClient,
s.MultiClusterOptions,
s.NetworkOptions,
servicemeshEnabled,
......@@ -283,7 +311,9 @@ func run(s *options.KubeSphereControllerManagerOptions, stopCh <-chan struct{})
hookServer.Register("/validate-quota-kubesphere-io-v1alpha2", &webhook.Admission{Handler: resourceQuotaAdmission})
klog.V(2).Info("registering metrics to the webhook server")
hookServer.Register("/metrics", metrics.Handler())
// Add an extra metric endpoint, so we can use the the same metric definition with ks-apiserver
// /kapis/metrics is independent of controller-manager's built-in /metrics
mgr.AddMetricsExtraHandler("/kapis/metrics", metrics.Handler())
klog.V(0).Info("Starting the controllers.")
if err = mgr.Start(stopCh); err != nil {
......
......@@ -39,7 +39,6 @@ import (
esclient "kubesphere.io/kubesphere/pkg/simple/client/logging/elasticsearch"
"kubesphere.io/kubesphere/pkg/simple/client/monitoring/metricsserver"
"kubesphere.io/kubesphere/pkg/simple/client/monitoring/prometheus"
"kubesphere.io/kubesphere/pkg/simple/client/openpitrix"
"kubesphere.io/kubesphere/pkg/simple/client/s3"
fakes3 "kubesphere.io/kubesphere/pkg/simple/client/s3/fake"
"kubesphere.io/kubesphere/pkg/simple/client/sonarqube"
......@@ -196,14 +195,6 @@ func (s *ServerRunOptions) NewAPIServer(stopCh <-chan struct{}) (*apiserver.APIS
apiServer.AuditingClient = auditingClient
}
if s.OpenPitrixOptions != nil && !s.OpenPitrixOptions.IsEmpty() {
opClient, err := openpitrix.NewClient(s.OpenPitrixOptions)
if err != nil {
return nil, fmt.Errorf("failed to connect to openpitrix, please check openpitrix status, error: %v", err)
}
apiServer.OpenpitrixClient = opClient
}
if s.AlertingOptions != nil && (s.AlertingOptions.PrometheusEndpoint != "" || s.AlertingOptions.ThanosRulerEndpoint != "") {
alertingClient, err := alerting.NewRuleClient(s.AlertingOptions)
if err != nil {
......
---
apiVersion: apiextensions.k8s.io/v1
kind: CustomResourceDefinition
metadata:
annotations:
controller-gen.kubebuilder.io/version: (devel)
creationTimestamp: null
name: helmapplications.application.kubesphere.io
spec:
group: application.kubesphere.io
names:
kind: HelmApplication
listKind: HelmApplicationList
plural: helmapplications
shortNames:
- happ
singular: helmapplication
scope: Cluster
versions:
- additionalPrinterColumns:
- jsonPath: .spec.name
name: application name
type: string
- jsonPath: .metadata.labels.kubesphere\.io/workspace
name: workspace
type: string
- jsonPath: .status.state
name: State
type: string
- jsonPath: .metadata.creationTimestamp
name: Age
type: date
name: v1alpha1
schema:
openAPIV3Schema:
description: HelmApplication is the Schema for the helmapplications API
properties:
apiVersion:
description: 'APIVersion defines the versioned schema of this representation of an object. Servers should convert recognized schemas to the latest internal value, and may reject unrecognized values. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#resources'
type: string
kind:
description: 'Kind is a string value representing the REST resource this object represents. Servers may infer this from the endpoint the client submits requests to. Cannot be updated. In CamelCase. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#types-kinds'
type: string
metadata:
type: object
spec:
description: HelmApplicationSpec defines the desired state of HelmApplication
properties:
abstraction:
description: info from frontend
type: string
appHome:
type: string
attachments:
description: attachments id
items:
type: string
type: array
description:
description: description from chart's description or frontend
type: string
icon:
description: The attachment id of the icon
type: string
name:
description: the name of the helm application
type: string
required:
- name
type: object
status:
description: HelmApplicationStatus defines the observed state of HelmApplication
properties:
latestVersion:
description: If this application belong to appStore, latestVersion is the the latest version of the active application version. otherwise latestVersion is the latest version of all application version
type: string
state:
description: 'the state of the helm application: draft, submitted, passed, rejected, suspended, active'
type: string
statusTime:
format: date-time
type: string
updateTime:
format: date-time
type: string
required:
- statusTime
- updateTime
type: object
type: object
served: true
storage: true
subresources:
status: {}
status:
acceptedNames:
kind: ""
plural: ""
conditions: []
storedVersions: []
---
apiVersion: apiextensions.k8s.io/v1
kind: CustomResourceDefinition
metadata:
annotations:
controller-gen.kubebuilder.io/version: (devel)
creationTimestamp: null
name: helmapplicationversions.application.kubesphere.io
spec:
group: application.kubesphere.io
names:
kind: HelmApplicationVersion
listKind: HelmApplicationVersionList
plural: helmapplicationversions
shortNames:
- happver
singular: helmapplicationversion
scope: Cluster
versions:
- additionalPrinterColumns:
- jsonPath: .spec.name
name: application name
type: string
- jsonPath: .status.state
name: State
type: string
- jsonPath: .metadata.creationTimestamp
name: Age
type: date
name: v1alpha1
schema:
openAPIV3Schema:
description: HelmApplicationVersion is the Schema for the helmapplicationversions API
properties:
apiVersion:
description: 'APIVersion defines the versioned schema of this representation of an object. Servers should convert recognized schemas to the latest internal value, and may reject unrecognized values. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#resources'
type: string
kind:
description: 'Kind is a string value representing the REST resource this object represents. Servers may infer this from the endpoint the client submits requests to. Cannot be updated. In CamelCase. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#types-kinds'
type: string
metadata:
type: object
spec:
description: HelmApplicationVersionSpec defines the desired state of HelmApplicationVersion
properties:
annotations:
additionalProperties:
type: string
description: Annotations are additional mappings uninterpreted by Helm, made available for inspection by other applications.
type: object
apiVersion:
description: The API Version of this chart.
type: string
appVersion:
description: The version of the application enclosed inside of this chart.
type: string
condition:
description: The condition to check to enable chart
type: string
created:
description: chart create time
format: date-time
type: string
data:
description: raw data of chart, it will !!!NOT!!! be save to etcd
format: byte
type: string
dataKey:
description: dataKey in the storage
type: string
dependencies:
description: Dependencies are a list of dependencies for a chart.
items:
description: Dependency describes a chart upon which another chart depends. Dependencies can be used to express developer intent, or to capture the state of a chart.
properties:
alias:
description: Alias usable alias to be used for the chart
type: string
condition:
description: A yaml path that resolves to a boolean, used for enabling/disabling charts (e.g. subchart1.enabled )
type: string
enabled:
description: Enabled bool determines if chart should be loaded
type: boolean
name:
description: Name is the name of the dependency. This must mach the name in the dependency's Chart.yaml.
type: string
repository:
description: The URL to the repository. Appending `index.yaml` to this string should result in a URL that can be used to fetch the repository index.
type: string
tags:
description: Tags can be used to group charts for enabling/disabling together
items:
type: string
type: array
version:
description: Version is the version (range) of this chart. A lock file will always produce a single version, while a dependency may contain a semantic version range.
type: string
required:
- name
- repository
type: object
type: array
deprecated:
description: Whether or not this chart is deprecated
type: boolean
description:
description: A one-sentence description of the chart
type: string
digest:
description: chart digest
type: string
home:
description: The URL to a relevant project page, git repo, or contact person
type: string
icon:
description: The URL to an icon file.
type: string
keywords:
description: A list of string keywords
items:
type: string
type: array
kubeVersion:
description: KubeVersion is a SemVer constraint specifying the version of Kubernetes required.
type: string
maintainers:
description: A list of name and URL/email address combinations for the maintainer(s)
items:
description: Maintainer describes a Chart maintainer.
properties:
email:
description: Email is an optional email address to contact the named maintainer
type: string
name:
description: Name is a user name or organization name
type: string
url:
description: URL is an optional URL to an address for the named maintainer
type: string
type: object
type: array
name:
description: The name of the chart
type: string
sources:
description: Source is the URL to the source code of this chart
items:
type: string
type: array
tags:
description: The tags to check to enable chart
type: string
type:
description: 'Specifies the chart type: application or library'
type: string
urls:
description: chart url
items:
type: string
type: array
version:
description: A SemVer 2 conformant version string of the chart
type: string
type: object
status:
description: HelmApplicationVersionStatus defines the observed state of HelmApplicationVersion
properties:
audit:
items:
properties:
message:
description: audit message
type: string
operator:
description: audit operator
type: string
operatorType:
type: string
state:
description: 'audit state: submitted, passed, draft, active, rejected, suspended'
type: string
time:
description: audit time
format: date-time
type: string
required:
- time
type: object
type: array
state:
type: string
type: object
type: object
served: true
storage: true
subresources:
status: {}
status:
acceptedNames:
kind: ""
plural: ""
conditions: []
storedVersions: []
---
apiVersion: apiextensions.k8s.io/v1
kind: CustomResourceDefinition
metadata:
annotations:
controller-gen.kubebuilder.io/version: (devel)
creationTimestamp: null
name: helmcategories.application.kubesphere.io
spec:
group: application.kubesphere.io
names:
kind: HelmCategory
listKind: HelmCategoryList
plural: helmcategories
shortNames:
- hctg
singular: helmcategory
scope: Cluster
versions:
- additionalPrinterColumns:
- jsonPath: .spec.name
name: name
type: string
- jsonPath: .status.total
name: total
type: string
- jsonPath: .metadata.creationTimestamp
name: Age
type: date
name: v1alpha1
schema:
openAPIV3Schema:
description: HelmCategory is the Schema for the helmcategories API
properties:
apiVersion:
description: 'APIVersion defines the versioned schema of this representation of an object. Servers should convert recognized schemas to the latest internal value, and may reject unrecognized values. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#resources'
type: string
kind:
description: 'Kind is a string value representing the REST resource this object represents. Servers may infer this from the endpoint the client submits requests to. Cannot be updated. In CamelCase. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#types-kinds'
type: string
metadata:
type: object
spec:
description: HelmCategorySpec defines the desired state of HelmRepo
properties:
description:
description: info from frontend
type: string
locale:
type: string
name:
description: name of the category
type: string
required:
- name
type: object
status:
properties:
total:
description: total helmapplications belong to this category
type: integer
required:
- total
type: object
type: object
served: true
storage: true
subresources:
status: {}
status:
acceptedNames:
kind: ""
plural: ""
conditions: []
storedVersions: []
---
apiVersion: apiextensions.k8s.io/v1
kind: CustomResourceDefinition
metadata:
annotations:
controller-gen.kubebuilder.io/version: (devel)
creationTimestamp: null
name: helmreleases.application.kubesphere.io
spec:
group: application.kubesphere.io
names:
kind: HelmRelease
listKind: HelmReleaseList
plural: helmreleases
shortNames:
- hrls
singular: helmrelease
scope: Cluster
versions:
- additionalPrinterColumns:
- jsonPath: .spec.name
name: Release Name
type: string
- jsonPath: .metadata.labels.kubesphere\.io/workspace
name: Workspace
type: string
- jsonPath: .metadata.labels.kubesphere\.io/cluster
name: Cluster
type: string
- jsonPath: .metadata.labels.kubesphere\.io/namespace
name: Namespace
type: string
- jsonPath: .status.state
name: State
type: string
- jsonPath: .metadata.creationTimestamp
name: Age
type: date
name: v1alpha1
schema:
openAPIV3Schema:
description: HelmRelease is the Schema for the helmreleases API
properties:
apiVersion:
description: 'APIVersion defines the versioned schema of this representation of an object. Servers should convert recognized schemas to the latest internal value, and may reject unrecognized values. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#resources'
type: string
kind:
description: 'Kind is a string value representing the REST resource this object represents. Servers may infer this from the endpoint the client submits requests to. Cannot be updated. In CamelCase. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#types-kinds'
type: string
metadata:
type: object
spec:
description: HelmReleaseSpec defines the desired state of HelmRelease
properties:
appId:
description: id of the helmapplication
type: string
appVerId:
description: application version id
type: string
chartAppVer:
description: appVersion from Chart.yaml
type: string
chartName:
description: The name of the chart which will be installed.
type: string
chartVersion:
description: Specify the exact chart version to install. If this is not specified, the latest version is installed
type: string
description:
description: Message got from frontend
type: string
name:
description: Name of the release
type: string
repoId:
description: id of the repo
type: string
values:
description: helm release values.yaml
format: byte
type: string
version:
description: expected release version, when this version is not equal status.version, the release need upgrade this filed should be modified when any filed of the spec modified.
type: integer
required:
- chartName
- chartVersion
- name
- version
type: object
status:
description: HelmReleaseStatus defines the observed state of HelmRelease
properties:
deployStatus:
description: deploy status list of history, which will store at most 10 state
items:
properties:
deployTime:
description: deploy time
format: date-time
type: string
message:
description: A human readable message indicating details about why the release is in this state.
type: string
state:
description: deploy state
type: string
required:
- deployTime
- state
type: object
type: array
lastDeployed:
description: last successful deploy time
format: date-time
type: string
lastUpdate:
description: last update time
format: date-time
type: string
message:
description: A human readable message indicating details about why the release is in this state.
type: string
state:
description: current state
type: string
version:
description: current release version
type: integer
required:
- state
type: object
type: object
served: true
storage: true
subresources:
status: {}
status:
acceptedNames:
kind: ""
plural: ""
conditions: []
storedVersions: []
---
apiVersion: apiextensions.k8s.io/v1
kind: CustomResourceDefinition
metadata:
annotations:
controller-gen.kubebuilder.io/version: (devel)
creationTimestamp: null
name: helmrepos.application.kubesphere.io
spec:
group: application.kubesphere.io
names:
kind: HelmRepo
listKind: HelmRepoList
plural: helmrepos
shortNames:
- hrepo
singular: helmrepo
scope: Cluster
versions:
- additionalPrinterColumns:
- jsonPath: .spec.name
name: name
type: string
- jsonPath: .metadata.labels.kubesphere\\.io/workspace
name: Workspace
type: string
- jsonPath: .spec.url
name: url
type: string
- jsonPath: .status.state
name: State
type: string
- jsonPath: .metadata.creationTimestamp
name: Age
type: date
name: v1alpha1
schema:
openAPIV3Schema:
description: HelmRepo is the Schema for the helmrepoes API
properties:
apiVersion:
description: 'APIVersion defines the versioned schema of this representation of an object. Servers should convert recognized schemas to the latest internal value, and may reject unrecognized values. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#resources'
type: string
kind:
description: 'Kind is a string value representing the REST resource this object represents. Servers may infer this from the endpoint the client submits requests to. Cannot be updated. In CamelCase. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#types-kinds'
type: string
metadata:
type: object
spec:
description: HelmRepoSpec defines the desired state of HelmRepo
properties:
credential:
description: helm repo credential
properties:
accessKeyID:
type: string
caFile:
description: verify certificates of HTTPS-enabled servers using this CA bundle
type: string
certFile:
description: identify HTTPS client using this SSL certificate file
type: string
insecureSkipTLSVerify:
description: skip tls certificate checks for the repository, default is ture
type: boolean
keyFile:
description: identify HTTPS client using this SSL key file
type: string
password:
description: chart repository password
type: string
secretAccessKey:
type: string
username:
description: chart repository username
type: string
type: object
description:
description: chart repo description from frontend
type: string
name:
description: name of the repo
type: string
syncPeriod:
description: sync period in seconds, no sync when SyncPeriod=0, the minimum SyncPeriod is 180s
type: integer
url:
description: helm repo url
type: string
version:
description: expected repo version, when this version is not equal status.version, the repo need upgrade this filed should be modified when any filed of the spec modified.
type: integer
required:
- name
- url
type: object
status:
description: HelmRepoStatus defines the observed state of HelmRepo
properties:
data:
description: repo index
type: string
lastUpdateTime:
description: status last update time
format: date-time
type: string
state:
description: current state of the repo, successful, failed or syncing
type: string
syncState:
description: sync state list of history, which will store at most 10 state
items:
properties:
message:
description: A human readable message indicating details about why the repo is in this state.
type: string
state:
description: 'last sync state, valid state are: "failed", "success", and ""'
type: string
syncTime:
format: date-time
type: string
required:
- syncTime
type: object
type: array
version:
description: if status.version!=spec.Version, we need sync the repo now
type: integer
type: object
type: object
served: true
storage: true
subresources:
status: {}
status:
acceptedNames:
kind: ""
plural: ""
conditions: []
storedVersions: []
......@@ -8,8 +8,9 @@ go 1.13
require (
code.cloudfoundry.org/bytefmt v0.0.0-20190710193110-1eb035ffe2b6
github.com/Masterminds/semver/v3 v3.1.0
github.com/PuerkitoBio/goquery v1.5.0
github.com/asaskevich/govalidator v0.0.0-20200108200545-475eaeb16496
github.com/asaskevich/govalidator v0.0.0-20200428143746-21a406dcc535
github.com/aws/aws-sdk-go v1.33.12
github.com/beevik/etree v1.1.0
github.com/container-storage-interface/spec v1.2.0
......@@ -18,7 +19,7 @@ require (
github.com/davecgh/go-spew v1.1.1
github.com/dgrijalva/jwt-go v3.2.0+incompatible
github.com/docker/distribution v2.7.1+incompatible
github.com/docker/docker v1.4.2-0.20190822205725-ed20165a37b4
github.com/docker/docker v1.4.2-0.20200203170920-46ec8731fbce
github.com/elastic/go-elasticsearch/v5 v5.6.1
github.com/elastic/go-elasticsearch/v6 v6.8.2
github.com/elastic/go-elasticsearch/v7 v7.3.0
......@@ -53,7 +54,7 @@ require (
github.com/onsi/ginkgo v1.14.0
github.com/onsi/gomega v1.10.1
github.com/open-policy-agent/opa v0.18.0
github.com/opencontainers/go-digest v1.0.0-rc1
github.com/opencontainers/go-digest v1.0.0
github.com/patrickmn/go-cache v2.1.0+incompatible // indirect
github.com/pkg/errors v0.9.1
github.com/projectcalico/kube-controllers v3.8.8+incompatible
......@@ -66,6 +67,7 @@ require (
github.com/prometheus/prometheus v1.8.2-0.20200907175821-8219b442c864
github.com/sony/sonyflake v1.0.0
github.com/speps/go-hashids v2.0.0+incompatible
github.com/spf13/afero v1.2.2
github.com/spf13/cobra v1.0.0
github.com/spf13/pflag v1.0.5
github.com/spf13/viper v1.4.0
......@@ -83,6 +85,7 @@ require (
gopkg.in/yaml.v2 v2.3.0
gopkg.in/yaml.v3 v3.0.0-20200615113413-eeeca48fe776
gotest.tools v2.2.0+incompatible
helm.sh/helm/v3 v3.3.0
istio.io/api v0.0.0-20201113182140-d4b7e3fc2b44
istio.io/client-go v0.0.0-20201113183938-0734e976e785
istio.io/gogo-genproto v0.0.0-20201113182723-5b8563d8a012 // indirect
......@@ -106,6 +109,7 @@ require (
sigs.k8s.io/controller-runtime v0.6.4
sigs.k8s.io/controller-tools v0.4.0
sigs.k8s.io/kubefed v0.4.0
sigs.k8s.io/yaml v1.2.0
)
replace (
......@@ -250,7 +254,7 @@ replace (
github.com/disintegration/imaging => github.com/disintegration/imaging v1.6.1
github.com/docker/cli => github.com/docker/cli v0.0.0-20190506213505-d88565df0c2d
github.com/docker/distribution => github.com/docker/distribution v2.7.1+incompatible
github.com/docker/docker => github.com/docker/engine v1.4.2-0.20190822205725-ed20165a37b4
github.com/docker/docker => github.com/docker/engine v1.4.2-0.20200203170920-46ec8731fbce
github.com/docker/docker-credential-helpers => github.com/docker/docker-credential-helpers v0.6.1
github.com/docker/go-connections => github.com/docker/go-connections v0.4.0
github.com/docker/go-metrics => github.com/docker/go-metrics v0.0.0-20181218153428-b84716841b82
......@@ -528,7 +532,7 @@ replace (
github.com/onsi/gomega => github.com/onsi/gomega v1.10.1
github.com/op/go-logging => github.com/op/go-logging v0.0.0-20160315200505-970db520ece7
github.com/open-policy-agent/opa => github.com/open-policy-agent/opa v0.18.0
github.com/opencontainers/go-digest => github.com/opencontainers/go-digest v1.0.0-rc1
github.com/opencontainers/go-digest => github.com/opencontainers/go-digest v1.0.0
github.com/opencontainers/image-spec => github.com/opencontainers/image-spec v1.0.1
github.com/opencontainers/runc => github.com/opencontainers/runc v0.1.1
github.com/opentracing-contrib/go-grpc => github.com/opentracing-contrib/go-grpc v0.0.0-20180928155321-4b5a12d3ff02
......@@ -661,7 +665,7 @@ replace (
go.uber.org/multierr => go.uber.org/multierr v1.3.0
go.uber.org/tools => go.uber.org/tools v0.0.0-20190618225709-2cfd321de3ee
go.uber.org/zap => go.uber.org/zap v1.13.0
golang.org/x/crypto => golang.org/x/crypto v0.0.0-20190308221718-c2843e01d9a2
golang.org/x/crypto => golang.org/x/crypto v0.0.0-20200622213623-75b288015ac9
golang.org/x/exp => golang.org/x/exp v0.0.0-20190121172915-509febef88a4
golang.org/x/image => golang.org/x/image v0.0.0-20180708004352-c73c2afc3b81
golang.org/x/lint => golang.org/x/lint v0.0.0-20190301231843-5614ed5bae6f
......@@ -714,7 +718,7 @@ replace (
gopkg.in/yaml.v2 => gopkg.in/yaml.v2 v2.3.0
gopkg.in/yaml.v3 => gopkg.in/yaml.v3 v3.0.0-20200313102051-9f266ea9e77c
gotest.tools => gotest.tools v2.2.0+incompatible
helm.sh/helm/v3 => helm.sh/helm/v3 v3.0.1
helm.sh/helm/v3 => helm.sh/helm/v3 v3.3.0
honnef.co/go/tools => honnef.co/go/tools v0.0.1-2020.1.3
howett.net/plist => howett.net/plist v0.0.0-20181124034731-591f970eefbb
istio.io/api => istio.io/api v0.0.0-20201113182140-d4b7e3fc2b44
......
此差异已折叠。
......@@ -2,7 +2,8 @@
set -e
GV="network:v1alpha1 servicemesh:v1alpha2 tenant:v1alpha1 tenant:v1alpha2 devops:v1alpha1 iam:v1alpha2 devops:v1alpha3 cluster:v1alpha1 storage:v1alpha1 auditing:v1alpha1 types:v1beta1 quota:v1alpha2"
GV="network:v1alpha1 servicemesh:v1alpha2 tenant:v1alpha1 tenant:v1alpha2 devops:v1alpha1 iam:v1alpha2 devops:v1alpha3 cluster:v1alpha1 storage:v1alpha1 auditing:v1alpha1 types:v1beta1 quota:v1alpha2 application:v1alpha1"
rm -rf ./pkg/client
./hack/generate_group.sh "client,lister,informer" kubesphere.io/kubesphere/pkg/client kubesphere.io/kubesphere/pkg/apis "$GV" --output-base=./ -h "$PWD/hack/boilerplate.go.txt"
......
/*
Copyright 2019 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.
*/
package apis
import (
"kubesphere.io/kubesphere/pkg/apis/application/v1alpha1"
)
func init() {
AddToSchemes = append(AddToSchemes, v1alpha1.SchemeBuilder.AddToScheme)
}
/*
Copyright 2020 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.
*/
package crdinstall
import (
k8sruntime "k8s.io/apimachinery/pkg/runtime"
urlruntime "k8s.io/apimachinery/pkg/util/runtime"
"kubesphere.io/kubesphere/pkg/apis/application/v1alpha1"
)
func Install(scheme *k8sruntime.Scheme) {
urlruntime.Must(v1alpha1.AddToScheme(scheme))
urlruntime.Must(scheme.SetVersionPriority(v1alpha1.SchemeGroupVersion))
}
/*
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.
*/
package application
/*
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.
*/
package v1alpha1
const (
MsgLen = 512
HelmRepoSyncStateLen = 10
// app version state
StateDraft = "draft"
StateSubmitted = "submitted"
StatePassed = "passed"
StateRejected = "rejected"
StateSuspended = "suspended"
StateActive = "active"
// repo state
RepoStateSuccessful = "successful"
RepoStateFailed = "failed"
RepoStateSyncing = "syncing"
// helm release state
HelmStatusActive = "active"
HelmStatusCreating = "creating"
HelmStatusDeleting = "deleting"
HelmStatusUpgrading = "upgrading"
HelmStatusRollbacking = "rollbacking"
HelmStatusPending = "pending"
HelmStatusSuccessful = "successful"
HelmStatusFailed = "failed"
AttachmentTypeScreenshot = "screenshot"
AttachmentTypeIcon = "icon"
HelmApplicationAppStoreSuffix = "-store"
HelmApplicationIdPrefix = "app-"
HelmRepoIdPrefix = "repo-"
HelmApplicationVersionIdPrefix = "appv-"
HelmCategoryIdPrefix = "ctg-"
HelmAttachmentPrefix = "att-"
HelmReleasePrefix = "rls-"
UncategorizedName = "uncategorized"
UncategorizedId = "ctg-uncategorized"
AppStoreRepoId = "repo-helm"
OriginWorkspaceLabelKey = "kubesphere.io/workspace-origin"
)
/*
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.
*/
// +k8s:deepcopy-gen=package,register
// +groupName=application.kubesphere.io
package v1alpha1
/*
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.
*/
package v1alpha1
import (
metav1 "k8s.io/apimachinery/pkg/apis/meta/v1"
"kubesphere.io/kubesphere/pkg/constants"
"strings"
)
const (
ResourceKindHelmApplication = "HelmApplication"
ResourceSingularHelmApplication = "helmapplication"
ResourcePluralHelmApplication = "helmapplications"
)
// HelmApplicationSpec defines the desired state of HelmApplication
type HelmApplicationSpec struct {
// the name of the helm application
Name string `json:"name"`
// description from chart's description or frontend
Description string `json:"description,omitempty"`
// attachments id
Attachments []string `json:"attachments,omitempty"`
// info from frontend
Abstraction string `json:"abstraction,omitempty"`
AppHome string `json:"appHome,omitempty"`
// The attachment id of the icon
Icon string `json:"icon,omitempty"`
}
// HelmApplicationStatus defines the observed state of HelmApplication
type HelmApplicationStatus struct {
// If this application belong to appStore, latestVersion is the the latest version of the active application version.
// otherwise latestVersion is the latest version of all application version
LatestVersion string `json:"latestVersion,omitempty"`
// the state of the helm application: draft, submitted, passed, rejected, suspended, active
State string `json:"state,omitempty"`
UpdateTime *metav1.Time `json:"updateTime"`
StatusTime *metav1.Time `json:"statusTime"`
}
// +kubebuilder:object:root=true
// +kubebuilder:resource:scope=Cluster,shortName=happ
// +kubebuilder:subresource:status
// +kubebuilder:printcolumn:name="application name",type=string,JSONPath=`.spec.name`
// +kubebuilder:printcolumn:name="workspace",type="string",JSONPath=".metadata.labels.kubesphere\\.io/workspace"
// +kubebuilder:printcolumn:name="State",type="string",JSONPath=".status.state"
// +kubebuilder:printcolumn:name="Age",type="date",JSONPath=".metadata.creationTimestamp"
// +genclient
// +genclient:nonNamespaced
// HelmApplication is the Schema for the helmapplications API
type HelmApplication struct {
metav1.TypeMeta `json:",inline"`
metav1.ObjectMeta `json:"metadata,omitempty"`
Spec HelmApplicationSpec `json:"spec,omitempty"`
Status HelmApplicationStatus `json:"status,omitempty"`
}
// +kubebuilder:object:root=true
// HelmApplicationList contains a list of HelmApplication
type HelmApplicationList struct {
metav1.TypeMeta `json:",inline"`
metav1.ListMeta `json:"metadata,omitempty"`
Items []HelmApplication `json:"items"`
}
func init() {
SchemeBuilder.Register(&HelmApplication{}, &HelmApplicationList{})
}
func (in *HelmApplication) GetTrueName() string {
return in.Spec.Name
}
func (in *HelmApplication) GetHelmRepoId() string {
return getValue(in.Labels, constants.ChartRepoIdLabelKey)
}
func (in *HelmApplication) GetHelmApplicationId() string {
return strings.TrimSuffix(in.Name, HelmApplicationAppStoreSuffix)
}
func (in *HelmApplication) GetHelmCategoryId() string {
return getValue(in.Labels, constants.CategoryIdLabelKey)
}
func (in *HelmApplication) GetWorkspace() string {
ws := getValue(in.Labels, constants.WorkspaceLabelKey)
if ws == "" {
return getValue(in.Labels, OriginWorkspaceLabelKey)
}
return ws
}
func getValue(m map[string]string, key string) string {
if m == nil {
return ""
}
return m[key]
}
func (in *HelmApplication) GetCategoryId() string {
return getValue(in.Labels, constants.CategoryIdLabelKey)
}
func (in *HelmApplication) State() string {
if in.Status.State == "" {
return StateDraft
}
return in.Status.State
}
/*
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.
*/
package v1alpha1
import (
"fmt"
metav1 "k8s.io/apimachinery/pkg/apis/meta/v1"
"kubesphere.io/kubesphere/pkg/constants"
"strings"
)
const (
ResourceKindHelmApplicationVersion = "HelmApplicationVersion"
ResourceSingularHelmApplicationVersion = "helmapplicationversion"
ResourcePluralHelmApplicationVersion = "helmapplicationversions"
)
// HelmApplicationVersionSpec defines the desired state of HelmApplicationVersion
type HelmApplicationVersionSpec struct {
// metadata from chart
*Metadata `json:",inline"`
// chart url
URLs []string `json:"urls,omitempty"`
// raw data of chart, it will !!!NOT!!! be save to etcd
Data []byte `json:"data,omitempty"`
// dataKey in the storage
DataKey string `json:"dataKey,omitempty"`
// chart create time
Created *metav1.Time `json:"created,omitempty"`
// chart digest
Digest string `json:"digest,omitempty"`
}
// HelmApplicationVersionStatus defines the observed state of HelmApplicationVersion
type HelmApplicationVersionStatus struct {
State string `json:"state,omitempty"`
Audit []Audit `json:"audit,omitempty"`
}
// +kubebuilder:object:root=true
// +kubebuilder:resource:scope=Cluster,shortName=happver
// +kubebuilder:subresource:status
// +kubebuilder:printcolumn:name="application name",type=string,JSONPath=`.spec.name`
// +kubebuilder:printcolumn:name="State",type="string",JSONPath=".status.state"
// +kubebuilder:printcolumn:name="Age",type="date",JSONPath=".metadata.creationTimestamp"
// +genclient
// +genclient:nonNamespaced
// HelmApplicationVersion is the Schema for the helmapplicationversions API
type HelmApplicationVersion struct {
metav1.TypeMeta `json:",inline"`
metav1.ObjectMeta `json:"metadata,omitempty"`
Spec HelmApplicationVersionSpec `json:"spec,omitempty"`
Status HelmApplicationVersionStatus `json:"status,omitempty"`
}
// Maintainer describes a Chart maintainer.
type Maintainer struct {
// Name is a user name or organization name
Name string `json:"name,omitempty"`
// Email is an optional email address to contact the named maintainer
Email string `json:"email,omitempty"`
// URL is an optional URL to an address for the named maintainer
URL string `json:"url,omitempty"`
}
// Metadata for a Chart file. This models the structure of a Chart.yaml file.
type Metadata struct {
// The name of the chart
Name string `json:"name,omitempty"`
// The URL to a relevant project page, git repo, or contact person
Home string `json:"home,omitempty"`
// Source is the URL to the source code of this chart
Sources []string `json:"sources,omitempty"`
// A SemVer 2 conformant version string of the chart
Version string `json:"version,omitempty"`
// A one-sentence description of the chart
Description string `json:"description,omitempty"`
// A list of string keywords
Keywords []string `json:"keywords,omitempty"`
// A list of name and URL/email address combinations for the maintainer(s)
Maintainers []*Maintainer `json:"maintainers,omitempty"`
// The URL to an icon file.
Icon string `json:"icon,omitempty"`
// The API Version of this chart.
APIVersion string `json:"apiVersion,omitempty"`
// The condition to check to enable chart
Condition string `json:"condition,omitempty"`
// The tags to check to enable chart
Tags string `json:"tags,omitempty"`
// The version of the application enclosed inside of this chart.
AppVersion string `json:"appVersion,omitempty"`
// Whether or not this chart is deprecated
Deprecated bool `json:"deprecated,omitempty"`
// Annotations are additional mappings uninterpreted by Helm,
// made available for inspection by other applications.
Annotations map[string]string `json:"annotations,omitempty"`
// KubeVersion is a SemVer constraint specifying the version of Kubernetes required.
KubeVersion string `json:"kubeVersion,omitempty"`
// Dependencies are a list of dependencies for a chart.
Dependencies []*Dependency `json:"dependencies,omitempty"`
// Specifies the chart type: application or library
Type string `json:"type,omitempty"`
}
type Audit struct {
// audit message
Message string `json:"message,omitempty"`
// audit state: submitted, passed, draft, active, rejected, suspended
State string `json:"state,omitempty"`
// audit time
Time metav1.Time `json:"time"`
// audit operator
Operator string `json:"operator,omitempty"`
OperatorType string `json:"operatorType,omitempty"`
}
// Dependency describes a chart upon which another chart depends.
// Dependencies can be used to express developer intent, or to capture the state
// of a chart.
type Dependency struct {
// Name is the name of the dependency.
// This must mach the name in the dependency's Chart.yaml.
Name string `json:"name"`
// Version is the version (range) of this chart.
// A lock file will always produce a single version, while a dependency
// may contain a semantic version range.
Version string `json:"version,omitempty"`
// The URL to the repository.
// Appending `index.yaml` to this string should result in a URL that can be
// used to fetch the repository index.
Repository string `json:"repository"`
// A yaml path that resolves to a boolean, used for enabling/disabling charts (e.g. subchart1.enabled )
Condition string `json:"condition,omitempty"`
// Tags can be used to group charts for enabling/disabling together
Tags []string `json:"tags,omitempty"`
// Enabled bool determines if chart should be loaded
Enabled bool `json:"enabled,omitempty"`
// ImportValues holds the mapping of source values to parent key to be imported. Each item can be a
// string or pair of child/parent sublist items.
// ImportValues []interface{} `json:"import_values,omitempty"`
// Alias usable alias to be used for the chart
Alias string `json:"alias,omitempty"`
}
// +kubebuilder:object:root=true
// HelmApplicationVersionList contains a list of HelmApplicationVersion
type HelmApplicationVersionList struct {
metav1.TypeMeta `json:",inline"`
metav1.ListMeta `json:"metadata,omitempty"`
Items []HelmApplicationVersion `json:"items"`
}
func init() {
SchemeBuilder.Register(&HelmApplicationVersion{}, &HelmApplicationVersionList{})
}
func (in *HelmApplicationVersion) GetCreator() string {
return getValue(in.Annotations, constants.CreatorAnnotationKey)
}
func (in *HelmApplicationVersion) GetHelmApplicationVersionId() string {
return in.Name
}
func (in *HelmApplicationVersion) GetWorkspace() string {
return getValue(in.Labels, constants.WorkspaceLabelKey)
}
func (in *HelmApplicationVersion) GetVersionName() string {
appV := in.GetChartAppVersion()
if appV != "" {
return fmt.Sprintf("%s [%s]", in.GetChartVersion(), appV)
} else {
return in.GetChartVersion()
}
}
func (in *HelmApplicationVersion) GetHelmApplicationId() string {
return getValue(in.Labels, constants.ChartApplicationIdLabelKey)
}
func (in *HelmApplicationVersion) GetSemver() string {
return strings.Split(in.GetVersionName(), " ")[0]
}
func (in *HelmApplicationVersion) GetTrueName() string {
return in.Spec.Name
}
func (in *HelmApplicationVersion) GetChartVersion() string {
return in.Spec.Version
}
func (in *HelmApplicationVersion) GetChartAppVersion() string {
return in.Spec.AppVersion
}
func (in *HelmApplicationVersion) GetHelmRepoId() string {
return getValue(in.Labels, constants.ChartRepoIdLabelKey)
}
func (in *HelmApplicationVersion) State() string {
if in.Status.State == "" {
return StateDraft
}
return in.Status.State
}
/*
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.
*/
package v1alpha1
import (
metav1 "k8s.io/apimachinery/pkg/apis/meta/v1"
)
const (
ResourceKindHelmCategory = "HelmCategory"
ResourceSingularHelmCategory = "helmcategory"
ResourcePluralHelmCategory = "helmcategories"
)
// HelmCategorySpec defines the desired state of HelmRepo
type HelmCategorySpec struct {
// name of the category
Name string `json:"name"`
// info from frontend
Description string `json:"description,omitempty"`
Locale string `json:"locale,omitempty"`
}
// +kubebuilder:object:root=true
// +kubebuilder:resource:scope=Cluster,shortName=hctg
// +kubebuilder:subresource:status
// +kubebuilder:printcolumn:name="name",type=string,JSONPath=`.spec.name`
// +kubebuilder:printcolumn:name="total",type=string,JSONPath=`.status.total`
// +kubebuilder:printcolumn:name="Age",type="date",JSONPath=".metadata.creationTimestamp"
// +genclient
// +genclient:nonNamespaced
// HelmCategory is the Schema for the helmcategories API
type HelmCategory struct {
metav1.TypeMeta `json:",inline"`
metav1.ObjectMeta `json:"metadata,omitempty"`
Spec HelmCategorySpec `json:"spec,omitempty"`
Status HelmCategoryStatus `json:"status,omitempty"`
}
type HelmCategoryStatus struct {
// total helmapplications belong to this category
Total int `json:"total"`
}
// +kubebuilder:object:root=true
// HelmCategoryList contains a list of HelmCategory
type HelmCategoryList struct {
metav1.TypeMeta `json:",inline"`
metav1.ListMeta `json:"metadata,omitempty"`
Items []HelmCategory `json:"items"`
}
func (in *HelmCategory) GetTrueName() string {
if in == nil {
return ""
}
return in.Spec.Name
}
func init() {
SchemeBuilder.Register(&HelmCategory{}, &HelmCategoryList{})
}
/*
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.
*/
package v1alpha1
import (
"fmt"
metav1 "k8s.io/apimachinery/pkg/apis/meta/v1"
"kubesphere.io/kubesphere/pkg/constants"
)
const (
ResourceKindHelmRelease = "HelmRelease"
ResourceSingularHelmRelease = "helmrelease"
ResourcePluralHelmRelease = "helmreleases"
)
// HelmReleaseSpec defines the desired state of HelmRelease
type HelmReleaseSpec struct {
// Name of the release
Name string `json:"name"`
// Message got from frontend
Description string `json:"description,omitempty"`
// helm release values.yaml
Values []byte `json:"values,omitempty"`
// The name of the chart which will be installed.
ChartName string `json:"chartName"`
// Specify the exact chart version to install. If this is not specified, the latest version is installed
ChartVersion string `json:"chartVersion"`
// appVersion from Chart.yaml
ChartAppVersion string `json:"chartAppVer,omitempty"`
// id of the repo
RepoId string `json:"repoId,omitempty"`
// id of the helmapplication
ApplicationId string `json:"appId,omitempty"`
// application version id
ApplicationVersionId string `json:"appVerId,omitempty"`
// expected release version, when this version is not equal status.version, the release need upgrade
// this filed should be modified when any filed of the spec modified.
Version int `json:"version"`
}
type HelmReleaseDeployStatus struct {
// A human readable message indicating details about why the release is in this state.
Message string `json:"message,omitempty"`
// deploy state
State string `json:"state"`
// deploy time
Time metav1.Time `json:"deployTime"`
}
// HelmReleaseStatus defines the observed state of HelmRelease
type HelmReleaseStatus struct {
// current state
State string `json:"state"`
// A human readable message indicating details about why the release is in this state.
Message string `json:"message,omitempty"`
// current release version
Version int `json:"version,omitempty"`
// deploy status list of history, which will store at most 10 state
DeployStatus []HelmReleaseDeployStatus `json:"deployStatus,omitempty"`
// last update time
LastUpdate metav1.Time `json:"lastUpdate,omitempty"`
// last successful deploy time
LastDeployed *metav1.Time `json:"lastDeployed,omitempty"`
}
// +kubebuilder:object:root=true
// +kubebuilder:resource:scope=Cluster,shortName=hrls
// +kubebuilder:subresource:status
// +kubebuilder:printcolumn:name="Release Name",type=string,JSONPath=".spec.name"
// +kubebuilder:printcolumn:name="Workspace",type="string",JSONPath=".metadata.labels.kubesphere\\.io/workspace"
// +kubebuilder:printcolumn:name="Cluster",type="string",JSONPath=".metadata.labels.kubesphere\\.io/cluster"
// +kubebuilder:printcolumn:name="Namespace",type="string",JSONPath=".metadata.labels.kubesphere\\.io/namespace"
// +kubebuilder:printcolumn:name="State",type="string",JSONPath=".status.state"
// +kubebuilder:printcolumn:name="Age",type="date",JSONPath=".metadata.creationTimestamp"
// +genclient
// +genclient:nonNamespaced
// HelmRelease is the Schema for the helmreleases API
type HelmRelease struct {
metav1.TypeMeta `json:",inline"`
metav1.ObjectMeta `json:"metadata,omitempty"`
Spec HelmReleaseSpec `json:"spec,omitempty"`
Status HelmReleaseStatus `json:"status,omitempty"`
}
// +kubebuilder:object:root=true
// HelmReleaseList contains a list of HelmRelease
type HelmReleaseList struct {
metav1.TypeMeta `json:",inline"`
metav1.ListMeta `json:"metadata,omitempty"`
Items []HelmRelease `json:"items"`
}
func init() {
SchemeBuilder.Register(&HelmRelease{}, &HelmReleaseList{})
}
func (in *HelmRelease) GetCreator() string {
return getValue(in.Annotations, constants.CreatorAnnotationKey)
}
func (in *HelmRelease) GetTrueName() string {
return in.Spec.Name
}
func (in *HelmRelease) GetChartVersionName() string {
appV := in.GetChartAppVersion()
if appV != "" {
return fmt.Sprintf("%s [%s]", in.GetChartVersion(), appV)
} else {
return in.GetChartVersion()
}
}
func (in *HelmRelease) GetChartAppVersion() string {
return in.Spec.ChartAppVersion
}
func (in *HelmRelease) GetChartVersion() string {
return in.Spec.ChartVersion
}
func (in *HelmRelease) GetRlsCluster() string {
return getValue(in.Labels, constants.ClusterNameLabelKey)
}
func (in *HelmRelease) GetWorkspace() string {
return getValue(in.Labels, constants.WorkspaceLabelKey)
}
func (in *HelmRelease) GetRlsNamespace() string {
return getValue(in.Labels, constants.NamespaceLabelKey)
}
/*
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.
*/
package v1alpha1
import (
metav1 "k8s.io/apimachinery/pkg/apis/meta/v1"
"kubesphere.io/kubesphere/pkg/constants"
)
const (
ResourceKindHelmRepo = "HelmRepo"
ResourceSingularHelmRepo = "helmrepo"
ResourcePluralHelmRepo = "helmrepos"
)
type HelmRepoCredential struct {
// chart repository username
Username string `json:"username,omitempty"`
// chart repository password
Password string `json:"password,omitempty"`
// identify HTTPS client using this SSL certificate file
CertFile string `json:"certFile,omitempty"`
// identify HTTPS client using this SSL key file
KeyFile string `json:"keyFile,omitempty"`
// verify certificates of HTTPS-enabled servers using this CA bundle
CAFile string `json:"caFile,omitempty"`
// skip tls certificate checks for the repository, default is ture
InsecureSkipTLSVerify *bool `json:"insecureSkipTLSVerify,omitempty"`
S3Config `json:",inline"`
}
type S3Config struct {
AccessKeyID string `json:"accessKeyID,omitempty"`
SecretAccessKey string `json:"secretAccessKey,omitempty"`
}
// HelmRepoSpec defines the desired state of HelmRepo
type HelmRepoSpec struct {
// name of the repo
Name string `json:"name"`
// helm repo url
Url string `json:"url"`
// helm repo credential
Credential HelmRepoCredential `json:"credential,omitempty"`
// chart repo description from frontend
Description string `json:"description,omitempty"`
// sync period in seconds, no sync when SyncPeriod=0, the minimum SyncPeriod is 180s
SyncPeriod int `json:"syncPeriod,omitempty"`
// expected repo version, when this version is not equal status.version, the repo need upgrade
// this filed should be modified when any filed of the spec modified.
Version int `json:"version,omitempty"`
}
type HelmRepoSyncState struct {
// last sync state, valid state are: "failed", "success", and ""
State string `json:"state,omitempty"`
// A human readable message indicating details about why the repo is in this state.
Message string `json:"message,omitempty"`
SyncTime *metav1.Time `json:"syncTime"`
}
// HelmRepoStatus defines the observed state of HelmRepo
type HelmRepoStatus struct {
// repo index
Data string `json:"data,omitempty"`
// status last update time
LastUpdateTime *metav1.Time `json:"lastUpdateTime,omitempty"`
// current state of the repo, successful, failed or syncing
State string `json:"state,omitempty"`
// sync state list of history, which will store at most 10 state
SyncState []HelmRepoSyncState `json:"syncState,omitempty"`
// if status.version!=spec.Version, we need sync the repo now
Version int `json:"version,omitempty"`
}
// +kubebuilder:object:root=true
// +kubebuilder:resource:scope=Cluster,path=helmrepos,shortName=hrepo
// +kubebuilder:subresource:status
// +kubebuilder:printcolumn:name="name",type=string,JSONPath=`.spec.name`
// +kubebuilder:printcolumn:name="Workspace",type=string,JSONPath=`.metadata.labels.kubesphere\\.io/workspace`
// +kubebuilder:printcolumn:name="url",type=string,JSONPath=`.spec.url`
// +kubebuilder:printcolumn:name="State",type="string",JSONPath=".status.state"
// +kubebuilder:printcolumn:name="Age",type="date",JSONPath=".metadata.creationTimestamp"
// +genclient
// +genclient:nonNamespaced
// HelmRepo is the Schema for the helmrepoes API
type HelmRepo struct {
metav1.TypeMeta `json:",inline"`
metav1.ObjectMeta `json:"metadata,omitempty"`
Spec HelmRepoSpec `json:"spec,omitempty"`
Status HelmRepoStatus `json:"status,omitempty"`
}
// +kubebuilder:object:root=true
// HelmRepoList contains a list of HelmRepo
type HelmRepoList struct {
metav1.TypeMeta `json:",inline"`
metav1.ListMeta `json:"metadata,omitempty"`
Items []HelmRepo `json:"items"`
}
func init() {
SchemeBuilder.Register(&HelmRepo{}, &HelmRepoList{})
}
func (in *HelmRepo) GetTrueName() string {
return in.Spec.Name
}
func (in *HelmRepo) GetHelmRepoId() string {
return in.Name
}
func (in *HelmRepo) GetWorkspace() string {
return getValue(in.Labels, constants.WorkspaceLabelKey)
}
func (in *HelmRepo) GetCreator() string {
return getValue(in.Annotations, constants.CreatorAnnotationKey)
}
/*
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.
*/
// Package v1alpha1 contains API Schema definitions for the application v1alpha1 API group
// +kubebuilder:object:generate=true
// +groupName=application.kubesphere.io
package v1alpha1
import (
"k8s.io/apimachinery/pkg/runtime/schema"
"sigs.k8s.io/controller-runtime/pkg/scheme"
)
var (
// SchemeGroupVersion is group version used to register these objects
SchemeGroupVersion = schema.GroupVersion{Group: "application.kubesphere.io", Version: "v1alpha1"}
// SchemeBuilder is used to add go types to the GroupVersionKind scheme
SchemeBuilder = &scheme.Builder{GroupVersion: SchemeGroupVersion}
// AddToScheme adds the types in this group-version to the given scheme.
AddToScheme = SchemeBuilder.AddToScheme
)
func Resource(resource string) schema.GroupResource {
return SchemeGroupVersion.WithResource(resource).GroupResource()
}
此差异已折叠。
......@@ -16,7 +16,7 @@ See the License for the specific language governing permissions and
limitations under the License.
*/
// Code generated by deepcopy-gen. DO NOT EDIT.
// Code generated by controller-gen. DO NOT EDIT.
package v1alpha1
......@@ -31,7 +31,6 @@ func (in *Cluster) DeepCopyInto(out *Cluster) {
in.ObjectMeta.DeepCopyInto(&out.ObjectMeta)
in.Spec.DeepCopyInto(&out.Spec)
in.Status.DeepCopyInto(&out.Status)
return
}
// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new Cluster.
......@@ -57,7 +56,6 @@ func (in *ClusterCondition) DeepCopyInto(out *ClusterCondition) {
*out = *in
in.LastUpdateTime.DeepCopyInto(&out.LastUpdateTime)
in.LastTransitionTime.DeepCopyInto(&out.LastTransitionTime)
return
}
// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new ClusterCondition.
......@@ -82,7 +80,6 @@ func (in *ClusterList) DeepCopyInto(out *ClusterList) {
(*in)[i].DeepCopyInto(&(*out)[i])
}
}
return
}
// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new ClusterList.
......@@ -107,7 +104,6 @@ func (in *ClusterList) DeepCopyObject() runtime.Object {
func (in *ClusterSpec) DeepCopyInto(out *ClusterSpec) {
*out = *in
in.Connection.DeepCopyInto(&out.Connection)
return
}
// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new ClusterSpec.
......@@ -147,7 +143,6 @@ func (in *ClusterStatus) DeepCopyInto(out *ClusterStatus) {
(*out)[key] = val
}
}
return
}
// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new ClusterStatus.
......@@ -168,7 +163,6 @@ func (in *Connection) DeepCopyInto(out *Connection) {
*out = make([]byte, len(*in))
copy(*out, *in)
}
return
}
// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new Connection.
......
......@@ -16,12 +16,12 @@ See the License for the specific language governing permissions and
limitations under the License.
*/
// Code generated by deepcopy-gen. DO NOT EDIT.
// Code generated by controller-gen. DO NOT EDIT.
package v1alpha1
import (
v1 "k8s.io/api/core/v1"
"k8s.io/api/core/v1"
runtime "k8s.io/apimachinery/pkg/runtime"
)
......@@ -33,7 +33,6 @@ func (in *AuthConfig) DeepCopyInto(out *AuthConfig) {
*out = new(v1.LocalObjectReference)
**out = **in
}
return
}
// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new AuthConfig.
......@@ -49,7 +48,6 @@ func (in *AuthConfig) DeepCopy() *AuthConfig {
// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.
func (in *CGroupLimits) DeepCopyInto(out *CGroupLimits) {
*out = *in
return
}
// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new CGroupLimits.
......@@ -77,7 +75,6 @@ func (in *ContainerConfig) DeepCopyInto(out *ContainerConfig) {
*out = make([]string, len(*in))
copy(*out, *in)
}
return
}
// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new ContainerConfig.
......@@ -103,7 +100,6 @@ func (in *ContainerInfo) DeepCopyInto(out *ContainerInfo) {
*out = make([]string, len(*in))
copy(*out, *in)
}
return
}
// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new ContainerInfo.
......@@ -119,7 +115,6 @@ func (in *ContainerInfo) DeepCopy() *ContainerInfo {
// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.
func (in *DockerConfig) DeepCopyInto(out *DockerConfig) {
*out = *in
return
}
// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new DockerConfig.
......@@ -135,7 +130,6 @@ func (in *DockerConfig) DeepCopy() *DockerConfig {
// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.
func (in *DockerConfigEntry) DeepCopyInto(out *DockerConfigEntry) {
*out = *in
return
}
// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new DockerConfigEntry.
......@@ -158,7 +152,6 @@ func (in *DockerConfigJson) DeepCopyInto(out *DockerConfigJson) {
(*out)[key] = val
}
}
return
}
// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new DockerConfigJson.
......@@ -179,7 +172,6 @@ func (in DockerConfigMap) DeepCopyInto(out *DockerConfigMap) {
for key, val := range *in {
(*out)[key] = val
}
return
}
}
......@@ -196,7 +188,6 @@ func (in DockerConfigMap) DeepCopy() DockerConfigMap {
// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.
func (in *EnvironmentSpec) DeepCopyInto(out *EnvironmentSpec) {
*out = *in
return
}
// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new EnvironmentSpec.
......@@ -217,7 +208,6 @@ func (in *Parameter) DeepCopyInto(out *Parameter) {
*out = make([]string, len(*in))
copy(*out, *in)
}
return
}
// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new Parameter.
......@@ -233,7 +223,6 @@ func (in *Parameter) DeepCopy() *Parameter {
// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.
func (in *ProxyConfig) DeepCopyInto(out *ProxyConfig) {
*out = *in
return
}
// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new ProxyConfig.
......@@ -259,7 +248,6 @@ func (in *S2iAutoScale) DeepCopyInto(out *S2iAutoScale) {
*out = make([]string, len(*in))
copy(*out, *in)
}
return
}
// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new S2iAutoScale.
......@@ -279,7 +267,6 @@ func (in *S2iBinary) DeepCopyInto(out *S2iBinary) {
in.ObjectMeta.DeepCopyInto(&out.ObjectMeta)
in.Spec.DeepCopyInto(&out.Spec)
out.Status = in.Status
return
}
// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new S2iBinary.
......@@ -312,7 +299,6 @@ func (in *S2iBinaryList) DeepCopyInto(out *S2iBinaryList) {
(*in)[i].DeepCopyInto(&(*out)[i])
}
}
return
}
// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new S2iBinaryList.
......@@ -340,7 +326,6 @@ func (in *S2iBinarySpec) DeepCopyInto(out *S2iBinarySpec) {
in, out := &in.UploadTimeStamp, &out.UploadTimeStamp
*out = (*in).DeepCopy()
}
return
}
// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new S2iBinarySpec.
......@@ -356,7 +341,6 @@ func (in *S2iBinarySpec) DeepCopy() *S2iBinarySpec {
// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.
func (in *S2iBinaryStatus) DeepCopyInto(out *S2iBinaryStatus) {
*out = *in
return
}
// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new S2iBinaryStatus.
......@@ -377,7 +361,6 @@ func (in *S2iBuildResult) DeepCopyInto(out *S2iBuildResult) {
*out = make([]string, len(*in))
copy(*out, *in)
}
return
}
// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new S2iBuildResult.
......@@ -393,7 +376,6 @@ func (in *S2iBuildResult) DeepCopy() *S2iBuildResult {
// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.
func (in *S2iBuildSource) DeepCopyInto(out *S2iBuildSource) {
*out = *in
return
}
// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new S2iBuildSource.
......@@ -413,7 +395,6 @@ func (in *S2iBuilder) DeepCopyInto(out *S2iBuilder) {
in.ObjectMeta.DeepCopyInto(&out.ObjectMeta)
in.Spec.DeepCopyInto(&out.Spec)
in.Status.DeepCopyInto(&out.Status)
return
}
// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new S2iBuilder.
......@@ -446,7 +427,6 @@ func (in *S2iBuilderList) DeepCopyInto(out *S2iBuilderList) {
(*in)[i].DeepCopyInto(&(*out)[i])
}
}
return
}
// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new S2iBuilderList.
......@@ -480,7 +460,6 @@ func (in *S2iBuilderSpec) DeepCopyInto(out *S2iBuilderSpec) {
*out = new(UserDefineTemplate)
(*in).DeepCopyInto(*out)
}
return
}
// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new S2iBuilderSpec.
......@@ -505,7 +484,6 @@ func (in *S2iBuilderStatus) DeepCopyInto(out *S2iBuilderStatus) {
in, out := &in.LastRunStartTime, &out.LastRunStartTime
*out = (*in).DeepCopy()
}
return
}
// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new S2iBuilderStatus.
......@@ -525,7 +503,6 @@ func (in *S2iBuilderTemplate) DeepCopyInto(out *S2iBuilderTemplate) {
in.ObjectMeta.DeepCopyInto(&out.ObjectMeta)
in.Spec.DeepCopyInto(&out.Spec)
out.Status = in.Status
return
}
// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new S2iBuilderTemplate.
......@@ -558,7 +535,6 @@ func (in *S2iBuilderTemplateList) DeepCopyInto(out *S2iBuilderTemplateList) {
(*in)[i].DeepCopyInto(&(*out)[i])
}
}
return
}
// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new S2iBuilderTemplateList.
......@@ -596,7 +572,6 @@ func (in *S2iBuilderTemplateSpec) DeepCopyInto(out *S2iBuilderTemplateSpec) {
(*in)[i].DeepCopyInto(&(*out)[i])
}
}
return
}
// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new S2iBuilderTemplateSpec.
......@@ -612,7 +587,6 @@ func (in *S2iBuilderTemplateSpec) DeepCopy() *S2iBuilderTemplateSpec {
// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.
func (in *S2iBuilderTemplateStatus) DeepCopyInto(out *S2iBuilderTemplateStatus) {
*out = *in
return
}
// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new S2iBuilderTemplateStatus.
......@@ -715,7 +689,6 @@ func (in *S2iConfig) DeepCopyInto(out *S2iConfig) {
*out = make([]string, len(*in))
copy(*out, *in)
}
return
}
// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new S2iConfig.
......@@ -735,7 +708,6 @@ func (in *S2iRun) DeepCopyInto(out *S2iRun) {
in.ObjectMeta.DeepCopyInto(&out.ObjectMeta)
out.Spec = in.Spec
in.Status.DeepCopyInto(&out.Status)
return
}
// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new S2iRun.
......@@ -768,7 +740,6 @@ func (in *S2iRunList) DeepCopyInto(out *S2iRunList) {
(*in)[i].DeepCopyInto(&(*out)[i])
}
}
return
}
// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new S2iRunList.
......@@ -792,7 +763,6 @@ func (in *S2iRunList) DeepCopyObject() runtime.Object {
// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.
func (in *S2iRunSpec) DeepCopyInto(out *S2iRunSpec) {
*out = *in
return
}
// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new S2iRunSpec.
......@@ -826,7 +796,6 @@ func (in *S2iRunStatus) DeepCopyInto(out *S2iRunStatus) {
*out = new(S2iBuildSource)
**out = **in
}
return
}
// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new S2iRunStatus.
......@@ -849,7 +818,6 @@ func (in *UserDefineTemplate) DeepCopyInto(out *UserDefineTemplate) {
(*in)[i].DeepCopyInto(&(*out)[i])
}
}
return
}
// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new UserDefineTemplate.
......@@ -865,7 +833,6 @@ func (in *UserDefineTemplate) DeepCopy() *UserDefineTemplate {
// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.
func (in *VolumeSpec) DeepCopyInto(out *VolumeSpec) {
*out = *in
return
}
// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new VolumeSpec.
......
......@@ -16,19 +16,18 @@ See the License for the specific language governing permissions and
limitations under the License.
*/
// Code generated by deepcopy-gen. DO NOT EDIT.
// Code generated by controller-gen. DO NOT EDIT.
package v1alpha2
import (
v1 "k8s.io/api/rbac/v1"
runtime "k8s.io/apimachinery/pkg/runtime"
"k8s.io/api/rbac/v1"
"k8s.io/apimachinery/pkg/runtime"
)
// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.
func (in *Cluster) DeepCopyInto(out *Cluster) {
*out = *in
return
}
// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new Cluster.
......@@ -51,7 +50,6 @@ func (in *ClusterSelector) DeepCopyInto(out *ClusterSelector) {
(*out)[key] = val
}
}
return
}
// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new ClusterSelector.
......@@ -70,7 +68,6 @@ func (in *FederatedRole) DeepCopyInto(out *FederatedRole) {
out.TypeMeta = in.TypeMeta
in.ObjectMeta.DeepCopyInto(&out.ObjectMeta)
in.Spec.DeepCopyInto(&out.Spec)
return
}
// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new FederatedRole.
......@@ -89,7 +86,6 @@ func (in *FederatedRoleBinding) DeepCopyInto(out *FederatedRoleBinding) {
out.TypeMeta = in.TypeMeta
in.ObjectMeta.DeepCopyInto(&out.ObjectMeta)
in.Spec.DeepCopyInto(&out.Spec)
return
}
// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new FederatedRoleBinding.
......@@ -107,7 +103,6 @@ func (in *FederatedRoleBindingSpec) DeepCopyInto(out *FederatedRoleBindingSpec)
*out = *in
in.Template.DeepCopyInto(&out.Template)
in.Placement.DeepCopyInto(&out.Placement)
return
}
// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new FederatedRoleBindingSpec.
......@@ -125,7 +120,6 @@ func (in *FederatedRoleSpec) DeepCopyInto(out *FederatedRoleSpec) {
*out = *in
in.Template.DeepCopyInto(&out.Template)
in.Placement.DeepCopyInto(&out.Placement)
return
}
// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new FederatedRoleSpec.
......@@ -144,7 +138,6 @@ func (in *FederatedUser) DeepCopyInto(out *FederatedUser) {
out.TypeMeta = in.TypeMeta
in.ObjectMeta.DeepCopyInto(&out.ObjectMeta)
in.Spec.DeepCopyInto(&out.Spec)
return
}
// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new FederatedUser.
......@@ -162,7 +155,6 @@ func (in *FederatedUserSpec) DeepCopyInto(out *FederatedUserSpec) {
*out = *in
in.Template.DeepCopyInto(&out.Template)
in.Placement.DeepCopyInto(&out.Placement)
return
}
// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new FederatedUserSpec.
......@@ -187,7 +179,6 @@ func (in *GlobalRole) DeepCopyInto(out *GlobalRole) {
(*in)[i].DeepCopyInto(&(*out)[i])
}
}
return
}
// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new GlobalRole.
......@@ -219,7 +210,6 @@ func (in *GlobalRoleBinding) DeepCopyInto(out *GlobalRoleBinding) {
copy(*out, *in)
}
out.RoleRef = in.RoleRef
return
}
// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new GlobalRoleBinding.
......@@ -252,7 +242,6 @@ func (in *GlobalRoleBindingList) DeepCopyInto(out *GlobalRoleBindingList) {
(*in)[i].DeepCopyInto(&(*out)[i])
}
}
return
}
// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new GlobalRoleBindingList.
......@@ -285,7 +274,6 @@ func (in *GlobalRoleList) DeepCopyInto(out *GlobalRoleList) {
(*in)[i].DeepCopyInto(&(*out)[i])
}
}
return
}
// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new GlobalRoleList.
......@@ -313,7 +301,6 @@ func (in *Group) DeepCopyInto(out *Group) {
in.ObjectMeta.DeepCopyInto(&out.ObjectMeta)
out.Spec = in.Spec
out.Status = in.Status
return
}
// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new Group.
......@@ -345,7 +332,6 @@ func (in *GroupBinding) DeepCopyInto(out *GroupBinding) {
*out = make([]string, len(*in))
copy(*out, *in)
}
return
}
// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new GroupBinding.
......@@ -378,7 +364,6 @@ func (in *GroupBindingList) DeepCopyInto(out *GroupBindingList) {
(*in)[i].DeepCopyInto(&(*out)[i])
}
}
return
}
// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new GroupBindingList.
......@@ -411,7 +396,6 @@ func (in *GroupList) DeepCopyInto(out *GroupList) {
(*in)[i].DeepCopyInto(&(*out)[i])
}
}
return
}
// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new GroupList.
......@@ -435,7 +419,6 @@ func (in *GroupList) DeepCopyObject() runtime.Object {
// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.
func (in *GroupRef) DeepCopyInto(out *GroupRef) {
*out = *in
return
}
// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new GroupRef.
......@@ -451,7 +434,6 @@ func (in *GroupRef) DeepCopy() *GroupRef {
// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.
func (in *GroupSpec) DeepCopyInto(out *GroupSpec) {
*out = *in
return
}
// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new GroupSpec.
......@@ -467,7 +449,6 @@ func (in *GroupSpec) DeepCopy() *GroupSpec {
// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.
func (in *GroupStatus) DeepCopyInto(out *GroupStatus) {
*out = *in
return
}
// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new GroupStatus.
......@@ -486,7 +467,6 @@ func (in *LoginRecord) DeepCopyInto(out *LoginRecord) {
out.TypeMeta = in.TypeMeta
in.ObjectMeta.DeepCopyInto(&out.ObjectMeta)
out.Spec = in.Spec
return
}
// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new LoginRecord.
......@@ -519,7 +499,6 @@ func (in *LoginRecordList) DeepCopyInto(out *LoginRecordList) {
(*in)[i].DeepCopyInto(&(*out)[i])
}
}
return
}
// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new LoginRecordList.
......@@ -543,7 +522,6 @@ func (in *LoginRecordList) DeepCopyObject() runtime.Object {
// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.
func (in *LoginRecordSpec) DeepCopyInto(out *LoginRecordSpec) {
*out = *in
return
}
// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new LoginRecordSpec.
......@@ -565,7 +543,6 @@ func (in *Placement) DeepCopyInto(out *Placement) {
copy(*out, *in)
}
in.ClusterSelector.DeepCopyInto(&out.ClusterSelector)
return
}
// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new Placement.
......@@ -584,7 +561,6 @@ func (in *RoleBase) DeepCopyInto(out *RoleBase) {
out.TypeMeta = in.TypeMeta
in.ObjectMeta.DeepCopyInto(&out.ObjectMeta)
in.Role.DeepCopyInto(&out.Role)
return
}
// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new RoleBase.
......@@ -617,7 +593,6 @@ func (in *RoleBaseList) DeepCopyInto(out *RoleBaseList) {
(*in)[i].DeepCopyInto(&(*out)[i])
}
}
return
}
// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new RoleBaseList.
......@@ -648,7 +623,6 @@ func (in *RoleBindingTemplate) DeepCopyInto(out *RoleBindingTemplate) {
copy(*out, *in)
}
out.RoleRef = in.RoleRef
return
}
// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new RoleBindingTemplate.
......@@ -672,7 +646,6 @@ func (in *RoleTemplate) DeepCopyInto(out *RoleTemplate) {
(*in)[i].DeepCopyInto(&(*out)[i])
}
}
return
}
// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new RoleTemplate.
......@@ -692,7 +665,6 @@ func (in *User) DeepCopyInto(out *User) {
in.ObjectMeta.DeepCopyInto(&out.ObjectMeta)
in.Spec.DeepCopyInto(&out.Spec)
in.Status.DeepCopyInto(&out.Status)
return
}
// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new User.
......@@ -725,7 +697,6 @@ func (in *UserList) DeepCopyInto(out *UserList) {
(*in)[i].DeepCopyInto(&(*out)[i])
}
}
return
}
// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new UserList.
......@@ -754,7 +725,6 @@ func (in *UserSpec) DeepCopyInto(out *UserSpec) {
*out = make([]string, len(*in))
copy(*out, *in)
}
return
}
// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new UserSpec.
......@@ -783,7 +753,6 @@ func (in *UserStatus) DeepCopyInto(out *UserStatus) {
in, out := &in.LastLoginTime, &out.LastLoginTime
*out = (*in).DeepCopy()
}
return
}
// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new UserStatus.
......@@ -802,7 +771,6 @@ func (in *UserTemplate) DeepCopyInto(out *UserTemplate) {
in.ObjectMeta.DeepCopyInto(&out.ObjectMeta)
in.Spec.DeepCopyInto(&out.Spec)
in.Status.DeepCopyInto(&out.Status)
return
}
// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new UserTemplate.
......@@ -827,7 +795,6 @@ func (in *WorkspaceRole) DeepCopyInto(out *WorkspaceRole) {
(*in)[i].DeepCopyInto(&(*out)[i])
}
}
return
}
// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new WorkspaceRole.
......@@ -859,7 +826,6 @@ func (in *WorkspaceRoleBinding) DeepCopyInto(out *WorkspaceRoleBinding) {
copy(*out, *in)
}
out.RoleRef = in.RoleRef
return
}
// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new WorkspaceRoleBinding.
......@@ -892,7 +858,6 @@ func (in *WorkspaceRoleBindingList) DeepCopyInto(out *WorkspaceRoleBindingList)
(*in)[i].DeepCopyInto(&(*out)[i])
}
}
return
}
// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new WorkspaceRoleBindingList.
......@@ -925,7 +890,6 @@ func (in *WorkspaceRoleList) DeepCopyInto(out *WorkspaceRoleList) {
(*in)[i].DeepCopyInto(&(*out)[i])
}
}
return
}
// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new WorkspaceRoleList.
......
......@@ -16,7 +16,7 @@ See the License for the specific language governing permissions and
limitations under the License.
*/
// Code generated by deepcopy-gen. DO NOT EDIT.
// Code generated by controller-gen. DO NOT EDIT.
package calicov3
......@@ -30,7 +30,6 @@ func (in *BlockAffinity) DeepCopyInto(out *BlockAffinity) {
out.TypeMeta = in.TypeMeta
in.ObjectMeta.DeepCopyInto(&out.ObjectMeta)
out.Spec = in.Spec
return
}
// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new BlockAffinity.
......@@ -63,7 +62,6 @@ func (in *BlockAffinityList) DeepCopyInto(out *BlockAffinityList) {
(*in)[i].DeepCopyInto(&(*out)[i])
}
}
return
}
// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new BlockAffinityList.
......@@ -90,7 +88,6 @@ func (in *IPAMBlock) DeepCopyInto(out *IPAMBlock) {
out.TypeMeta = in.TypeMeta
in.ObjectMeta.DeepCopyInto(&out.ObjectMeta)
in.Spec.DeepCopyInto(&out.Spec)
return
}
// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new IPAMBlock.
......@@ -123,7 +120,6 @@ func (in *IPAMBlockList) DeepCopyInto(out *IPAMBlockList) {
(*in)[i].DeepCopyInto(&(*out)[i])
}
}
return
}
// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new IPAMBlockList.
......@@ -150,7 +146,6 @@ func (in *IPPool) DeepCopyInto(out *IPPool) {
out.TypeMeta = in.TypeMeta
in.ObjectMeta.DeepCopyInto(&out.ObjectMeta)
in.Spec.DeepCopyInto(&out.Spec)
return
}
// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new IPPool.
......@@ -183,7 +178,6 @@ func (in *IPPoolList) DeepCopyInto(out *IPPoolList) {
(*in)[i].DeepCopyInto(&(*out)[i])
}
}
return
}
// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new IPPoolList.
......
......@@ -16,12 +16,12 @@ See the License for the specific language governing permissions and
limitations under the License.
*/
// Code generated by deepcopy-gen. DO NOT EDIT.
// Code generated by controller-gen. DO NOT EDIT.
package v1alpha2
import (
v1 "k8s.io/apimachinery/pkg/apis/meta/v1"
"k8s.io/apimachinery/pkg/apis/meta/v1"
runtime "k8s.io/apimachinery/pkg/runtime"
)
......@@ -30,7 +30,6 @@ func (in *DestinationRuleSpecTemplate) DeepCopyInto(out *DestinationRuleSpecTemp
*out = *in
in.ObjectMeta.DeepCopyInto(&out.ObjectMeta)
in.Spec.DeepCopyInto(&out.Spec)
return
}
// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new DestinationRuleSpecTemplate.
......@@ -50,7 +49,6 @@ func (in *ServicePolicy) DeepCopyInto(out *ServicePolicy) {
in.ObjectMeta.DeepCopyInto(&out.ObjectMeta)
in.Spec.DeepCopyInto(&out.Spec)
in.Status.DeepCopyInto(&out.Status)
return
}
// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new ServicePolicy.
......@@ -76,7 +74,6 @@ func (in *ServicePolicyCondition) DeepCopyInto(out *ServicePolicyCondition) {
*out = *in
in.LastProbeTime.DeepCopyInto(&out.LastProbeTime)
in.LastTransitionTime.DeepCopyInto(&out.LastTransitionTime)
return
}
// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new ServicePolicyCondition.
......@@ -101,7 +98,6 @@ func (in *ServicePolicyList) DeepCopyInto(out *ServicePolicyList) {
(*in)[i].DeepCopyInto(&(*out)[i])
}
}
return
}
// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new ServicePolicyList.
......@@ -131,7 +127,6 @@ func (in *ServicePolicySpec) DeepCopyInto(out *ServicePolicySpec) {
(*in).DeepCopyInto(*out)
}
in.Template.DeepCopyInto(&out.Template)
return
}
// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new ServicePolicySpec.
......@@ -162,7 +157,6 @@ func (in *ServicePolicyStatus) DeepCopyInto(out *ServicePolicyStatus) {
in, out := &in.CompletionTime, &out.CompletionTime
*out = (*in).DeepCopy()
}
return
}
// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new ServicePolicyStatus.
......@@ -182,7 +176,6 @@ func (in *Strategy) DeepCopyInto(out *Strategy) {
in.ObjectMeta.DeepCopyInto(&out.ObjectMeta)
in.Spec.DeepCopyInto(&out.Spec)
in.Status.DeepCopyInto(&out.Status)
return
}
// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new Strategy.
......@@ -208,7 +201,6 @@ func (in *StrategyCondition) DeepCopyInto(out *StrategyCondition) {
*out = *in
in.LastProbeTime.DeepCopyInto(&out.LastProbeTime)
in.LastTransitionTime.DeepCopyInto(&out.LastTransitionTime)
return
}
// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new StrategyCondition.
......@@ -233,7 +225,6 @@ func (in *StrategyList) DeepCopyInto(out *StrategyList) {
(*in)[i].DeepCopyInto(&(*out)[i])
}
}
return
}
// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new StrategyList.
......@@ -263,7 +254,6 @@ func (in *StrategySpec) DeepCopyInto(out *StrategySpec) {
(*in).DeepCopyInto(*out)
}
in.Template.DeepCopyInto(&out.Template)
return
}
// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new StrategySpec.
......@@ -294,7 +284,6 @@ func (in *StrategyStatus) DeepCopyInto(out *StrategyStatus) {
in, out := &in.CompletionTime, &out.CompletionTime
*out = (*in).DeepCopy()
}
return
}
// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new StrategyStatus.
......@@ -312,7 +301,6 @@ func (in *VirtualServiceTemplateSpec) DeepCopyInto(out *VirtualServiceTemplateSp
*out = *in
in.ObjectMeta.DeepCopyInto(&out.ObjectMeta)
in.Spec.DeepCopyInto(&out.Spec)
return
}
// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new VirtualServiceTemplateSpec.
......
......@@ -16,7 +16,7 @@ See the License for the specific language governing permissions and
limitations under the License.
*/
// Code generated by deepcopy-gen. DO NOT EDIT.
// Code generated by controller-gen. DO NOT EDIT.
package v1alpha1
......@@ -29,7 +29,6 @@ func (in *CapabilityFeatures) DeepCopyInto(out *CapabilityFeatures) {
*out = *in
out.Volume = in.Volume
out.Snapshot = in.Snapshot
return
}
// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new CapabilityFeatures.
......@@ -45,7 +44,6 @@ func (in *CapabilityFeatures) DeepCopy() *CapabilityFeatures {
// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.
func (in *PluginInfo) DeepCopyInto(out *PluginInfo) {
*out = *in
return
}
// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new PluginInfo.
......@@ -64,7 +62,6 @@ func (in *ProvisionerCapability) DeepCopyInto(out *ProvisionerCapability) {
out.TypeMeta = in.TypeMeta
in.ObjectMeta.DeepCopyInto(&out.ObjectMeta)
out.Spec = in.Spec
return
}
// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new ProvisionerCapability.
......@@ -97,7 +94,6 @@ func (in *ProvisionerCapabilityList) DeepCopyInto(out *ProvisionerCapabilityList
(*in)[i].DeepCopyInto(&(*out)[i])
}
}
return
}
// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new ProvisionerCapabilityList.
......@@ -123,7 +119,6 @@ func (in *ProvisionerCapabilitySpec) DeepCopyInto(out *ProvisionerCapabilitySpec
*out = *in
out.PluginInfo = in.PluginInfo
out.Features = in.Features
return
}
// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new ProvisionerCapabilitySpec.
......@@ -139,7 +134,6 @@ func (in *ProvisionerCapabilitySpec) DeepCopy() *ProvisionerCapabilitySpec {
// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.
func (in *SnapshotFeature) DeepCopyInto(out *SnapshotFeature) {
*out = *in
return
}
// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new SnapshotFeature.
......@@ -158,7 +152,6 @@ func (in *StorageClassCapability) DeepCopyInto(out *StorageClassCapability) {
out.TypeMeta = in.TypeMeta
in.ObjectMeta.DeepCopyInto(&out.ObjectMeta)
out.Spec = in.Spec
return
}
// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new StorageClassCapability.
......@@ -191,7 +184,6 @@ func (in *StorageClassCapabilityList) DeepCopyInto(out *StorageClassCapabilityLi
(*in)[i].DeepCopyInto(&(*out)[i])
}
}
return
}
// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new StorageClassCapabilityList.
......@@ -216,7 +208,6 @@ func (in *StorageClassCapabilityList) DeepCopyObject() runtime.Object {
func (in *StorageClassCapabilitySpec) DeepCopyInto(out *StorageClassCapabilitySpec) {
*out = *in
out.Features = in.Features
return
}
// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new StorageClassCapabilitySpec.
......@@ -232,7 +223,6 @@ func (in *StorageClassCapabilitySpec) DeepCopy() *StorageClassCapabilitySpec {
// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.
func (in *VolumeFeature) DeepCopyInto(out *VolumeFeature) {
*out = *in
return
}
// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new VolumeFeature.
......
......@@ -16,7 +16,7 @@ See the License for the specific language governing permissions and
limitations under the License.
*/
// Code generated by deepcopy-gen. DO NOT EDIT.
// Code generated by controller-gen. DO NOT EDIT.
package v1alpha1
......@@ -31,7 +31,6 @@ func (in *Workspace) DeepCopyInto(out *Workspace) {
in.ObjectMeta.DeepCopyInto(&out.ObjectMeta)
in.Spec.DeepCopyInto(&out.Spec)
out.Status = in.Status
return
}
// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new Workspace.
......@@ -64,7 +63,6 @@ func (in *WorkspaceList) DeepCopyInto(out *WorkspaceList) {
(*in)[i].DeepCopyInto(&(*out)[i])
}
}
return
}
// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new WorkspaceList.
......@@ -93,7 +91,6 @@ func (in *WorkspaceSpec) DeepCopyInto(out *WorkspaceSpec) {
*out = new(bool)
**out = **in
}
return
}
// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new WorkspaceSpec.
......@@ -109,7 +106,6 @@ func (in *WorkspaceSpec) DeepCopy() *WorkspaceSpec {
// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.
func (in *WorkspaceStatus) DeepCopyInto(out *WorkspaceStatus) {
*out = *in
return
}
// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new WorkspaceStatus.
......
......@@ -16,7 +16,7 @@ See the License for the specific language governing permissions and
limitations under the License.
*/
// Code generated by deepcopy-gen. DO NOT EDIT.
// Code generated by controller-gen. DO NOT EDIT.
package v1alpha2
......@@ -30,7 +30,6 @@ func (in *WorkspaceTemplate) DeepCopyInto(out *WorkspaceTemplate) {
out.TypeMeta = in.TypeMeta
in.ObjectMeta.DeepCopyInto(&out.ObjectMeta)
in.Spec.DeepCopyInto(&out.Spec)
return
}
// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new WorkspaceTemplate.
......@@ -63,7 +62,6 @@ func (in *WorkspaceTemplateList) DeepCopyInto(out *WorkspaceTemplateList) {
(*in)[i].DeepCopyInto(&(*out)[i])
}
}
return
}
// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new WorkspaceTemplateList.
......
......@@ -81,5 +81,6 @@ func init() {
&FederatedWorkspaceRole{},
&FederatedWorkspaceRoleList{},
&FederatedWorkspaceRoleBinding{},
&FederatedWorkspaceRoleBindingList{})
&FederatedWorkspaceRoleBindingList{},
)
}
......@@ -24,6 +24,8 @@ import (
rt "runtime"
"time"
openpitrixv2alpha1 "kubesphere.io/kubesphere/pkg/kapis/openpitrix/v2alpha1"
"strconv"
"github.com/emicklei/go-restful"
......@@ -88,7 +90,6 @@ import (
"kubesphere.io/kubesphere/pkg/simple/client/k8s"
"kubesphere.io/kubesphere/pkg/simple/client/logging"
"kubesphere.io/kubesphere/pkg/simple/client/monitoring"
"kubesphere.io/kubesphere/pkg/simple/client/openpitrix"
"kubesphere.io/kubesphere/pkg/simple/client/s3"
"kubesphere.io/kubesphere/pkg/simple/client/sonarqube"
"kubesphere.io/kubesphere/pkg/utils/metrics"
......@@ -135,9 +136,6 @@ type APIServer struct {
MetricsClient monitoring.Interface
//
OpenpitrixClient openpitrix.Client
//
LoggingClient logging.Client
......@@ -215,14 +213,15 @@ func (s *APIServer) installKubeSphereAPIs() {
urlruntime.Must(configv1alpha2.AddToContainer(s.container, s.Config))
urlruntime.Must(resourcev1alpha3.AddToContainer(s.container, s.InformerFactory, s.RuntimeCache))
urlruntime.Must(monitoringv1alpha3.AddToContainer(s.container, s.KubernetesClient.Kubernetes(), s.MonitoringClient, s.MetricsClient, s.InformerFactory, s.OpenpitrixClient))
urlruntime.Must(meteringv1alpha1.AddToContainer(s.container, s.KubernetesClient.Kubernetes(), s.MonitoringClient, s.InformerFactory, s.OpenpitrixClient, s.RuntimeCache))
urlruntime.Must(openpitrixv1.AddToContainer(s.container, s.InformerFactory, s.OpenpitrixClient))
urlruntime.Must(monitoringv1alpha3.AddToContainer(s.container, s.KubernetesClient.Kubernetes(), s.MonitoringClient, s.MetricsClient, s.InformerFactory))
urlruntime.Must(meteringv1alpha1.AddToContainer(s.container, s.KubernetesClient.Kubernetes(), s.MonitoringClient, s.InformerFactory, s.RuntimeCache))
urlruntime.Must(openpitrixv1.AddToContainer(s.container, s.InformerFactory, s.KubernetesClient.KubeSphere(), s.Config.OpenPitrixOptions))
urlruntime.Must(openpitrixv2alpha1.AddToContainer(s.container, s.InformerFactory, s.KubernetesClient.KubeSphere(), s.Config.OpenPitrixOptions))
urlruntime.Must(operationsv1alpha2.AddToContainer(s.container, s.KubernetesClient.Kubernetes()))
urlruntime.Must(resourcesv1alpha2.AddToContainer(s.container, s.KubernetesClient.Kubernetes(), s.InformerFactory,
s.KubernetesClient.Master()))
urlruntime.Must(tenantv1alpha2.AddToContainer(s.container, s.InformerFactory, s.KubernetesClient.Kubernetes(),
s.KubernetesClient.KubeSphere(), s.EventsClient, s.LoggingClient, s.AuditingClient, amOperator, rbacAuthorizer, s.MonitoringClient, s.OpenpitrixClient, s.RuntimeCache))
s.KubernetesClient.KubeSphere(), s.EventsClient, s.LoggingClient, s.AuditingClient, amOperator, rbacAuthorizer, s.MonitoringClient, s.RuntimeCache))
urlruntime.Must(terminalv1alpha2.AddToContainer(s.container, s.KubernetesClient.Kubernetes(), s.KubernetesClient.Config()))
urlruntime.Must(clusterkapisv1alpha1.AddToContainer(s.container,
s.InformerFactory.KubernetesSharedInformerFactory(),
......@@ -338,8 +337,7 @@ func (s *APIServer) buildHandlerChain(stopCh <-chan struct{}) {
handler = filters.WithAuthorization(handler, authorizers)
if s.Config.MultiClusterOptions.Enable {
clusterDispatcher := dispatch.NewClusterDispatch(s.InformerFactory.KubeSphereSharedInformerFactory().Cluster().V1alpha1().Clusters(),
s.InformerFactory.KubeSphereSharedInformerFactory().Cluster().V1alpha1().Clusters().Lister())
clusterDispatcher := dispatch.NewClusterDispatch(s.InformerFactory.KubeSphereSharedInformerFactory().Cluster().V1alpha1().Clusters())
handler = filters.WithMultipleClusterDispatcher(handler, clusterDispatcher)
}
......
......@@ -196,6 +196,14 @@ func (conf *Config) ToMap() map[string]bool {
continue
}
if name == "openpitrix" {
if conf.OpenPitrixOptions.IsEmpty() {
result["openpitrix.appstore"] = false
} else {
result["openpitrix.appstore"] = true
}
}
if c.Field(i).IsNil() {
result[name] = false
} else {
......
......@@ -94,12 +94,16 @@ func newTestConfig() (*Config, error) {
Bucket: "ssss",
},
OpenPitrixOptions: &openpitrix.Options{
RuntimeManagerEndpoint: "openpitrix-hyperpitrix.openpitrix-system.svc:9103",
ClusterManagerEndpoint: "openpitrix-hyperpitrix.openpitrix-system.svc:9104",
RepoManagerEndpoint: "openpitrix-hyperpitrix.openpitrix-system.svc:9101",
AppManagerEndpoint: "openpitrix-hyperpitrix.openpitrix-system.svc:9102",
CategoryManagerEndpoint: "openpitrix-hyperpitrix.openpitrix-system.svc:9113",
AttachmentManagerEndpoint: "openpitrix-hyperpitrix.openpitrix-system.svc:9122",
S3Options: &s3.Options{
Endpoint: "http://minio.openpitrix-system.svc",
Region: "",
DisableSSL: false,
ForcePathStyle: false,
AccessKeyID: "ABCDEFGHIJKLMN",
SecretAccessKey: "OPQRSTUVWXYZ",
SessionToken: "abcdefghijklmn",
Bucket: "app",
},
},
NetworkOptions: &network.Options{
EnableNetworkPolicy: true,
......
......@@ -18,25 +18,18 @@ package dispatch
import (
"fmt"
"net/http"
"net/url"
"strings"
"sync"
corev1 "k8s.io/api/core/v1"
"k8s.io/apimachinery/pkg/api/errors"
"k8s.io/apimachinery/pkg/util/httpstream"
"k8s.io/apimachinery/pkg/util/proxy"
"k8s.io/apiserver/pkg/endpoints/handlers/responsewriters"
"k8s.io/client-go/rest"
"k8s.io/client-go/tools/cache"
"k8s.io/client-go/tools/clientcmd"
"k8s.io/klog"
"kubesphere.io/kubesphere/pkg/utils/clusterclient"
"net/http"
"strings"
clusterv1alpha1 "kubesphere.io/kubesphere/pkg/apis/cluster/v1alpha1"
"kubesphere.io/kubesphere/pkg/apiserver/request"
clusterinformer "kubesphere.io/kubesphere/pkg/client/informers/externalversions/cluster/v1alpha1"
clusterlister "kubesphere.io/kubesphere/pkg/client/listers/cluster/v1alpha1"
)
const proxyURLFormat = "/api/v1/namespaces/kubesphere-system/services/:ks-apiserver:/proxy%s"
......@@ -48,48 +41,12 @@ type Dispatcher interface {
Dispatch(w http.ResponseWriter, req *http.Request, handler http.Handler)
}
type innerCluster struct {
kubernetesURL *url.URL
kubesphereURL *url.URL
transport http.RoundTripper
}
type clusterDispatch struct {
clusterLister clusterlister.ClusterLister
// dispatcher will build a in memory cluster cache to speed things up
innerClusters map[string]*innerCluster
clusterInformerSynced cache.InformerSynced
mutex sync.RWMutex
clusterclient.ClusterClients
}
func NewClusterDispatch(clusterInformer clusterinformer.ClusterInformer, clusterLister clusterlister.ClusterLister) Dispatcher {
clusterDispatcher := &clusterDispatch{
clusterLister: clusterLister,
innerClusters: make(map[string]*innerCluster),
mutex: sync.RWMutex{},
}
clusterDispatcher.clusterInformerSynced = clusterInformer.Informer().HasSynced
clusterInformer.Informer().AddEventHandler(cache.ResourceEventHandlerFuncs{
AddFunc: clusterDispatcher.updateInnerClusters,
UpdateFunc: func(oldObj, newObj interface{}) {
clusterDispatcher.updateInnerClusters(newObj)
},
DeleteFunc: func(obj interface{}) {
cluster := obj.(*clusterv1alpha1.Cluster)
clusterDispatcher.mutex.Lock()
if _, ok := clusterDispatcher.innerClusters[cluster.Name]; ok {
delete(clusterDispatcher.innerClusters, cluster.Name)
}
clusterDispatcher.mutex.Unlock()
},
})
return clusterDispatcher
func NewClusterDispatch(clusterInformer clusterinformer.ClusterInformer) Dispatcher {
return &clusterDispatch{clusterclient.NewClusterClient(clusterInformer)}
}
// Dispatch dispatch requests to designated cluster
......@@ -102,7 +59,7 @@ func (c *clusterDispatch) Dispatch(w http.ResponseWriter, req *http.Request, han
return
}
cluster, err := c.clusterLister.Get(info.Cluster)
cluster, err := c.Get(info.Cluster)
if err != nil {
if errors.IsNotFound(err) {
http.Error(w, fmt.Sprintf("cluster %s not found", info.Cluster), http.StatusNotFound)
......@@ -113,18 +70,18 @@ func (c *clusterDispatch) Dispatch(w http.ResponseWriter, req *http.Request, han
}
// request cluster is host cluster, no need go through agent
if isClusterHostCluster(cluster) {
if c.IsHostCluster(cluster) {
req.URL.Path = strings.Replace(req.URL.Path, fmt.Sprintf("/clusters/%s", info.Cluster), "", 1)
handler.ServeHTTP(w, req)
return
}
if !isClusterReady(cluster) {
if !c.IsClusterReady(cluster) {
http.Error(w, fmt.Sprintf("cluster %s is not ready", cluster.Name), http.StatusInternalServerError)
return
}
innCluster := c.getInnerCluster(cluster.Name)
innCluster := c.GetInnerCluster(cluster.Name)
if innCluster == nil {
http.Error(w, fmt.Sprintf("cluster %s is not ready", cluster.Name), http.StatusInternalServerError)
return
......@@ -141,10 +98,10 @@ func (c *clusterDispatch) Dispatch(w http.ResponseWriter, req *http.Request, han
if cluster.Spec.Connection.Type == clusterv1alpha1.ConnectionTypeDirect &&
len(cluster.Spec.Connection.KubeSphereAPIEndpoint) == 0 {
u.Scheme = innCluster.kubernetesURL.Scheme
u.Host = innCluster.kubernetesURL.Host
u.Scheme = innCluster.KubernetesURL.Scheme
u.Host = innCluster.KubernetesURL.Host
u.Path = fmt.Sprintf(proxyURLFormat, u.Path)
transport = innCluster.transport
transport = innCluster.Transport
// The reason we need this is kube-apiserver doesn't behave like a standard proxy, it will strip
// authorization header of proxy requests. Use custom header to avoid stripping by kube-apiserver.
......@@ -178,8 +135,8 @@ func (c *clusterDispatch) Dispatch(w http.ResponseWriter, req *http.Request, han
} else {
// everything else goes to ks-apiserver, since our ks-apiserver has the ability to proxy kube-apiserver requests
u.Host = innCluster.kubesphereURL.Host
u.Scheme = innCluster.kubesphereURL.Scheme
u.Host = innCluster.KubesphereURL.Host
u.Scheme = innCluster.KubesphereURL.Scheme
}
httpProxy := proxy.NewUpgradeAwareHandler(&u, transport, false, false, c)
......@@ -190,73 +147,3 @@ func (c *clusterDispatch) Dispatch(w http.ResponseWriter, req *http.Request, han
func (c *clusterDispatch) Error(w http.ResponseWriter, req *http.Request, err error) {
responsewriters.InternalError(w, req, err)
}
func (c *clusterDispatch) getInnerCluster(name string) *innerCluster {
c.mutex.RLock()
defer c.mutex.RUnlock()
if cluster, ok := c.innerClusters[name]; ok {
return cluster
}
return nil
}
func (c *clusterDispatch) updateInnerClusters(obj interface{}) {
cluster := obj.(*clusterv1alpha1.Cluster)
kubernetesEndpoint, err := url.Parse(cluster.Spec.Connection.KubernetesAPIEndpoint)
if err != nil {
klog.Errorf("Parse kubernetes apiserver endpoint %s failed, %v", cluster.Spec.Connection.KubernetesAPIEndpoint, err)
return
}
kubesphereEndpoint, err := url.Parse(cluster.Spec.Connection.KubeSphereAPIEndpoint)
if err != nil {
klog.Errorf("Parse kubesphere apiserver endpoint %s failed, %v", cluster.Spec.Connection.KubeSphereAPIEndpoint, err)
return
}
// prepare for
clientConfig, err := clientcmd.NewClientConfigFromBytes(cluster.Spec.Connection.KubeConfig)
if err != nil {
klog.Errorf("Unable to create client config from kubeconfig bytes, %#v", err)
return
}
clusterConfig, err := clientConfig.ClientConfig()
if err != nil {
klog.Errorf("Failed to get client config, %#v", err)
return
}
transport, err := rest.TransportFor(clusterConfig)
if err != nil {
klog.Errorf("Create transport failed, %v", err)
return
}
c.mutex.Lock()
c.innerClusters[cluster.Name] = &innerCluster{
kubernetesURL: kubernetesEndpoint,
kubesphereURL: kubesphereEndpoint,
transport: transport,
}
c.mutex.Unlock()
}
func isClusterReady(cluster *clusterv1alpha1.Cluster) bool {
for _, condition := range cluster.Status.Conditions {
if condition.Type == clusterv1alpha1.ClusterReady && condition.Status == corev1.ConditionTrue {
return true
}
}
return false
}
func isClusterHostCluster(cluster *clusterv1alpha1.Cluster) bool {
if _, ok := cluster.Labels[clusterv1alpha1.HostCluster]; ok {
return true
}
return false
}
......@@ -32,6 +32,7 @@ type ContainerBuilder []func(c *restful.Container) error
const MimeMergePatchJson = "application/merge-patch+json"
const MimeJsonPatchJson = "application/json-patch+json"
const MimeMultipartFormData = "multipart/form-data"
func init() {
restful.RegisterEntityAccessor(MimeMergePatchJson, restful.NewEntityAccessorJSON(restful.MIME_JSON))
......
......@@ -24,6 +24,7 @@ import (
discovery "k8s.io/client-go/discovery"
rest "k8s.io/client-go/rest"
flowcontrol "k8s.io/client-go/util/flowcontrol"
applicationv1alpha1 "kubesphere.io/kubesphere/pkg/client/clientset/versioned/typed/application/v1alpha1"
auditingv1alpha1 "kubesphere.io/kubesphere/pkg/client/clientset/versioned/typed/auditing/v1alpha1"
clusterv1alpha1 "kubesphere.io/kubesphere/pkg/client/clientset/versioned/typed/cluster/v1alpha1"
devopsv1alpha1 "kubesphere.io/kubesphere/pkg/client/clientset/versioned/typed/devops/v1alpha1"
......@@ -40,6 +41,7 @@ import (
type Interface interface {
Discovery() discovery.DiscoveryInterface
ApplicationV1alpha1() applicationv1alpha1.ApplicationV1alpha1Interface
AuditingV1alpha1() auditingv1alpha1.AuditingV1alpha1Interface
ClusterV1alpha1() clusterv1alpha1.ClusterV1alpha1Interface
DevopsV1alpha1() devopsv1alpha1.DevopsV1alpha1Interface
......@@ -58,6 +60,7 @@ type Interface interface {
// version included in a Clientset.
type Clientset struct {
*discovery.DiscoveryClient
applicationV1alpha1 *applicationv1alpha1.ApplicationV1alpha1Client
auditingV1alpha1 *auditingv1alpha1.AuditingV1alpha1Client
clusterV1alpha1 *clusterv1alpha1.ClusterV1alpha1Client
devopsV1alpha1 *devopsv1alpha1.DevopsV1alpha1Client
......@@ -72,6 +75,11 @@ type Clientset struct {
typesV1beta1 *typesv1beta1.TypesV1beta1Client
}
// ApplicationV1alpha1 retrieves the ApplicationV1alpha1Client
func (c *Clientset) ApplicationV1alpha1() applicationv1alpha1.ApplicationV1alpha1Interface {
return c.applicationV1alpha1
}
// AuditingV1alpha1 retrieves the AuditingV1alpha1Client
func (c *Clientset) AuditingV1alpha1() auditingv1alpha1.AuditingV1alpha1Interface {
return c.auditingV1alpha1
......@@ -153,6 +161,10 @@ func NewForConfig(c *rest.Config) (*Clientset, error) {
}
var cs Clientset
var err error
cs.applicationV1alpha1, err = applicationv1alpha1.NewForConfig(&configShallowCopy)
if err != nil {
return nil, err
}
cs.auditingV1alpha1, err = auditingv1alpha1.NewForConfig(&configShallowCopy)
if err != nil {
return nil, err
......@@ -213,6 +225,7 @@ func NewForConfig(c *rest.Config) (*Clientset, error) {
// panics if there is an error in the config.
func NewForConfigOrDie(c *rest.Config) *Clientset {
var cs Clientset
cs.applicationV1alpha1 = applicationv1alpha1.NewForConfigOrDie(c)
cs.auditingV1alpha1 = auditingv1alpha1.NewForConfigOrDie(c)
cs.clusterV1alpha1 = clusterv1alpha1.NewForConfigOrDie(c)
cs.devopsV1alpha1 = devopsv1alpha1.NewForConfigOrDie(c)
......@@ -233,6 +246,7 @@ func NewForConfigOrDie(c *rest.Config) *Clientset {
// New creates a new Clientset for the given RESTClient.
func New(c rest.Interface) *Clientset {
var cs Clientset
cs.applicationV1alpha1 = applicationv1alpha1.New(c)
cs.auditingV1alpha1 = auditingv1alpha1.New(c)
cs.clusterV1alpha1 = clusterv1alpha1.New(c)
cs.devopsV1alpha1 = devopsv1alpha1.New(c)
......
......@@ -25,6 +25,8 @@ import (
fakediscovery "k8s.io/client-go/discovery/fake"
"k8s.io/client-go/testing"
clientset "kubesphere.io/kubesphere/pkg/client/clientset/versioned"
applicationv1alpha1 "kubesphere.io/kubesphere/pkg/client/clientset/versioned/typed/application/v1alpha1"
fakeapplicationv1alpha1 "kubesphere.io/kubesphere/pkg/client/clientset/versioned/typed/application/v1alpha1/fake"
auditingv1alpha1 "kubesphere.io/kubesphere/pkg/client/clientset/versioned/typed/auditing/v1alpha1"
fakeauditingv1alpha1 "kubesphere.io/kubesphere/pkg/client/clientset/versioned/typed/auditing/v1alpha1/fake"
clusterv1alpha1 "kubesphere.io/kubesphere/pkg/client/clientset/versioned/typed/cluster/v1alpha1"
......@@ -98,6 +100,11 @@ func (c *Clientset) Tracker() testing.ObjectTracker {
var _ clientset.Interface = &Clientset{}
// ApplicationV1alpha1 retrieves the ApplicationV1alpha1Client
func (c *Clientset) ApplicationV1alpha1() applicationv1alpha1.ApplicationV1alpha1Interface {
return &fakeapplicationv1alpha1.FakeApplicationV1alpha1{Fake: &c.Fake}
}
// AuditingV1alpha1 retrieves the AuditingV1alpha1Client
func (c *Clientset) AuditingV1alpha1() auditingv1alpha1.AuditingV1alpha1Interface {
return &fakeauditingv1alpha1.FakeAuditingV1alpha1{Fake: &c.Fake}
......
......@@ -24,6 +24,7 @@ import (
schema "k8s.io/apimachinery/pkg/runtime/schema"
serializer "k8s.io/apimachinery/pkg/runtime/serializer"
utilruntime "k8s.io/apimachinery/pkg/util/runtime"
applicationv1alpha1 "kubesphere.io/kubesphere/pkg/apis/application/v1alpha1"
auditingv1alpha1 "kubesphere.io/kubesphere/pkg/apis/auditing/v1alpha1"
clusterv1alpha1 "kubesphere.io/kubesphere/pkg/apis/cluster/v1alpha1"
devopsv1alpha1 "kubesphere.io/kubesphere/pkg/apis/devops/v1alpha1"
......@@ -42,6 +43,7 @@ var scheme = runtime.NewScheme()
var codecs = serializer.NewCodecFactory(scheme)
var parameterCodec = runtime.NewParameterCodec(scheme)
var localSchemeBuilder = runtime.SchemeBuilder{
applicationv1alpha1.AddToScheme,
auditingv1alpha1.AddToScheme,
clusterv1alpha1.AddToScheme,
devopsv1alpha1.AddToScheme,
......
......@@ -24,6 +24,7 @@ import (
schema "k8s.io/apimachinery/pkg/runtime/schema"
serializer "k8s.io/apimachinery/pkg/runtime/serializer"
utilruntime "k8s.io/apimachinery/pkg/util/runtime"
applicationv1alpha1 "kubesphere.io/kubesphere/pkg/apis/application/v1alpha1"
auditingv1alpha1 "kubesphere.io/kubesphere/pkg/apis/auditing/v1alpha1"
clusterv1alpha1 "kubesphere.io/kubesphere/pkg/apis/cluster/v1alpha1"
devopsv1alpha1 "kubesphere.io/kubesphere/pkg/apis/devops/v1alpha1"
......@@ -42,6 +43,7 @@ var Scheme = runtime.NewScheme()
var Codecs = serializer.NewCodecFactory(Scheme)
var ParameterCodec = runtime.NewParameterCodec(Scheme)
var localSchemeBuilder = runtime.SchemeBuilder{
applicationv1alpha1.AddToScheme,
auditingv1alpha1.AddToScheme,
clusterv1alpha1.AddToScheme,
devopsv1alpha1.AddToScheme,
......
/*
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 client-gen. DO NOT EDIT.
// This package has the automatically generated typed clients.
package v1alpha1
/*
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 client-gen. DO NOT EDIT.
// Package fake has the automatically generated clients.
package fake
......@@ -28,6 +28,7 @@ import (
schema "k8s.io/apimachinery/pkg/runtime/schema"
cache "k8s.io/client-go/tools/cache"
versioned "kubesphere.io/kubesphere/pkg/client/clientset/versioned"
application "kubesphere.io/kubesphere/pkg/client/informers/externalversions/application"
auditing "kubesphere.io/kubesphere/pkg/client/informers/externalversions/auditing"
cluster "kubesphere.io/kubesphere/pkg/client/informers/externalversions/cluster"
devops "kubesphere.io/kubesphere/pkg/client/informers/externalversions/devops"
......@@ -181,6 +182,7 @@ type SharedInformerFactory interface {
ForResource(resource schema.GroupVersionResource) (GenericInformer, error)
WaitForCacheSync(stopCh <-chan struct{}) map[reflect.Type]bool
Application() application.Interface
Auditing() auditing.Interface
Cluster() cluster.Interface
Devops() devops.Interface
......@@ -193,6 +195,10 @@ type SharedInformerFactory interface {
Types() types.Interface
}
func (f *sharedInformerFactory) Application() application.Interface {
return application.New(f, f.namespace, f.tweakListOptions)
}
func (f *sharedInformerFactory) Auditing() auditing.Interface {
return auditing.New(f, f.namespace, f.tweakListOptions)
}
......
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册