From 0e7a9e8931c36a7be00be8ec69d7253658a7c28c Mon Sep 17 00:00:00 2001 From: James Rawlings Date: Thu, 26 Nov 2020 13:55:30 +0000 Subject: [PATCH] refactor: remove velero, make storage extensible, change TLS and Ingress for Environments optional. Remove more old v2 flags too --- hack/linter.sh | 2 +- hack/update-codegen.sh | 4 +- pkg/apis/{jenkins.io => core}/register.go | 8 +- pkg/apis/core/v4beta1/doc.go | 5 + .../{jenkins.io => core}/v4beta1/register.go | 19 +- .../v4beta1/requirements.go} | 174 ++- .../v4beta1/requirements_test.go} | 107 +- .../v4beta1/test_data/build_pack_library.yaml | 0 .../git_public_false_git_private_nil.json | 0 .../git_public_nil_git_private_false.json | 0 .../git_public_nil_git_private_true.json | 0 .../git_public_true_git_private_nil.json | 0 .../git_public_true_git_private_true.json | 0 .../git_public_false_git_private_nil.yaml | 0 .../git_public_nil_git_private_false.yaml | 0 .../git_public_nil_git_private_true.yaml | 0 .../git_public_true_git_private_nil.yaml | 0 .../git_public_true_git_private_true.yaml | 0 .../jx-requirements.yml | 3 - .../v4beta1/test_data/jx-requirements.yml | 3 - .../v4beta1/test_data/pipeline/old-pa.yaml | 0 .../v4beta1/types_environment.go | 44 - .../v4beta1/types_environment_test.go | 0 pkg/apis/core/v4beta1/types_extensions.go | 117 ++ .../v4beta1/types_pipeline.go | 57 +- .../v4beta1/types_release.go | 52 +- .../v4beta1/zz_generated.deepcopy.go | 1214 +---------------- pkg/apis/jenkins.io/v4beta1/doc.go | 5 - .../jenkins.io/v4beta1/types_buildpack.go | 39 - .../jenkins.io/v4beta1/types_extensions.go | 594 -------- pkg/apis/jenkins.io/v4beta1/types_teams.go | 75 - pkg/apis/jenkins.io/v4beta1/types_users.go | 138 -- pkg/client/clientset/versioned/clientset.go | 18 +- .../versioned/fake/clientset_generated.go | 10 +- .../clientset/versioned/fake/register.go | 4 +- .../clientset/versioned/scheme/register.go | 4 +- .../typed/core/v4beta1/core_client.go | 108 ++ .../typed/{jenkins.io => core}/v4beta1/doc.go | 0 .../v4beta1/environment.go | 4 +- .../{jenkins.io => core}/v4beta1/fake/doc.go | 0 .../core/v4beta1/fake/fake_core_client.go | 55 + .../v4beta1/fake/fake_environment.go | 8 +- .../v4beta1/fake/fake_pipelineactivity.go | 8 +- .../v4beta1/fake/fake_plugin.go | 8 +- .../v4beta1/fake/fake_release.go | 8 +- .../v4beta1/fake/fake_sourcerepository.go | 8 +- .../v4beta1/generated_expansion.go | 18 - .../v4beta1/pipelineactivity.go | 4 +- .../{jenkins.io => core}/v4beta1/plugin.go | 4 +- .../{jenkins.io => core}/v4beta1/release.go | 4 +- .../v4beta1/sourcerepository.go | 4 +- .../versioned/typed/jenkins.io/v4beta1/app.go | 177 --- .../typed/jenkins.io/v4beta1/buildpack.go | 177 --- .../typed/jenkins.io/v4beta1/commitstatus.go | 177 --- .../v4beta1/environmentrolebinding.go | 177 --- .../typed/jenkins.io/v4beta1/extension.go | 177 --- .../typed/jenkins.io/v4beta1/fake/fake_app.go | 129 -- .../jenkins.io/v4beta1/fake/fake_buildpack.go | 129 -- .../v4beta1/fake/fake_commitstatus.go | 129 -- .../fake/fake_environmentrolebinding.go | 129 -- .../jenkins.io/v4beta1/fake/fake_extension.go | 129 -- .../v4beta1/fake/fake_gitservice.go | 129 -- .../v4beta1/fake/fake_jenkins.io_client.go | 91 -- .../fake/fake_sourcerepositorygroup.go | 129 -- .../jenkins.io/v4beta1/fake/fake_team.go | 129 -- .../jenkins.io/v4beta1/fake/fake_user.go | 129 -- .../typed/jenkins.io/v4beta1/gitservice.go | 177 --- .../jenkins.io/v4beta1/jenkins.io_client.go | 153 --- .../v4beta1/sourcerepositorygroup.go | 177 --- .../typed/jenkins.io/v4beta1/team.go | 177 --- .../typed/jenkins.io/v4beta1/user.go | 177 --- .../{jenkins.io => core}/interface.go | 4 +- .../v4beta1/environment.go | 12 +- .../{jenkins.io => core}/v4beta1/interface.go | 63 - .../v4beta1/pipelineactivity.go | 12 +- .../{jenkins.io => core}/v4beta1/plugin.go | 12 +- .../{jenkins.io => core}/v4beta1/release.go | 12 +- .../v4beta1/sourcerepository.go | 12 +- .../informers/externalversions/factory.go | 8 +- .../informers/externalversions/generic.go | 32 +- .../jenkins.io/v4beta1/app.go | 89 -- .../jenkins.io/v4beta1/buildpack.go | 89 -- .../jenkins.io/v4beta1/commitstatus.go | 89 -- .../v4beta1/environmentrolebinding.go | 89 -- .../jenkins.io/v4beta1/extension.go | 89 -- .../jenkins.io/v4beta1/gitservice.go | 89 -- .../v4beta1/sourcerepositorygroup.go | 89 -- .../jenkins.io/v4beta1/team.go | 89 -- .../jenkins.io/v4beta1/user.go | 89 -- .../v4beta1/environment.go | 2 +- .../core/v4beta1/expansion_generated.go | 58 + .../v4beta1/pipelineactivity.go | 2 +- .../{jenkins.io => core}/v4beta1/plugin.go | 2 +- .../{jenkins.io => core}/v4beta1/release.go | 2 +- .../v4beta1/sourcerepository.go | 2 +- pkg/client/listers/jenkins.io/v4beta1/app.go | 98 -- .../listers/jenkins.io/v4beta1/buildpack.go | 98 -- .../jenkins.io/v4beta1/commitstatus.go | 98 -- .../v4beta1/environmentrolebinding.go | 98 -- .../jenkins.io/v4beta1/expansion_generated.go | 130 -- .../listers/jenkins.io/v4beta1/extension.go | 98 -- .../listers/jenkins.io/v4beta1/gitservice.go | 98 -- .../v4beta1/sourcerepositorygroup.go | 98 -- pkg/client/listers/jenkins.io/v4beta1/team.go | 98 -- pkg/client/listers/jenkins.io/v4beta1/user.go | 98 -- 105 files changed, 666 insertions(+), 7317 deletions(-) rename pkg/apis/{jenkins.io => core}/register.go (69%) create mode 100644 pkg/apis/core/v4beta1/doc.go rename pkg/apis/{jenkins.io => core}/v4beta1/register.go (87%) rename pkg/apis/{jenkins.io/v4beta1/install_requirements.go => core/v4beta1/requirements.go} (85%) rename pkg/apis/{jenkins.io/v4beta1/install_requirements_test.go => core/v4beta1/requirements_test.go} (80%) rename pkg/apis/{jenkins.io => core}/v4beta1/test_data/build_pack_library.yaml (100%) rename pkg/apis/{jenkins.io => core}/v4beta1/test_data/environment/git_public_false_git_private_nil.json (100%) rename pkg/apis/{jenkins.io => core}/v4beta1/test_data/environment/git_public_nil_git_private_false.json (100%) rename pkg/apis/{jenkins.io => core}/v4beta1/test_data/environment/git_public_nil_git_private_true.json (100%) rename pkg/apis/{jenkins.io => core}/v4beta1/test_data/environment/git_public_true_git_private_nil.json (100%) rename pkg/apis/{jenkins.io => core}/v4beta1/test_data/environment/git_public_true_git_private_true.json (100%) rename pkg/apis/{jenkins.io => core}/v4beta1/test_data/git_public_false_git_private_nil.yaml (100%) rename pkg/apis/{jenkins.io => core}/v4beta1/test_data/git_public_nil_git_private_false.yaml (100%) rename pkg/apis/{jenkins.io => core}/v4beta1/test_data/git_public_nil_git_private_true.yaml (100%) rename pkg/apis/{jenkins.io => core}/v4beta1/test_data/git_public_true_git_private_nil.yaml (100%) rename pkg/apis/{jenkins.io => core}/v4beta1/test_data/git_public_true_git_private_true.yaml (100%) rename pkg/apis/{jenkins.io => core}/v4beta1/test_data/jx-requirements-syntax-error/jx-requirements.yml (93%) rename pkg/apis/{jenkins.io => core}/v4beta1/test_data/jx-requirements.yml (92%) create mode 100644 pkg/apis/core/v4beta1/test_data/pipeline/old-pa.yaml rename pkg/apis/{jenkins.io => core}/v4beta1/types_environment.go (89%) rename pkg/apis/{jenkins.io => core}/v4beta1/types_environment_test.go (100%) create mode 100644 pkg/apis/core/v4beta1/types_extensions.go rename pkg/apis/{jenkins.io => core}/v4beta1/types_pipeline.go (74%) rename pkg/apis/{jenkins.io => core}/v4beta1/types_release.go (82%) rename pkg/apis/{jenkins.io => core}/v4beta1/zz_generated.deepcopy.go (56%) delete mode 100644 pkg/apis/jenkins.io/v4beta1/doc.go delete mode 100644 pkg/apis/jenkins.io/v4beta1/types_buildpack.go delete mode 100644 pkg/apis/jenkins.io/v4beta1/types_extensions.go delete mode 100644 pkg/apis/jenkins.io/v4beta1/types_teams.go delete mode 100644 pkg/apis/jenkins.io/v4beta1/types_users.go create mode 100644 pkg/client/clientset/versioned/typed/core/v4beta1/core_client.go rename pkg/client/clientset/versioned/typed/{jenkins.io => core}/v4beta1/doc.go (100%) rename pkg/client/clientset/versioned/typed/{jenkins.io => core}/v4beta1/environment.go (97%) rename pkg/client/clientset/versioned/typed/{jenkins.io => core}/v4beta1/fake/doc.go (100%) create mode 100644 pkg/client/clientset/versioned/typed/core/v4beta1/fake/fake_core_client.go rename pkg/client/clientset/versioned/typed/{jenkins.io => core}/v4beta1/fake/fake_environment.go (93%) rename pkg/client/clientset/versioned/typed/{jenkins.io => core}/v4beta1/fake/fake_pipelineactivity.go (94%) rename pkg/client/clientset/versioned/typed/{jenkins.io => core}/v4beta1/fake/fake_plugin.go (93%) rename pkg/client/clientset/versioned/typed/{jenkins.io => core}/v4beta1/fake/fake_release.go (93%) rename pkg/client/clientset/versioned/typed/{jenkins.io => core}/v4beta1/fake/fake_sourcerepository.go (94%) rename pkg/client/clientset/versioned/typed/{jenkins.io => core}/v4beta1/generated_expansion.go (70%) rename pkg/client/clientset/versioned/typed/{jenkins.io => core}/v4beta1/pipelineactivity.go (97%) rename pkg/client/clientset/versioned/typed/{jenkins.io => core}/v4beta1/plugin.go (97%) rename pkg/client/clientset/versioned/typed/{jenkins.io => core}/v4beta1/release.go (97%) rename pkg/client/clientset/versioned/typed/{jenkins.io => core}/v4beta1/sourcerepository.go (97%) delete mode 100644 pkg/client/clientset/versioned/typed/jenkins.io/v4beta1/app.go delete mode 100644 pkg/client/clientset/versioned/typed/jenkins.io/v4beta1/buildpack.go delete mode 100644 pkg/client/clientset/versioned/typed/jenkins.io/v4beta1/commitstatus.go delete mode 100644 pkg/client/clientset/versioned/typed/jenkins.io/v4beta1/environmentrolebinding.go delete mode 100644 pkg/client/clientset/versioned/typed/jenkins.io/v4beta1/extension.go delete mode 100644 pkg/client/clientset/versioned/typed/jenkins.io/v4beta1/fake/fake_app.go delete mode 100644 pkg/client/clientset/versioned/typed/jenkins.io/v4beta1/fake/fake_buildpack.go delete mode 100644 pkg/client/clientset/versioned/typed/jenkins.io/v4beta1/fake/fake_commitstatus.go delete mode 100644 pkg/client/clientset/versioned/typed/jenkins.io/v4beta1/fake/fake_environmentrolebinding.go delete mode 100644 pkg/client/clientset/versioned/typed/jenkins.io/v4beta1/fake/fake_extension.go delete mode 100644 pkg/client/clientset/versioned/typed/jenkins.io/v4beta1/fake/fake_gitservice.go delete mode 100644 pkg/client/clientset/versioned/typed/jenkins.io/v4beta1/fake/fake_jenkins.io_client.go delete mode 100644 pkg/client/clientset/versioned/typed/jenkins.io/v4beta1/fake/fake_sourcerepositorygroup.go delete mode 100644 pkg/client/clientset/versioned/typed/jenkins.io/v4beta1/fake/fake_team.go delete mode 100644 pkg/client/clientset/versioned/typed/jenkins.io/v4beta1/fake/fake_user.go delete mode 100644 pkg/client/clientset/versioned/typed/jenkins.io/v4beta1/gitservice.go delete mode 100644 pkg/client/clientset/versioned/typed/jenkins.io/v4beta1/jenkins.io_client.go delete mode 100644 pkg/client/clientset/versioned/typed/jenkins.io/v4beta1/sourcerepositorygroup.go delete mode 100644 pkg/client/clientset/versioned/typed/jenkins.io/v4beta1/team.go delete mode 100644 pkg/client/clientset/versioned/typed/jenkins.io/v4beta1/user.go rename pkg/client/informers/externalversions/{jenkins.io => core}/interface.go (96%) rename pkg/client/informers/externalversions/{jenkins.io => core}/v4beta1/environment.go (87%) rename pkg/client/informers/externalversions/{jenkins.io => core}/v4beta1/interface.go (51%) rename pkg/client/informers/externalversions/{jenkins.io => core}/v4beta1/pipelineactivity.go (87%) rename pkg/client/informers/externalversions/{jenkins.io => core}/v4beta1/plugin.go (87%) rename pkg/client/informers/externalversions/{jenkins.io => core}/v4beta1/release.go (87%) rename pkg/client/informers/externalversions/{jenkins.io => core}/v4beta1/sourcerepository.go (87%) delete mode 100644 pkg/client/informers/externalversions/jenkins.io/v4beta1/app.go delete mode 100644 pkg/client/informers/externalversions/jenkins.io/v4beta1/buildpack.go delete mode 100644 pkg/client/informers/externalversions/jenkins.io/v4beta1/commitstatus.go delete mode 100644 pkg/client/informers/externalversions/jenkins.io/v4beta1/environmentrolebinding.go delete mode 100644 pkg/client/informers/externalversions/jenkins.io/v4beta1/extension.go delete mode 100644 pkg/client/informers/externalversions/jenkins.io/v4beta1/gitservice.go delete mode 100644 pkg/client/informers/externalversions/jenkins.io/v4beta1/sourcerepositorygroup.go delete mode 100644 pkg/client/informers/externalversions/jenkins.io/v4beta1/team.go delete mode 100644 pkg/client/informers/externalversions/jenkins.io/v4beta1/user.go rename pkg/client/listers/{jenkins.io => core}/v4beta1/environment.go (98%) create mode 100644 pkg/client/listers/core/v4beta1/expansion_generated.go rename pkg/client/listers/{jenkins.io => core}/v4beta1/pipelineactivity.go (98%) rename pkg/client/listers/{jenkins.io => core}/v4beta1/plugin.go (97%) rename pkg/client/listers/{jenkins.io => core}/v4beta1/release.go (97%) rename pkg/client/listers/{jenkins.io => core}/v4beta1/sourcerepository.go (98%) delete mode 100644 pkg/client/listers/jenkins.io/v4beta1/app.go delete mode 100644 pkg/client/listers/jenkins.io/v4beta1/buildpack.go delete mode 100644 pkg/client/listers/jenkins.io/v4beta1/commitstatus.go delete mode 100644 pkg/client/listers/jenkins.io/v4beta1/environmentrolebinding.go delete mode 100644 pkg/client/listers/jenkins.io/v4beta1/expansion_generated.go delete mode 100644 pkg/client/listers/jenkins.io/v4beta1/extension.go delete mode 100644 pkg/client/listers/jenkins.io/v4beta1/gitservice.go delete mode 100644 pkg/client/listers/jenkins.io/v4beta1/sourcerepositorygroup.go delete mode 100644 pkg/client/listers/jenkins.io/v4beta1/team.go delete mode 100644 pkg/client/listers/jenkins.io/v4beta1/user.go diff --git a/hack/linter.sh b/hack/linter.sh index 8a62660..dc760e5 100755 --- a/hack/linter.sh +++ b/hack/linter.sh @@ -20,4 +20,4 @@ golangci-lint run \ --verbose \ --build-tags build \ --skip-dirs pkg/client \ - --skip-files pkg/apis/jenkins.io/v4beta1/zz_generated.deepcopy.go + --skip-files pkg/apis/core/v4beta1/zz_generated.deepcopy.go diff --git a/hack/update-codegen.sh b/hack/update-codegen.sh index e5ea7ed..52947b8 100755 --- a/hack/update-codegen.sh +++ b/hack/update-codegen.sh @@ -36,11 +36,11 @@ rm -rf "${SCRIPT_ROOT}"/pkg/client # instead of the $GOPATH directly. For normal projects this can be dropped. bash hack/generate-groups.sh all \ github.com/jenkins-x/jx-api/v4/pkg/client github.com/jenkins-x/jx-api/v4/pkg/apis \ - jenkins.io:v4beta1 \ + core:v4beta1 \ --output-base "$(dirname "${BASH_SOURCE[0]}")/../../../.." \ --go-header-file "${SCRIPT_ROOT}"/hack/custom-boilerplate.go.txt cp -R "${SCRIPT_ROOT}"/v4/pkg/client/ "${SCRIPT_ROOT}"/pkg/client -cp -R "${SCRIPT_ROOT}"/v4/pkg/apis/jenkins.io/v4beta1/zz_generated.deepcopy.go "${SCRIPT_ROOT}"/pkg/apis/jenkins.io/v4beta1/zz_generated.deepcopy.go +cp -R "${SCRIPT_ROOT}"/v4/pkg/apis/core/v4beta1/zz_generated.deepcopy.go "${SCRIPT_ROOT}"/pkg/apis/core/v4beta1/zz_generated.deepcopy.go rm -rf "${SCRIPT_ROOT}"/v4 diff --git a/pkg/apis/jenkins.io/register.go b/pkg/apis/core/register.go similarity index 69% rename from pkg/apis/jenkins.io/register.go rename to pkg/apis/core/register.go index 08478bf..8e7a9fe 100644 --- a/pkg/apis/jenkins.io/register.go +++ b/pkg/apis/core/register.go @@ -1,14 +1,14 @@ -package jenkinsio +package core const ( // GroupName is the Jenkins API group name - GroupName = "jenkins.io" + GroupName = "core.jenkins-x.io" // Version is the Jenkins API group version - Version = "v1" + Version = "v4" // GroupAndVersion is the Jenkins API Group and version GroupAndVersion = GroupName + "/" + Version // Package is the Go package in which the apis live - Package = "github.com/jenkins-x/jx-api/v3/pkg/apis" + Package = "github.com/jenkins-x/jx-api/v4/pkg/apis" ) diff --git a/pkg/apis/core/v4beta1/doc.go b/pkg/apis/core/v4beta1/doc.go new file mode 100644 index 0000000..7c8054f --- /dev/null +++ b/pkg/apis/core/v4beta1/doc.go @@ -0,0 +1,5 @@ +// +k8s:deepcopy-gen=package +// +k8s:openapi-gen=true +// Package v4 is the v4 version of the API. +// +groupName=core.jenkins-x.io +package v4beta1 diff --git a/pkg/apis/jenkins.io/v4beta1/register.go b/pkg/apis/core/v4beta1/register.go similarity index 87% rename from pkg/apis/jenkins.io/v4beta1/register.go rename to pkg/apis/core/v4beta1/register.go index 4be0300..8c05741 100644 --- a/pkg/apis/jenkins.io/v4beta1/register.go +++ b/pkg/apis/core/v4beta1/register.go @@ -39,20 +39,8 @@ func init() { // Adds the list of known types to Scheme. func addKnownTypes(scheme *runtime.Scheme) error { scheme.AddKnownTypes(SchemeGroupVersion, - &BuildPack{}, - &BuildPackList{}, - &App{}, - &AppList{}, - &CommitStatus{}, - &CommitStatusList{}, &Environment{}, &EnvironmentList{}, - &EnvironmentRoleBinding{}, - &EnvironmentRoleBindingList{}, - &Extension{}, - &ExtensionList{}, - &GitService{}, - &GitServiceList{}, &PluginList{}, &Plugin{}, &PipelineActivity{}, @@ -61,13 +49,8 @@ func addKnownTypes(scheme *runtime.Scheme) error { &ReleaseList{}, &SourceRepository{}, &SourceRepositoryList{}, - &SourceRepositoryGroup{}, - &SourceRepositoryGroupList{}, - &Team{}, - &TeamList{}, - &User{}, - &UserList{}, ) + metav1.AddToGroupVersion(scheme, SchemeGroupVersion) return nil } diff --git a/pkg/apis/jenkins.io/v4beta1/install_requirements.go b/pkg/apis/core/v4beta1/requirements.go similarity index 85% rename from pkg/apis/jenkins.io/v4beta1/install_requirements.go rename to pkg/apis/core/v4beta1/requirements.go index 0dbd58f..301ac7d 100644 --- a/pkg/apis/jenkins.io/v4beta1/install_requirements.go +++ b/pkg/apis/core/v4beta1/requirements.go @@ -4,6 +4,8 @@ import ( "encoding/json" "fmt" + metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" + "github.com/jenkins-x/jx-api/v4/pkg/cloud" "github.com/jenkins-x/jx-api/v4/pkg/util" "github.com/jenkins-x/jx-logging/v3/pkg/log" @@ -58,12 +60,6 @@ const ( RequirementVaultName = "JX_REQUIREMENT_VAULT_NAME" // RequirementVaultServiceAccountName the service account name for vault RequirementVaultServiceAccountName = "JX_REQUIREMENT_VAULT_SA_NAME" - // RequirementVeleroServiceAccountName the service account name for velero - RequirementVeleroServiceAccountName = "JX_REQUIREMENT_VELERO_SA_NAME" - // RequirementVeleroTTL defines the time to live (TTL) for the Velero backups in minutes - RequirementVeleroTTL = "JX_REQUIREMENT_VELERO_TTL" - // RequirementVeleroSchedule defines the schedule of the Velero backups in cron notation - RequirementVeleroSchedule = "JX_REQUIREMENT_VELERO_SCHEDULE" // RequirementVaultKeyringName the keyring name for vault RequirementVaultKeyringName = "JX_REQUIREMENT_VAULT_KEYRING_NAME" // RequirementVaultKeyName the key name for vault @@ -78,8 +74,6 @@ const ( RequirementSecretStorageType = "JX_REQUIREMENT_SECRET_STORAGE_TYPE" // RequirementKanikoServiceAccountName the service account name for kaniko RequirementKanikoServiceAccountName = "JX_REQUIREMENT_KANIKO_SA_NAME" - // RequirementKaniko if kaniko is required - RequirementKaniko = "JX_REQUIREMENT_KANIKO" // RequirementIngressTLSProduction use the lets encrypt production server RequirementIngressTLSProduction = "JX_REQUIREMENT_INGRESS_TLS_PRODUCTION" // RequirementChartRepository the helm chart repository for jx @@ -90,32 +84,18 @@ const ( RequirementRepository = "JX_REQUIREMENT_REPOSITORY" // RequirementWebhook the webhook handler for jx RequirementWebhook = "JX_REQUIREMENT_WEBHOOK" - // RequirementStorageBackupEnabled if backup storage is required - RequirementStorageBackupEnabled = "JX_REQUIREMENT_STORAGE_BACKUP_ENABLED" // RequirementStorageBackupURL backup storage url RequirementStorageBackupURL = "JX_REQUIREMENT_STORAGE_BACKUP_URL" - // RequirementStorageLogsEnabled if log storage is required - RequirementStorageLogsEnabled = "JX_REQUIREMENT_STORAGE_LOGS_ENABLED" // RequirementStorageLogsURL logs storage url RequirementStorageLogsURL = "JX_REQUIREMENT_STORAGE_LOGS_URL" - // RequirementStorageReportsEnabled if report storage is required - RequirementStorageReportsEnabled = "JX_REQUIREMENT_STORAGE_REPORTS_ENABLED" // RequirementStorageReportsURL report storage url RequirementStorageReportsURL = "JX_REQUIREMENT_STORAGE_REPORTS_URL" - // RequirementStorageRepositoryEnabled if repository storage is required - RequirementStorageRepositoryEnabled = "JX_REQUIREMENT_STORAGE_REPOSITORY_ENABLED" // RequirementStorageRepositoryURL repository storage url RequirementStorageRepositoryURL = "JX_REQUIREMENT_STORAGE_REPOSITORY_URL" // RequirementGkeProjectNumber is the gke project number RequirementGkeProjectNumber = "JX_REQUIREMENT_GKE_PROJECT_NUMBER" - // RequirementGitAppEnabled if the github app should be used for access tokens - RequirementGitAppEnabled = "JX_REQUIREMENT_GITHUB_APP_ENABLED" - // RequirementGitAppURL contains the URL to the github app - RequirementGitAppURL = "JX_REQUIREMENT_GITHUB_APP_URL" // RequirementDevEnvApprovers contains the optional list of users to populate the dev env's OWNERS with RequirementDevEnvApprovers = "JX_REQUIREMENT_DEV_ENV_APPROVERS" - // RequirementVersionsGitRef contains the git ref of the version stream - RequirementVersionsGitRef = "JX_REQUIREMENT_VERSIONS_GIT_REF" ) // SecretStorageType is the type of storage used for secrets @@ -161,6 +141,18 @@ const ( // RepositoryTypeValues the string values for the repository types var RepositoryTypeValues = []string{string(RepositoryTypeNone), string(RepositoryTypeBucketRepo), string(RepositoryTypeNexus), string(RepositoryTypeArtifactory)} +// Requirements represents a collection installation requirements for Jenkins X +// +// +k8s:openapi-gen=true +type Requirements struct { + metav1.TypeMeta `json:",inline"` + // +optional + metav1.ObjectMeta `json:"metadata"` + + // Spec the definition of the secret mappings + Spec RequirementsConfig `json:"spec"` +} + // EnvironmentConfig configures the organisation and repository name of the git repositories for environments type EnvironmentConfig struct { // Key is the key of the environment configuration @@ -174,7 +166,7 @@ type EnvironmentConfig struct { // GitKind is the kind of git server (github, bitbucketserver etc) GitKind string `json:"gitKind,omitempty"` // Ingress contains ingress specific requirements - Ingress IngressConfig `json:"ingress,omitempty"` + Ingress *IngressConfig `json:"ingress,omitempty"` // RemoteCluster specifies this environment runs on a remote cluster to the development cluster RemoteCluster bool `json:"remoteCluster,omitempty"` // PromotionStrategy what kind of promotion strategy to use @@ -183,6 +175,8 @@ type EnvironmentConfig struct { // IngressConfig contains dns specific requirements type IngressConfig struct { + // DNS is enabled + ExternalDNS bool `json:"externalDNS"` // CloudDNSSecretName secret name which contains the service account for external-dns and cert-manager issuer to // access the Cloud DNS service to resolve a DNS challenge CloudDNSSecretName string `json:"cloud_dns_secret_name,omitempty"` @@ -195,7 +189,7 @@ type IngressConfig struct { // NamespaceSubDomain the sub domain expression to expose ingress. Defaults to ".jx." NamespaceSubDomain string `json:"namespaceSubDomain"` // TLS enable automated TLS using certmanager - TLS TLSConfig `json:"tls"` + TLS *TLSConfig `json:"tls,omitempty"` } // TLSConfig contains TLS specific requirements @@ -211,27 +205,15 @@ type TLSConfig struct { SecretName string `json:"secretName,omitempty"` } -// StorageEntryConfig contains dns specific requirements for a kind of storage -type StorageEntryConfig struct { - // Enabled if the storage is enabled - Enabled bool `json:"enabled"` +// StorageConfig contains dns specific requirements +type StorageConfig struct { + // Name of the bucket + Name string `json:"name"` // URL the cloud storage bucket URL such as 'gs://mybucket' or 's3://foo' or `azblob://thingy' // see https://jenkins-x.io/architecture/storage/ URL string `json:"url"` } -// StorageConfig contains dns specific requirements -type StorageConfig struct { - // Logs for storing build logs - Logs StorageEntryConfig `json:"logs"` - // Tests for storing test results, coverage + code quality reports - Reports StorageEntryConfig `json:"reports"` - // Repository for storing repository artifacts - Repository StorageEntryConfig `json:"repository"` - // Backup for backing up kubernetes resource - Backup StorageEntryConfig `json:"backup"` -} - type AzureDNSConfig struct { TenantID string `json:"tenantId,omitempty"` SubscriptionID string `json:"subscriptionId,omitempty"` @@ -402,18 +384,6 @@ func (t *ClusterConfig) UnmarshalJSON(data []byte) error { return nil } -// VeleroConfig contains the configuration for velero -type VeleroConfig struct { - // Namespace the namespace to install velero into - Namespace string `json:"namespace,omitempty"` - // ServiceAccount the cloud service account used to run velero - ServiceAccount string `json:"serviceAccount,omitempty" envconfig:"JX_REQUIREMENT_VELERO_SA_NAME"` - // Schedule of backups - Schedule string `json:"schedule" envconfig:"JX_REQUIREMENT_VELERO_SCHEDULE"` - // TimeToLive period for backups to be retained - TimeToLive string `json:"ttl" envconfig:"JX_REQUIREMENT_VELERO_TTL"` -} - // AutoUpdateConfig contains auto update config type AutoUpdateConfig struct { // Enabled autoupdate @@ -422,17 +392,6 @@ type AutoUpdateConfig struct { Schedule string `json:"schedule"` } -// this is not expected to work with v3 so dont offer is as a config option until it does work -//// GithubAppConfig contains github app config -//type GithubAppConfig struct { -// // Enabled this determines whether this install should use the jenkins x github app for access tokens -// Enabled bool `json:"enabled" envconfig:"JX_REQUIREMENT_GITHUB_APP_ENABLED"` -// // Schedule cron of the github app token refresher -// Schedule string `json:"schedule,omitempty"` -// // URL contains a URL to the github app -// URL string `json:"url,omitempty" envconfig:"JX_REQUIREMENT_GITHUB_APP_URL"` -//} - // RequirementsValues contains the logical installation requirements in the `jx-requirements.yml` file as helm values type RequirementsValues struct { // RequirementsConfig contains the logical installation requirements @@ -456,8 +415,6 @@ type RequirementsConfig struct { Cluster ClusterConfig `json:"cluster"` // Environments the requirements for the environments Environments []EnvironmentConfig `json:"environments,omitempty"` - // Kaniko whether to enable kaniko for building docker images - Kaniko bool `json:"kaniko,omitempty"` // Ingress contains ingress specific requirements Ingress IngressConfig `json:"ingress"` // PipelineUser the user name and email used for running pipelines @@ -467,13 +424,11 @@ type RequirementsConfig struct { // SecretStorage how should we store secrets for the cluster SecretStorage SecretStorageType `json:"secretStorage,omitempty" envconfig:"JX_REQUIREMENT_SECRET_STORAGE_TYPE"` // Storage contains storage requirements - Storage StorageConfig `json:"storage"` + Storage []StorageConfig `json:"storage,omitempty"` // Terraform specifies if we are managing the kubernetes cluster and cloud resources with Terraform Terraform bool `json:"terraform,omitempty"` // Vault the configuration for vault Vault VaultConfig `json:"vault,omitempty"` - // Velero the configuration for running velero for backing up the cluster resources - Velero VeleroConfig `json:"velero,omitempty"` // Webhook specifies what engine we should use for webhooks Webhook WebhookType `json:"webhook,omitempty"` } @@ -595,11 +550,11 @@ func (c *RequirementsConfig) SaveConfig(fileName string) error { return nil } -type environmentsSliceTransformer struct{} +type sliceTransformer struct{} -// environmentsSliceTransformer.Transformer is handling the correct merge of two EnvironmentConfig slices +// sliceTransformer.Transformer is handling the correct merge of two EnvironmentConfig slices // so we can both append extra items and merge existing ones so we don't lose any data -func (t environmentsSliceTransformer) Transformer(typ reflect.Type) func(dst, src reflect.Value) error { +func (t sliceTransformer) Transformer(typ reflect.Type) func(dst, src reflect.Value) error { if typ == reflect.TypeOf([]EnvironmentConfig{}) { return func(dst, src reflect.Value) error { d := dst.Interface().([]EnvironmentConfig) @@ -621,6 +576,27 @@ func (t environmentsSliceTransformer) Transformer(typ reflect.Type) func(dst, sr return nil } } + if typ == reflect.TypeOf([]StorageConfig{}) { + return func(dst, src reflect.Value) error { + d := dst.Interface().([]StorageConfig) + s := src.Interface().([]StorageConfig) + if dst.CanSet() { + for i, v := range s { + if len(d) > 0 { + d = append(d, v) + } else { + nv := v + err := mergo.Merge(&d[i], &nv, mergo.WithOverride) + if err != nil { + return errors.Wrap(err, "error merging StorageConfig slices") + } + } + } + dst.Set(reflect.ValueOf(d)) + } + return nil + } + } return nil } @@ -630,7 +606,7 @@ func (t environmentsSliceTransformer) Transformer(typ reflect.Type) func(dst, sr // in embedded structs should also be merged correctly. // if a slice is added a transformer will be needed to handle correctly merging the contained values func (c *RequirementsConfig) MergeSave(src *RequirementsConfig, requirementsFileName string) error { - err := mergo.Merge(c, src, mergo.WithOverride, mergo.WithTransformers(environmentsSliceTransformer{})) + err := mergo.Merge(c, src, mergo.WithOverride, mergo.WithTransformers(sliceTransformer{})) if err != nil { return errors.Wrap(err, "error merging jx-requirements.yml files") } @@ -780,36 +756,32 @@ func (c *RequirementsConfig) OverrideRequirementsFromEnvironment(gkeProjectNumbe } // StorageConfig is reused between multiple storage configuration types and needs to be handled explicitly - if "" != os.Getenv(RequirementStorageBackupEnabled) { - storageBackup := os.Getenv(RequirementStorageBackupEnabled) - if envVarBoolean(storageBackup) && "" != os.Getenv(RequirementStorageBackupURL) { - c.Storage.Backup.Enabled = true - c.Storage.Backup.URL = os.Getenv(RequirementStorageBackupURL) - } + if "" != os.Getenv(RequirementStorageBackupURL) { + c.Storage = append(c.Storage, StorageConfig{ + Name: "backup", + URL: os.Getenv(RequirementStorageBackupURL), + }) } - if "" != os.Getenv(RequirementStorageLogsEnabled) { - storageLogs := os.Getenv(RequirementStorageLogsEnabled) - if envVarBoolean(storageLogs) && "" != os.Getenv(RequirementStorageLogsURL) { - c.Storage.Logs.Enabled = true - c.Storage.Logs.URL = os.Getenv(RequirementStorageLogsURL) - } + if "" != os.Getenv(RequirementStorageLogsURL) { + c.Storage = append(c.Storage, StorageConfig{ + Name: "logs", + URL: os.Getenv(RequirementStorageLogsURL), + }) } - if "" != os.Getenv(RequirementStorageReportsEnabled) { - storageReports := os.Getenv(RequirementStorageReportsEnabled) - if envVarBoolean(storageReports) && "" != os.Getenv(RequirementStorageReportsURL) { - c.Storage.Reports.Enabled = true - c.Storage.Reports.URL = os.Getenv(RequirementStorageReportsURL) - } + if "" != os.Getenv(RequirementStorageReportsURL) { + c.Storage = append(c.Storage, StorageConfig{ + Name: "reports", + URL: os.Getenv(RequirementStorageReportsURL), + }) } - if "" != os.Getenv(RequirementStorageRepositoryEnabled) { - storageRepository := os.Getenv(RequirementStorageRepositoryEnabled) - if envVarBoolean(storageRepository) && "" != os.Getenv(RequirementStorageRepositoryURL) { - c.Storage.Repository.Enabled = true - c.Storage.Repository.URL = os.Getenv(RequirementStorageRepositoryURL) - } + if "" != os.Getenv(RequirementStorageRepositoryURL) { + c.Storage = append(c.Storage, StorageConfig{ + Name: "repository", + URL: os.Getenv(RequirementStorageRepositoryURL), + }) } if "" != os.Getenv(RequirementDevEnvApprovers) { @@ -840,3 +812,13 @@ func (c *RequirementsConfig) OverrideRequirementsFromEnvironment(gkeProjectNumbe func envVarBoolean(value string) bool { return value == constTrue || value == "yes" } + +func (c *RequirementsConfig) GetStorageURL(name string) string { + for _, s := range c.Storage { + if s.Name == name { + return s.URL + } + } + // default to empty string if no matching storage found for name + return "" +} diff --git a/pkg/apis/jenkins.io/v4beta1/install_requirements_test.go b/pkg/apis/core/v4beta1/requirements_test.go similarity index 80% rename from pkg/apis/jenkins.io/v4beta1/install_requirements_test.go rename to pkg/apis/core/v4beta1/requirements_test.go index 73097d5..5e4a3f2 100644 --- a/pkg/apis/jenkins.io/v4beta1/install_requirements_test.go +++ b/pkg/apis/core/v4beta1/requirements_test.go @@ -13,7 +13,7 @@ import ( "github.com/ghodss/yaml" "github.com/jenkins-x/jx-api/v3/pkg/cloud" "github.com/jenkins-x/jx-api/v3/pkg/util" - "github.com/jenkins-x/jx-api/v4/pkg/apis/jenkins.io/v4beta1" + "github.com/jenkins-x/jx-api/v4/pkg/apis/core/v4beta1" "github.com/jenkins-x/jx-logging/v3/pkg/log" "github.com/stretchr/testify/assert" ) @@ -43,7 +43,6 @@ func TestRequirementsConfigMarshalExistingFile(t *testing.T) { requirements.SecretStorage = expectedSecretStorage requirements.Cluster.ClusterName = expectedClusterName requirements.Ingress.Domain = expectedDomain - requirements.Kaniko = true requirements.PipelineUser = &v4beta1.UserNameEmailConfig{ Username: expectedPipelineUserName, Email: expectedPipelineUserEmail, @@ -56,7 +55,6 @@ func TestRequirementsConfigMarshalExistingFile(t *testing.T) { assert.NoError(t, err, "failed to load requirements file in dir %s", dir) assert.FileExists(t, fileName) - assert.Equal(t, true, requirements.Kaniko, "requirements.Kaniko") assert.Equal(t, expectedClusterName, requirements.Cluster.ClusterName, "requirements.ClusterName") assert.Equal(t, expectedSecretStorage, requirements.SecretStorage, "requirements.SecretStorage") assert.Equal(t, expectedDomain, requirements.Ingress.Domain, "requirements.Domain") @@ -69,7 +67,6 @@ func TestRequirementsConfigMarshalExistingFile(t *testing.T) { t.Logf("generated requirements file %s\n", fileName) - assert.Equal(t, true, requirements.Kaniko, "requirements.Kaniko") assert.Equal(t, expectedClusterName, requirements.Cluster.ClusterName, "requirements.ClusterName") assert.Equal(t, expectedSecretStorage, requirements.SecretStorage, "requirements.SecretStorage") assert.Equal(t, expectedDomain, requirements.Ingress.Domain, "requirements.Domain") @@ -111,9 +108,6 @@ func Test_OverrideRequirementsFromEnvironment_populate_requirements_from_environ }{ // RequirementsConfig {v4beta1.RequirementSecretStorageType, "vault", v4beta1.RequirementsConfig{SecretStorage: "vault"}}, - {v4beta1.RequirementKaniko, "true", v4beta1.RequirementsConfig{Kaniko: true}}, - {v4beta1.RequirementKaniko, "false", v4beta1.RequirementsConfig{Kaniko: false}}, - {v4beta1.RequirementKaniko, "", v4beta1.RequirementsConfig{Kaniko: false}}, {v4beta1.RequirementRepository, "bucketrepo", v4beta1.RequirementsConfig{Repository: "bucketrepo"}}, {v4beta1.RequirementWebhook, "prow", v4beta1.RequirementsConfig{Webhook: "prow"}}, @@ -146,31 +140,36 @@ func Test_OverrideRequirementsFromEnvironment_populate_requirements_from_environ {v4beta1.RequirementVaultDisableURLDiscovery, "false", v4beta1.RequirementsConfig{Vault: v4beta1.VaultConfig{DisableURLDiscovery: false}}}, {v4beta1.RequirementVaultDisableURLDiscovery, "", v4beta1.RequirementsConfig{Vault: v4beta1.VaultConfig{DisableURLDiscovery: false}}}, - // VeleroConfig - {v4beta1.RequirementVeleroServiceAccountName, "my-velero-sa", v4beta1.RequirementsConfig{Velero: v4beta1.VeleroConfig{ServiceAccount: "my-velero-sa"}}}, - {v4beta1.RequirementVeleroTTL, "60", v4beta1.RequirementsConfig{Velero: v4beta1.VeleroConfig{TimeToLive: "60"}}}, - {v4beta1.RequirementVeleroSchedule, "0 * * * *", v4beta1.RequirementsConfig{Velero: v4beta1.VeleroConfig{Schedule: "0 * * * *"}}}, - // Storage - {v4beta1.RequirementStorageBackupEnabled, "true", v4beta1.RequirementsConfig{Storage: v4beta1.StorageConfig{Backup: v4beta1.StorageEntryConfig{Enabled: true}}}}, - {v4beta1.RequirementStorageBackupEnabled, "false", v4beta1.RequirementsConfig{Storage: v4beta1.StorageConfig{Backup: v4beta1.StorageEntryConfig{Enabled: false}}}}, - {v4beta1.RequirementStorageBackupEnabled, "", v4beta1.RequirementsConfig{Storage: v4beta1.StorageConfig{Backup: v4beta1.StorageEntryConfig{Enabled: false}}}}, - {v4beta1.RequirementStorageBackupURL, "gs://my-backup", v4beta1.RequirementsConfig{Storage: v4beta1.StorageConfig{Backup: v4beta1.StorageEntryConfig{URL: "gs://my-backup"}}}}, - - {v4beta1.RequirementStorageLogsEnabled, "true", v4beta1.RequirementsConfig{Storage: v4beta1.StorageConfig{Logs: v4beta1.StorageEntryConfig{Enabled: true}}}}, - {v4beta1.RequirementStorageLogsEnabled, "false", v4beta1.RequirementsConfig{Storage: v4beta1.StorageConfig{Logs: v4beta1.StorageEntryConfig{Enabled: false}}}}, - {v4beta1.RequirementStorageLogsEnabled, "", v4beta1.RequirementsConfig{Storage: v4beta1.StorageConfig{Logs: v4beta1.StorageEntryConfig{Enabled: false}}}}, - {v4beta1.RequirementStorageLogsURL, "gs://my-logs", v4beta1.RequirementsConfig{Storage: v4beta1.StorageConfig{Logs: v4beta1.StorageEntryConfig{URL: "gs://my-logs"}}}}, - - {v4beta1.RequirementStorageReportsEnabled, "true", v4beta1.RequirementsConfig{Storage: v4beta1.StorageConfig{Reports: v4beta1.StorageEntryConfig{Enabled: true}}}}, - {v4beta1.RequirementStorageReportsEnabled, "false", v4beta1.RequirementsConfig{Storage: v4beta1.StorageConfig{Reports: v4beta1.StorageEntryConfig{Enabled: false}}}}, - {v4beta1.RequirementStorageReportsEnabled, "", v4beta1.RequirementsConfig{Storage: v4beta1.StorageConfig{Reports: v4beta1.StorageEntryConfig{Enabled: false}}}}, - {v4beta1.RequirementStorageReportsURL, "gs://my-reports", v4beta1.RequirementsConfig{Storage: v4beta1.StorageConfig{Reports: v4beta1.StorageEntryConfig{URL: "gs://my-reports"}}}}, - - {v4beta1.RequirementStorageRepositoryEnabled, "true", v4beta1.RequirementsConfig{Storage: v4beta1.StorageConfig{Repository: v4beta1.StorageEntryConfig{Enabled: true}}}}, - {v4beta1.RequirementStorageRepositoryEnabled, "false", v4beta1.RequirementsConfig{Storage: v4beta1.StorageConfig{Repository: v4beta1.StorageEntryConfig{Enabled: false}}}}, - {v4beta1.RequirementStorageRepositoryEnabled, "", v4beta1.RequirementsConfig{Storage: v4beta1.StorageConfig{Repository: v4beta1.StorageEntryConfig{Enabled: false}}}}, - {v4beta1.RequirementStorageRepositoryURL, "gs://my-repo", v4beta1.RequirementsConfig{Storage: v4beta1.StorageConfig{Repository: v4beta1.StorageEntryConfig{URL: "gs://my-repo"}}}}, + {v4beta1.RequirementStorageBackupURL, "gs://my-backup", + v4beta1.RequirementsConfig{Storage: []v4beta1.StorageConfig{ + { + Name: "backup", + URL: "gs://my-backup", + }, + }}}, + + {v4beta1.RequirementStorageLogsURL, "gs://my-logs", + v4beta1.RequirementsConfig{Storage: []v4beta1.StorageConfig{ + { + Name: "logs", + URL: "gs://my-logs", + }, + }}}, + {v4beta1.RequirementStorageReportsURL, "gs://my-reports", + v4beta1.RequirementsConfig{Storage: []v4beta1.StorageConfig{ + { + Name: "reports", + URL: "gs://my-reports", + }, + }}}, + {v4beta1.RequirementStorageRepositoryURL, "gs://my-repo", + v4beta1.RequirementsConfig{Storage: []v4beta1.StorageConfig{ + { + Name: "repository", + URL: "gs://my-repo", + }, + }}}, // GKEConfig {v4beta1.RequirementGkeProjectNumber, "my-gke-project", v4beta1.RequirementsConfig{Cluster: v4beta1.ClusterConfig{GKEConfig: &v4beta1.GKEConfig{ProjectNumber: "my-gke-project"}}}}, @@ -213,17 +212,14 @@ func TestRequirementsConfigMarshalExistingFileKanikoFalse(t *testing.T) { file := filepath.Join(dir, v4beta1.RequirementsConfigFileName) requirements := v4beta1.NewRequirementsConfig() - requirements.Kaniko = false err = requirements.SaveConfig(file) assert.NoError(t, err, "failed to save file %s", file) - requirements, fileName, err := v4beta1.LoadRequirementsConfig(dir, v4beta1.DefaultFailOnValidationError) + _, fileName, err := v4beta1.LoadRequirementsConfig(dir, v4beta1.DefaultFailOnValidationError) assert.NoError(t, err, "failed to load requirements file in dir %s", dir) assert.FileExists(t, fileName) - assert.Equal(t, false, requirements.Kaniko, "requirements.Kaniko") - } func TestRequirementsConfigMarshalInEmptyDir(t *testing.T) { @@ -377,15 +373,15 @@ func TestMergeSave(t *testing.T) { }, { Key: "production", - Ingress: v4beta1.IngressConfig{ + Ingress: &v4beta1.IngressConfig{ Domain: "domain", }, }, { Key: "staging", - Ingress: v4beta1.IngressConfig{ + Ingress: &v4beta1.IngressConfig{ Domain: "domainStaging", - TLS: v4beta1.TLSConfig{ + TLS: &v4beta1.TLSConfig{ Email: "email", }, }, @@ -400,15 +396,15 @@ func TestMergeSave(t *testing.T) { }, { Key: "production", - Ingress: v4beta1.IngressConfig{ + Ingress: &v4beta1.IngressConfig{ CloudDNSSecretName: "secret", }, }, { Key: "staging", - Ingress: v4beta1.IngressConfig{ + Ingress: &v4beta1.IngressConfig{ Domain: "newDomain", - TLS: v4beta1.TLSConfig{ + TLS: &v4beta1.TLSConfig{ Enabled: true, }, }, @@ -439,30 +435,29 @@ func TestMergeSave(t *testing.T) { { Name: "Merge StorageConfig test", Original: &v4beta1.RequirementsConfig{ - Storage: v4beta1.StorageConfig{ - Logs: v4beta1.StorageEntryConfig{ - Enabled: true, - URL: "value1", + Storage: []v4beta1.StorageConfig{ + { + Name: "logs", + URL: "value1", }, - Reports: v4beta1.StorageEntryConfig{}, - Repository: v4beta1.StorageEntryConfig{ - Enabled: true, - URL: "value3", + { + Name: "repository", + URL: "value3", }, }, }, Changed: &v4beta1.RequirementsConfig{ - Storage: v4beta1.StorageConfig{ - Reports: v4beta1.StorageEntryConfig{ - Enabled: true, - URL: "", + Storage: []v4beta1.StorageConfig{ + { + Name: "reports", + URL: "value2", }, }, }, ValidationFunc: func(orig *v4beta1.RequirementsConfig, ch *v4beta1.RequirementsConfig) { - assert.True(t, orig.Storage.Logs.Enabled && orig.Storage.Logs.URL == "value1" && - orig.Storage.Repository.Enabled && orig.Storage.Repository.URL == "value3" && - orig.Storage.Reports.Enabled == ch.Storage.Reports.Enabled, + assert.True(t, orig.GetStorageURL("logs") == "value1" && + orig.GetStorageURL("repository") == "value3" && + orig.GetStorageURL("reports") == "value2", "The storage configuration should've been merged correctly") }, }, diff --git a/pkg/apis/jenkins.io/v4beta1/test_data/build_pack_library.yaml b/pkg/apis/core/v4beta1/test_data/build_pack_library.yaml similarity index 100% rename from pkg/apis/jenkins.io/v4beta1/test_data/build_pack_library.yaml rename to pkg/apis/core/v4beta1/test_data/build_pack_library.yaml diff --git a/pkg/apis/jenkins.io/v4beta1/test_data/environment/git_public_false_git_private_nil.json b/pkg/apis/core/v4beta1/test_data/environment/git_public_false_git_private_nil.json similarity index 100% rename from pkg/apis/jenkins.io/v4beta1/test_data/environment/git_public_false_git_private_nil.json rename to pkg/apis/core/v4beta1/test_data/environment/git_public_false_git_private_nil.json diff --git a/pkg/apis/jenkins.io/v4beta1/test_data/environment/git_public_nil_git_private_false.json b/pkg/apis/core/v4beta1/test_data/environment/git_public_nil_git_private_false.json similarity index 100% rename from pkg/apis/jenkins.io/v4beta1/test_data/environment/git_public_nil_git_private_false.json rename to pkg/apis/core/v4beta1/test_data/environment/git_public_nil_git_private_false.json diff --git a/pkg/apis/jenkins.io/v4beta1/test_data/environment/git_public_nil_git_private_true.json b/pkg/apis/core/v4beta1/test_data/environment/git_public_nil_git_private_true.json similarity index 100% rename from pkg/apis/jenkins.io/v4beta1/test_data/environment/git_public_nil_git_private_true.json rename to pkg/apis/core/v4beta1/test_data/environment/git_public_nil_git_private_true.json diff --git a/pkg/apis/jenkins.io/v4beta1/test_data/environment/git_public_true_git_private_nil.json b/pkg/apis/core/v4beta1/test_data/environment/git_public_true_git_private_nil.json similarity index 100% rename from pkg/apis/jenkins.io/v4beta1/test_data/environment/git_public_true_git_private_nil.json rename to pkg/apis/core/v4beta1/test_data/environment/git_public_true_git_private_nil.json diff --git a/pkg/apis/jenkins.io/v4beta1/test_data/environment/git_public_true_git_private_true.json b/pkg/apis/core/v4beta1/test_data/environment/git_public_true_git_private_true.json similarity index 100% rename from pkg/apis/jenkins.io/v4beta1/test_data/environment/git_public_true_git_private_true.json rename to pkg/apis/core/v4beta1/test_data/environment/git_public_true_git_private_true.json diff --git a/pkg/apis/jenkins.io/v4beta1/test_data/git_public_false_git_private_nil.yaml b/pkg/apis/core/v4beta1/test_data/git_public_false_git_private_nil.yaml similarity index 100% rename from pkg/apis/jenkins.io/v4beta1/test_data/git_public_false_git_private_nil.yaml rename to pkg/apis/core/v4beta1/test_data/git_public_false_git_private_nil.yaml diff --git a/pkg/apis/jenkins.io/v4beta1/test_data/git_public_nil_git_private_false.yaml b/pkg/apis/core/v4beta1/test_data/git_public_nil_git_private_false.yaml similarity index 100% rename from pkg/apis/jenkins.io/v4beta1/test_data/git_public_nil_git_private_false.yaml rename to pkg/apis/core/v4beta1/test_data/git_public_nil_git_private_false.yaml diff --git a/pkg/apis/jenkins.io/v4beta1/test_data/git_public_nil_git_private_true.yaml b/pkg/apis/core/v4beta1/test_data/git_public_nil_git_private_true.yaml similarity index 100% rename from pkg/apis/jenkins.io/v4beta1/test_data/git_public_nil_git_private_true.yaml rename to pkg/apis/core/v4beta1/test_data/git_public_nil_git_private_true.yaml diff --git a/pkg/apis/jenkins.io/v4beta1/test_data/git_public_true_git_private_nil.yaml b/pkg/apis/core/v4beta1/test_data/git_public_true_git_private_nil.yaml similarity index 100% rename from pkg/apis/jenkins.io/v4beta1/test_data/git_public_true_git_private_nil.yaml rename to pkg/apis/core/v4beta1/test_data/git_public_true_git_private_nil.yaml diff --git a/pkg/apis/jenkins.io/v4beta1/test_data/git_public_true_git_private_true.yaml b/pkg/apis/core/v4beta1/test_data/git_public_true_git_private_true.yaml similarity index 100% rename from pkg/apis/jenkins.io/v4beta1/test_data/git_public_true_git_private_true.yaml rename to pkg/apis/core/v4beta1/test_data/git_public_true_git_private_true.yaml diff --git a/pkg/apis/jenkins.io/v4beta1/test_data/jx-requirements-syntax-error/jx-requirements.yml b/pkg/apis/core/v4beta1/test_data/jx-requirements-syntax-error/jx-requirements.yml similarity index 93% rename from pkg/apis/jenkins.io/v4beta1/test_data/jx-requirements-syntax-error/jx-requirements.yml rename to pkg/apis/core/v4beta1/test_data/jx-requirements-syntax-error/jx-requirements.yml index 699bb83..98d95aa 100644 --- a/pkg/apis/jenkins.io/v4beta1/test_data/jx-requirements-syntax-error/jx-requirements.yml +++ b/pkg/apis/core/v4beta1/test_data/jx-requirements-syntax-error/jx-requirements.yml @@ -21,9 +21,6 @@ environments: production: false key: dev namespace: staging # property namespace is not allowed -kaniko: true repository: nexus secretStorage: vault -velero: - namespace: velero webhook: lighthouse diff --git a/pkg/apis/jenkins.io/v4beta1/test_data/jx-requirements.yml b/pkg/apis/core/v4beta1/test_data/jx-requirements.yml similarity index 92% rename from pkg/apis/jenkins.io/v4beta1/test_data/jx-requirements.yml rename to pkg/apis/core/v4beta1/test_data/jx-requirements.yml index 902a978..c8d259a 100644 --- a/pkg/apis/jenkins.io/v4beta1/test_data/jx-requirements.yml +++ b/pkg/apis/core/v4beta1/test_data/jx-requirements.yml @@ -20,9 +20,6 @@ environments: enabled: true production: false key: dev -kaniko: true repository: nexus secretStorage: vault -velero: - namespace: velero webhook: lighthouse \ No newline at end of file diff --git a/pkg/apis/core/v4beta1/test_data/pipeline/old-pa.yaml b/pkg/apis/core/v4beta1/test_data/pipeline/old-pa.yaml new file mode 100644 index 0000000..e69de29 diff --git a/pkg/apis/jenkins.io/v4beta1/types_environment.go b/pkg/apis/core/v4beta1/types_environment.go similarity index 89% rename from pkg/apis/jenkins.io/v4beta1/types_environment.go rename to pkg/apis/core/v4beta1/types_environment.go index 476d30f..a66befe 100644 --- a/pkg/apis/jenkins.io/v4beta1/types_environment.go +++ b/pkg/apis/core/v4beta1/types_environment.go @@ -7,7 +7,6 @@ import ( "github.com/jenkins-x/jx-logging/v3/pkg/log" batchv1 "k8s.io/api/batch/v1" - rbacv1 "k8s.io/api/rbac/v1" metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" ) @@ -226,39 +225,6 @@ type UserSpec struct { ImageURL string `json:"imageUrl,omitempty" protobuf:"bytes,4,opt,name=imageUrl"` } -// +genclient -// +genclient:noStatus -// +k8s:deepcopy-gen:interfaces=k8s.io/apimachinery/pkg/runtime.Object -// +k8s:openapi-gen=true - -// EnvironmentRoleBinding is like a vanilla RoleBinding but applies to a set of Namespaces based on an Environment filter -// so that roles can be bound to multiple namespaces easily. -// -// For example to specify the binding of roles on all Preview environments or on all permanent environments. -type EnvironmentRoleBinding struct { - metav1.TypeMeta `json:",inline"` - // Standard object's metadata. - // More info: https://git.k8s.io/community/contributors/devel/api-conventions.md#metadata - // +optional - metav1.ObjectMeta `json:"metadata,omitempty" protobuf:"bytes,1,opt,name=metadata"` - - Spec EnvironmentRoleBindingSpec `json:"spec,omitempty" protobuf:"bytes,2,opt,name=spec"` - Status EnvironmentRoleBindingStatus `json:"status,omitempty" protobuf:"bytes,3,opt,name=status"` -} - -// EnvironmentRoleBindingSpec is the specification of an EnvironmentRoleBinding -type EnvironmentRoleBindingSpec struct { - // Subjects holds references to the objects the role applies to. - Subjects []rbacv1.Subject `json:"subjects" protobuf:"bytes,2,rep,name=subjects"` - - // RoleRef can reference a Role in the current namespace or a ClusterRole in the global namespace. - // If the RoleRef cannot be resolved, the Authorizer must return an error. - RoleRef rbacv1.RoleRef `json:"roleRef" protobuf:"bytes,3,opt,name=roleRef"` - - // specifies which sets of environments this binding applies to - Environments []EnvironmentFilter `json:"environments,omitempty" protobuf:"bytes,4,opt,name=environments"` -} - // EnvironmentFilter specifies the environments to apply the role binding to type EnvironmentFilter struct { Kind EnvironmentKindType `json:"kind,omitempty" protobuf:"bytes,1,opt,name=kind"` @@ -271,16 +237,6 @@ type EnvironmentRoleBindingStatus struct { Version string `json:"version,omitempty"` } -// +k8s:deepcopy-gen:interfaces=k8s.io/apimachinery/pkg/runtime.Object - -// EnvironmentRoleBindingList is a list of TypeMeta resources -type EnvironmentRoleBindingList struct { - metav1.TypeMeta `json:",inline"` - metav1.ListMeta `json:"metadata"` - - Items []EnvironmentRoleBinding `json:"items"` -} - // StorageLocationOrDefault returns the storage location if there is one or returns the default storage configuration func (t *TeamSettings) StorageLocationOrDefault(classifier string) StorageLocation { for idx, sl := range t.StorageLocations { diff --git a/pkg/apis/jenkins.io/v4beta1/types_environment_test.go b/pkg/apis/core/v4beta1/types_environment_test.go similarity index 100% rename from pkg/apis/jenkins.io/v4beta1/types_environment_test.go rename to pkg/apis/core/v4beta1/types_environment_test.go diff --git a/pkg/apis/core/v4beta1/types_extensions.go b/pkg/apis/core/v4beta1/types_extensions.go new file mode 100644 index 0000000..4d83e37 --- /dev/null +++ b/pkg/apis/core/v4beta1/types_extensions.go @@ -0,0 +1,117 @@ +package v4beta1 + +import ( + "github.com/jenkins-x/jx-api/v3/pkg/util" + metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" +) + +// +genclient +// +genclient:noStatus +// +k8s:deepcopy-gen:interfaces=k8s.io/apimachinery/pkg/runtime.Object + +// SourceRepository is the metadata for an Application/Project/SourceRepository +type SourceRepository struct { + metav1.TypeMeta `json:",inline"` + // Standard object's metadata. + // More info: https://git.k8s.io/community/contributors/devel/api-conventions.md#metadata + // +optional + metav1.ObjectMeta `json:"metadata,omitempty" protobuf:"bytes,1,opt,name=metadata"` + + Spec SourceRepositorySpec `json:"spec,omitempty" protobuf:"bytes,2,opt,name=spec"` +} + +// Sanitize sanitizes the source repository URL +func (repo *SourceRepository) Sanitize() { + repo.Spec.URL = util.SanitizeURL(repo.Spec.URL) + repo.Spec.HTTPCloneURL = util.SanitizeURL(repo.Spec.HTTPCloneURL) + repo.Spec.SSHCloneURL = util.SanitizeURL(repo.Spec.SSHCloneURL) + // The URL is stored sometimes in the provider and provider name + repo.Spec.Provider = util.SanitizeURL(repo.Spec.Provider) + repo.Spec.ProviderName = util.SanitizeURL(repo.Spec.ProviderName) +} + +// +k8s:deepcopy-gen:interfaces=k8s.io/apimachinery/pkg/runtime.Object + +// SourceRepositoryList is a structure used by k8s to store lists of apps +type SourceRepositoryList struct { + metav1.TypeMeta `json:",inline"` + metav1.ListMeta `json:"metadata"` + + Items []SourceRepository `json:"items"` +} + +// SourceRepositorySpec provides details of the metadata for an App +type SourceRepositorySpec struct { + Description string `json:"description,omitempty" protobuf:"bytes,1,opt,name=description"` + // Provider stores the URL of the git provider such as https://github.com + Provider string `json:"provider,omitempty" protobuf:"bytes,2,opt,name=provider"` + Org string `json:"org,omitempty" protobuf:"bytes,3,opt,name=org"` + Repo string `json:"repo,omitempty" protobuf:"bytes,4,opt,name=repo"` + // ProviderName is a logical name for the provider without any URL scheme which can be used in a label selector + ProviderName string `json:"providerName,omitempty" protobuf:"bytes,5,opt,name=providerName"` + // ProviderKind is the kind of provider (github / bitbucketcloud / bitbucketserver etc) + ProviderKind string `json:"providerKind,omitempty" protobuf:"bytes,6,opt,name=providerKind"` + // URL is the web URL of the project page + URL string `json:"url,omitempty" protobuf:"bytes,7,opt,name=url"` + // SSHCloneURL is the git URL to clone this repository using SSH + SSHCloneURL string `json:"sshCloneURL,omitempty" protobuf:"bytes,8,opt,name=sshCloneURL"` + // HTTPCloneURL is the git URL to clone this repository using HTTP/HTTPS + HTTPCloneURL string `json:"httpCloneURL,omitempty" protobuf:"bytes,9,opt,name=httpCloneURL"` + // Scheduler a reference to a custom scheduler otherwise we default to the Team's Scededuler + Scheduler ResourceReference `json:"scheduler,omitempty" protobuf:"bytes,10,opt,name=scheduler"` +} + +// PipelineExtension defines the image and command of an app which wants to modify/extend the pipeline +type PipelineExtension struct { + // Name of the container specified as a DNS_LABEL. + Name string `json:"name" protobuf:"bytes,1,opt,name=name"` + // Docker image name. + Image string `json:"image,omitempty" protobuf:"bytes,2,opt,name=image"` + // Entrypoint array. Not executed within a shell. + Command string `json:"command,omitempty" protobuf:"bytes,3,rep,name=command"` + // Arguments to the entrypoint. + Args []string `json:"args,omitempty" protobuf:"bytes,4,rep,name=args"` +} + +// +k8s:deepcopy-gen:interfaces=k8s.io/apimachinery/pkg/runtime.Object + +// PluginList is a list of Plugins available for a team +type PluginList struct { + metav1.TypeMeta `json:",inline"` + metav1.ListMeta `json:"metadata"` + + Items []Plugin `json:"items"` +} + +// +genclient +// +genclient:noStatus +// +k8s:deepcopy-gen:interfaces=k8s.io/apimachinery/pkg/runtime.Object +// +k8s:openapi-gen=true + +// Plugin represents a binary plugin installed into this Jenkins X team +type Plugin struct { + metav1.TypeMeta `json:",inline"` + // Standard object's metadata. + // More info: https://git.k8s.io/community/contributors/devel/api-conventions.md#metadata + // +optional + metav1.ObjectMeta `json:"metadata,omitempty" protobuf:"bytes,1,opt,name=metadata"` + + Spec PluginSpec `json:"spec,omitempty" protobuf:"bytes,2,opt,name=spec"` +} + +// PluginSpec provides details of a binary plugin available for a team +type PluginSpec struct { + SubCommand string `json:"subCommand,omitempty" protobuf:"bytes,3,opt,name=subCommand"` + Group string `json:"group,omitempty" protobuf:"bytes,4,opt,name=group"` + Binaries []Binary `json:"binaries,omitempty" protobuf:"bytes,7opt,name=binaries"` + Description string `json:"description,omitempty" protobuf:"bytes,2,opt,name=description"` + Name string `json:"name,omitempty" protobuf:"bytes,5,opt,name=name"` + Version string `json:"version,omitempty" protobuf:"bytes,6,opt,name=version"` +} + +// Binary provies the details of a downloadable binary +type Binary struct { + Goarch string `json:"goarch,omitempty" protobuf:"bytes,1,opt,name=goarch"` + Goos string `json:"goos,omitempty" protobuf:"bytes,2,opt,name=goos"` + URL string `json:"url,omitempty" protobuf:"bytes,3,opt,name=url"` +} diff --git a/pkg/apis/jenkins.io/v4beta1/types_pipeline.go b/pkg/apis/core/v4beta1/types_pipeline.go similarity index 74% rename from pkg/apis/jenkins.io/v4beta1/types_pipeline.go rename to pkg/apis/core/v4beta1/types_pipeline.go index f29a3b5..7dcfa3d 100644 --- a/pkg/apis/jenkins.io/v4beta1/types_pipeline.go +++ b/pkg/apis/core/v4beta1/types_pipeline.go @@ -35,38 +35,31 @@ type PipelineActivity struct { // PipelineActivitySpec is the specification of the pipeline activity type PipelineActivitySpec struct { - Pipeline string `json:"pipeline,omitempty" protobuf:"bytes,1,opt,name=pipeline"` - Build string `json:"build,omitempty" protobuf:"bytes,2,opt,name=build"` - Version string `json:"version,omitempty" protobuf:"bytes,3,opt,name=version"` - Status ActivityStatusType `json:"status,omitempty" protobuf:"bytes,4,opt,name=status"` - StartedTimestamp *metav1.Time `json:"startedTimestamp,omitempty" protobuf:"bytes,5,opt,name=startedTimestamp"` - CompletedTimestamp *metav1.Time `json:"completedTimestamp,omitempty" protobuf:"bytes,6,opt,name=completedTimestamp"` - Steps []PipelineActivityStep `json:"steps,omitempty" protobuf:"bytes,7,opt,name=steps"` - BuildURL string `json:"buildUrl,omitempty" protobuf:"bytes,8,opt,name=buildUrl"` - BuildLogsURL string `json:"buildLogsUrl,omitempty" protobuf:"bytes,9,opt,name=buildLogsUrl"` - GitURL string `json:"gitUrl,omitempty" protobuf:"bytes,10,opt,name=gitUrl"` - GitRepository string `json:"gitRepository,omitempty" protobuf:"bytes,11,opt,name=gitRepository"` - GitOwner string `json:"gitOwner,omitempty" protobuf:"bytes,12,opt,name=gitOwner"` - GitBranch string `json:"gitBranch,omitempty" protobuf:"bytes,13,opt,name=gitBranch"` - Author string `json:"author,omitempty" protobuf:"bytes,14,opt,name=author"` - AuthorAvatarURL string `json:"authorAvatarURL,omitempty" protobuf:"bytes,14,opt,name=authorAvatarURL"` - AuthorURL string `json:"authorURL,omitempty" protobuf:"bytes,14,opt,name=authorURL"` - PullTitle string `json:"pullTitle,omitempty" protobuf:"bytes,15,opt,name=pullTitle"` - ReleaseNotesURL string `json:"releaseNotesURL,omitempty" protobuf:"bytes,16,opt,name=releaseNotesURL"` - LastCommitSHA string `json:"lastCommitSHA,omitempty" protobuf:"bytes,17,opt,name=lastCommitSHA"` - LastCommitMessage string `json:"lastCommitMessage,omitempty" protobuf:"bytes,18,opt,name=lastCommitMessage"` - LastCommitURL string `json:"lastCommitURL,omitempty" protobuf:"bytes,19,opt,name=lastCommitURL"` - // Deprecated - Workflow functionality was removed and is obsolete - // Keeping these fields to ensure backwards compatibility - // Should be removed when we increment spec version - Workflow string `json:"workflow,omitempty" protobuf:"bytes,20,opt,name=workflow"` - WorkflowStatus ActivityStatusType `json:"workflowStatus,omitempty" protobuf:"bytes,21,opt,name=workflowStatus"` - WorkflowMessage string `json:"workflowMessage,omitempty" protobuf:"bytes,22,opt,name=workflowMessage"` - PostExtensions []ExtensionExecution `json:"postExtensions,omitempty" protobuf:"bytes,23,opt,name=postExtensions"` - Attachments []Attachment `json:"attachments,omitempty" protobuf:"bytes,24,opt,name=attachments"` - BatchPipelineActivity BatchPipelineActivity `json:"batchPipelineActivity,omitempty" protobuf:"bytes,25,opt,name=batchPipelineActivity"` - Context string `json:"context,omitempty" protobuf:"bytes,26,opt,name=context"` - BaseSHA string `json:"baseSHA,omitempty" protobuf:"bytes,27,opt,name=baseSHA"` + Pipeline string `json:"pipeline,omitempty" protobuf:"bytes,1,opt,name=pipeline"` + Build string `json:"build,omitempty" protobuf:"bytes,2,opt,name=build"` + Version string `json:"version,omitempty" protobuf:"bytes,3,opt,name=version"` + Status ActivityStatusType `json:"status,omitempty" protobuf:"bytes,4,opt,name=status"` + StartedTimestamp *metav1.Time `json:"startedTimestamp,omitempty" protobuf:"bytes,5,opt,name=startedTimestamp"` + CompletedTimestamp *metav1.Time `json:"completedTimestamp,omitempty" protobuf:"bytes,6,opt,name=completedTimestamp"` + Steps []PipelineActivityStep `json:"steps,omitempty" protobuf:"bytes,7,opt,name=steps"` + BuildURL string `json:"buildUrl,omitempty" protobuf:"bytes,8,opt,name=buildUrl"` + BuildLogsURL string `json:"buildLogsUrl,omitempty" protobuf:"bytes,9,opt,name=buildLogsUrl"` + GitURL string `json:"gitUrl,omitempty" protobuf:"bytes,10,opt,name=gitUrl"` + GitRepository string `json:"gitRepository,omitempty" protobuf:"bytes,11,opt,name=gitRepository"` + GitOwner string `json:"gitOwner,omitempty" protobuf:"bytes,12,opt,name=gitOwner"` + GitBranch string `json:"gitBranch,omitempty" protobuf:"bytes,13,opt,name=gitBranch"` + Author string `json:"author,omitempty" protobuf:"bytes,14,opt,name=author"` + AuthorAvatarURL string `json:"authorAvatarURL,omitempty" protobuf:"bytes,14,opt,name=authorAvatarURL"` + AuthorURL string `json:"authorURL,omitempty" protobuf:"bytes,14,opt,name=authorURL"` + PullTitle string `json:"pullTitle,omitempty" protobuf:"bytes,15,opt,name=pullTitle"` + ReleaseNotesURL string `json:"releaseNotesURL,omitempty" protobuf:"bytes,16,opt,name=releaseNotesURL"` + LastCommitSHA string `json:"lastCommitSHA,omitempty" protobuf:"bytes,17,opt,name=lastCommitSHA"` + LastCommitMessage string `json:"lastCommitMessage,omitempty" protobuf:"bytes,18,opt,name=lastCommitMessage"` + LastCommitURL string `json:"lastCommitURL,omitempty" protobuf:"bytes,19,opt,name=lastCommitURL"` + Attachments []Attachment `json:"attachments,omitempty" protobuf:"bytes,24,opt,name=attachments"` + BatchPipelineActivity BatchPipelineActivity `json:"batchPipelineActivity,omitempty" protobuf:"bytes,25,opt,name=batchPipelineActivity"` + Context string `json:"context,omitempty" protobuf:"bytes,26,opt,name=context"` + BaseSHA string `json:"baseSHA,omitempty" protobuf:"bytes,27,opt,name=baseSHA"` } // BatchPipelineActivity contains information about a batch build, used by both the batch build and its comprising PRs for linking them together diff --git a/pkg/apis/jenkins.io/v4beta1/types_release.go b/pkg/apis/core/v4beta1/types_release.go similarity index 82% rename from pkg/apis/jenkins.io/v4beta1/types_release.go rename to pkg/apis/core/v4beta1/types_release.go index 33b1b37..d0a0aad 100644 --- a/pkg/apis/jenkins.io/v4beta1/types_release.go +++ b/pkg/apis/core/v4beta1/types_release.go @@ -86,6 +86,25 @@ type CommitSummary struct { IssueIDs []string `json:"issueIds,omitempty" protobuf:"bytes,7,opt,name=issueIds"` } +// UserDetails containers details of a user +type UserDetails struct { + Login string `json:"login,omitempty" protobuf:"bytes,1,opt,name=login"` + Name string `json:"name,omitempty" protobuf:"bytes,2,opt,name=name"` + Email string `json:"email,omitempty" protobuf:"bytes,3,opt,name=email"` + CreationTimestamp *metav1.Time `json:"creationTimestamp,omitempty" protobuf:"bytes,4,opt,name=creationTimestamp"` + URL string `json:"url,omitempty" protobuf:"bytes,5,opt,name=url"` + AvatarURL string `json:"avatarUrl,omitempty" protobuf:"bytes,6,opt,name=avatarUrl"` + ServiceAccount string `json:"serviceAccount,omitempty" protobuf:"bytes,7,opt,name=serviceAccount"` + Accounts []AccountReference `json:"accountReference,omitempty" protobuf:"bytes,8,opt,name=accountReference"` + ExternalUser bool `json:"externalUser,omitempty" protobuf:"bytes,9,opt,name=externalUser"` +} + +// AccountReference is a reference to a user account in another system that is attached to this user +type AccountReference struct { + Provider string `json:"provider,omitempty" protobuf:"bytes,1,opt,name=provider"` + ID string `json:"id,omitempty" protobuf:"bytes,2,opt,name=id"` +} + // ReleaseStatusType is the status of a release; usually deployed or failed at completion type ReleaseStatusType string @@ -106,39 +125,6 @@ func (i *IssueSummary) IsClosed() bool { return strings.HasPrefix(lower, "clos") || strings.HasPrefix(lower, "fix") } -// +genclient -// +genclient:noStatus -// +k8s:deepcopy-gen:interfaces=k8s.io/apimachinery/pkg/runtime.Object -// +k8s:openapi-gen=true - -// GitService represents a git provider so we can map the host name to a kinda of git service -type GitService struct { - metav1.TypeMeta `json:",inline"` - // Standard object's metadata. - // More info: https://git.k8s.io/community/contributors/devel/api-conventions.md#metadata - // +optional - metav1.ObjectMeta `json:"metadata,omitempty" protobuf:"bytes,1,opt,name=metadata"` - - Spec GitServiceSpec `json:"spec,omitempty" protobuf:"bytes,2,opt,name=spec"` -} - -// GitServiceSpec is the specification of an GitService -type GitServiceSpec struct { - GitKind string `json:"gitKind,omitempty" protobuf:"bytes,1,opt,name=gitKind"` - URL string `json:"url,omitempty" protobuf:"bytes,2,opt,name=host"` - Name string `json:"name,omitempty" protobuf:"bytes,3,opt,name=host"` -} - -// +k8s:deepcopy-gen:interfaces=k8s.io/apimachinery/pkg/runtime.Object - -// GitServiceList is a list of GitService resources -type GitServiceList struct { - metav1.TypeMeta `json:",inline"` - metav1.ListMeta `json:"metadata"` - - Items []GitService `json:"items"` -} - //DependencyUpdate describes an dependency update message from the commit log type DependencyUpdate struct { DependencyUpdateDetails `json:",inline"` diff --git a/pkg/apis/jenkins.io/v4beta1/zz_generated.deepcopy.go b/pkg/apis/core/v4beta1/zz_generated.deepcopy.go similarity index 56% rename from pkg/apis/jenkins.io/v4beta1/zz_generated.deepcopy.go rename to pkg/apis/core/v4beta1/zz_generated.deepcopy.go index 1605821..d5f7a21 100644 --- a/pkg/apis/jenkins.io/v4beta1/zz_generated.deepcopy.go +++ b/pkg/apis/core/v4beta1/zz_generated.deepcopy.go @@ -20,9 +20,7 @@ limitations under the License. package v4beta1 import ( - batchv1 "k8s.io/api/batch/v1" - v1 "k8s.io/api/core/v1" - rbacv1 "k8s.io/api/rbac/v1" + v1 "k8s.io/api/batch/v1" runtime "k8s.io/apimachinery/pkg/runtime" ) @@ -42,97 +40,6 @@ func (in *AccountReference) DeepCopy() *AccountReference { return out } -// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. -func (in *App) DeepCopyInto(out *App) { - *out = *in - 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 App. -func (in *App) DeepCopy() *App { - if in == nil { - return nil - } - out := new(App) - in.DeepCopyInto(out) - return out -} - -// DeepCopyObject is an autogenerated deepcopy function, copying the receiver, creating a new runtime.Object. -func (in *App) DeepCopyObject() runtime.Object { - if c := in.DeepCopy(); c != nil { - return c - } - return nil -} - -// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. -func (in *AppList) DeepCopyInto(out *AppList) { - *out = *in - out.TypeMeta = in.TypeMeta - in.ListMeta.DeepCopyInto(&out.ListMeta) - if in.Items != nil { - in, out := &in.Items, &out.Items - *out = make([]App, len(*in)) - for i := range *in { - (*in)[i].DeepCopyInto(&(*out)[i]) - } - } - return -} - -// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new AppList. -func (in *AppList) DeepCopy() *AppList { - if in == nil { - return nil - } - out := new(AppList) - in.DeepCopyInto(out) - return out -} - -// DeepCopyObject is an autogenerated deepcopy function, copying the receiver, creating a new runtime.Object. -func (in *AppList) DeepCopyObject() runtime.Object { - if c := in.DeepCopy(); c != nil { - return c - } - return nil -} - -// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. -func (in *AppSpec) DeepCopyInto(out *AppSpec) { - *out = *in - if in.SchemaPreprocessor != nil { - in, out := &in.SchemaPreprocessor, &out.SchemaPreprocessor - *out = new(v1.Container) - (*in).DeepCopyInto(*out) - } - if in.SchemaPreprocessorRole != nil { - in, out := &in.SchemaPreprocessorRole, &out.SchemaPreprocessorRole - *out = new(rbacv1.Role) - (*in).DeepCopyInto(*out) - } - if in.PipelineExtension != nil { - in, out := &in.PipelineExtension, &out.PipelineExtension - *out = new(PipelineExtension) - (*in).DeepCopyInto(*out) - } - return -} - -// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new AppSpec. -func (in *AppSpec) DeepCopy() *AppSpec { - if in == nil { - return nil - } - out := new(AppSpec) - in.DeepCopyInto(out) - return out -} - // DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. func (in *Attachment) DeepCopyInto(out *Attachment) { *out = *in @@ -244,105 +151,6 @@ func (in *Binary) DeepCopy() *Binary { return out } -// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. -func (in *BuildPack) DeepCopyInto(out *BuildPack) { - *out = *in - 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 BuildPack. -func (in *BuildPack) DeepCopy() *BuildPack { - if in == nil { - return nil - } - out := new(BuildPack) - in.DeepCopyInto(out) - return out -} - -// DeepCopyObject is an autogenerated deepcopy function, copying the receiver, creating a new runtime.Object. -func (in *BuildPack) DeepCopyObject() runtime.Object { - if c := in.DeepCopy(); c != nil { - return c - } - return nil -} - -// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. -func (in *BuildPackList) DeepCopyInto(out *BuildPackList) { - *out = *in - out.TypeMeta = in.TypeMeta - in.ListMeta.DeepCopyInto(&out.ListMeta) - if in.Items != nil { - in, out := &in.Items, &out.Items - *out = make([]BuildPack, len(*in)) - for i := range *in { - (*in)[i].DeepCopyInto(&(*out)[i]) - } - } - return -} - -// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new BuildPackList. -func (in *BuildPackList) DeepCopy() *BuildPackList { - if in == nil { - return nil - } - out := new(BuildPackList) - in.DeepCopyInto(out) - return out -} - -// DeepCopyObject is an autogenerated deepcopy function, copying the receiver, creating a new runtime.Object. -func (in *BuildPackList) DeepCopyObject() runtime.Object { - if c := in.DeepCopy(); c != nil { - return c - } - return nil -} - -// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. -func (in *BuildPackSpec) DeepCopyInto(out *BuildPackSpec) { - *out = *in - if in.QuickstartLocations != nil { - in, out := &in.QuickstartLocations, &out.QuickstartLocations - *out = make([]QuickStartLocation, len(*in)) - for i := range *in { - (*in)[i].DeepCopyInto(&(*out)[i]) - } - } - return -} - -// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new BuildPackSpec. -func (in *BuildPackSpec) DeepCopy() *BuildPackSpec { - if in == nil { - return nil - } - out := new(BuildPackSpec) - in.DeepCopyInto(out) - return out -} - -// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. -func (in *ChartRef) DeepCopyInto(out *ChartRef) { - *out = *in - return -} - -// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new ChartRef. -func (in *ChartRef) DeepCopy() *ChartRef { - if in == nil { - return nil - } - out := new(ChartRef) - in.DeepCopyInto(out) - return out -} - // DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. func (in *ClusterConfig) DeepCopyInto(out *ClusterConfig) { *out = *in @@ -374,144 +182,6 @@ func (in *ClusterConfig) DeepCopy() *ClusterConfig { return out } -// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. -func (in *CommitStatus) DeepCopyInto(out *CommitStatus) { - *out = *in - 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 CommitStatus. -func (in *CommitStatus) DeepCopy() *CommitStatus { - if in == nil { - return nil - } - out := new(CommitStatus) - in.DeepCopyInto(out) - return out -} - -// DeepCopyObject is an autogenerated deepcopy function, copying the receiver, creating a new runtime.Object. -func (in *CommitStatus) DeepCopyObject() runtime.Object { - if c := in.DeepCopy(); c != nil { - return c - } - return nil -} - -// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. -func (in *CommitStatusCommitReference) DeepCopyInto(out *CommitStatusCommitReference) { - *out = *in - return -} - -// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new CommitStatusCommitReference. -func (in *CommitStatusCommitReference) DeepCopy() *CommitStatusCommitReference { - if in == nil { - return nil - } - out := new(CommitStatusCommitReference) - in.DeepCopyInto(out) - return out -} - -// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. -func (in *CommitStatusDetails) DeepCopyInto(out *CommitStatusDetails) { - *out = *in - out.PipelineActivity = in.PipelineActivity - if in.Items != nil { - in, out := &in.Items, &out.Items - *out = make([]CommitStatusItem, len(*in)) - copy(*out, *in) - } - out.Commit = in.Commit - return -} - -// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new CommitStatusDetails. -func (in *CommitStatusDetails) DeepCopy() *CommitStatusDetails { - if in == nil { - return nil - } - out := new(CommitStatusDetails) - in.DeepCopyInto(out) - return out -} - -// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. -func (in *CommitStatusItem) DeepCopyInto(out *CommitStatusItem) { - *out = *in - return -} - -// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new CommitStatusItem. -func (in *CommitStatusItem) DeepCopy() *CommitStatusItem { - if in == nil { - return nil - } - out := new(CommitStatusItem) - in.DeepCopyInto(out) - return out -} - -// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. -func (in *CommitStatusList) DeepCopyInto(out *CommitStatusList) { - *out = *in - out.TypeMeta = in.TypeMeta - in.ListMeta.DeepCopyInto(&out.ListMeta) - if in.Items != nil { - in, out := &in.Items, &out.Items - *out = make([]CommitStatus, len(*in)) - for i := range *in { - (*in)[i].DeepCopyInto(&(*out)[i]) - } - } - return -} - -// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new CommitStatusList. -func (in *CommitStatusList) DeepCopy() *CommitStatusList { - if in == nil { - return nil - } - out := new(CommitStatusList) - in.DeepCopyInto(out) - return out -} - -// DeepCopyObject is an autogenerated deepcopy function, copying the receiver, creating a new runtime.Object. -func (in *CommitStatusList) DeepCopyObject() runtime.Object { - if c := in.DeepCopy(); c != nil { - return c - } - return nil -} - -// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. -func (in *CommitStatusSpec) DeepCopyInto(out *CommitStatusSpec) { - *out = *in - if in.Items != nil { - in, out := &in.Items, &out.Items - *out = make([]CommitStatusDetails, len(*in)) - for i := range *in { - (*in)[i].DeepCopyInto(&(*out)[i]) - } - } - return -} - -// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new CommitStatusSpec. -func (in *CommitStatusSpec) DeepCopy() *CommitStatusSpec { - if in == nil { - return nil - } - out := new(CommitStatusSpec) - in.DeepCopyInto(out) - return out -} - // DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. func (in *CommitSummary) DeepCopyInto(out *CommitSummary) { *out = *in @@ -678,7 +348,11 @@ func (in *Environment) DeepCopyObject() runtime.Object { // DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. func (in *EnvironmentConfig) DeepCopyInto(out *EnvironmentConfig) { *out = *in - out.Ingress = in.Ingress + if in.Ingress != nil { + in, out := &in.Ingress, &out.Ingress + *out = new(IngressConfig) + (*in).DeepCopyInto(*out) + } return } @@ -767,96 +441,6 @@ func (in *EnvironmentRepository) DeepCopy() *EnvironmentRepository { return out } -// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. -func (in *EnvironmentRoleBinding) DeepCopyInto(out *EnvironmentRoleBinding) { - *out = *in - out.TypeMeta = in.TypeMeta - 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 EnvironmentRoleBinding. -func (in *EnvironmentRoleBinding) DeepCopy() *EnvironmentRoleBinding { - if in == nil { - return nil - } - out := new(EnvironmentRoleBinding) - in.DeepCopyInto(out) - return out -} - -// DeepCopyObject is an autogenerated deepcopy function, copying the receiver, creating a new runtime.Object. -func (in *EnvironmentRoleBinding) DeepCopyObject() runtime.Object { - if c := in.DeepCopy(); c != nil { - return c - } - return nil -} - -// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. -func (in *EnvironmentRoleBindingList) DeepCopyInto(out *EnvironmentRoleBindingList) { - *out = *in - out.TypeMeta = in.TypeMeta - in.ListMeta.DeepCopyInto(&out.ListMeta) - if in.Items != nil { - in, out := &in.Items, &out.Items - *out = make([]EnvironmentRoleBinding, len(*in)) - for i := range *in { - (*in)[i].DeepCopyInto(&(*out)[i]) - } - } - return -} - -// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new EnvironmentRoleBindingList. -func (in *EnvironmentRoleBindingList) DeepCopy() *EnvironmentRoleBindingList { - if in == nil { - return nil - } - out := new(EnvironmentRoleBindingList) - in.DeepCopyInto(out) - return out -} - -// DeepCopyObject is an autogenerated deepcopy function, copying the receiver, creating a new runtime.Object. -func (in *EnvironmentRoleBindingList) DeepCopyObject() runtime.Object { - if c := in.DeepCopy(); c != nil { - return c - } - return nil -} - -// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. -func (in *EnvironmentRoleBindingSpec) DeepCopyInto(out *EnvironmentRoleBindingSpec) { - *out = *in - if in.Subjects != nil { - in, out := &in.Subjects, &out.Subjects - *out = make([]rbacv1.Subject, len(*in)) - copy(*out, *in) - } - out.RoleRef = in.RoleRef - if in.Environments != nil { - in, out := &in.Environments, &out.Environments - *out = make([]EnvironmentFilter, len(*in)) - for i := range *in { - (*in)[i].DeepCopyInto(&(*out)[i]) - } - } - return -} - -// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new EnvironmentRoleBindingSpec. -func (in *EnvironmentRoleBindingSpec) DeepCopy() *EnvironmentRoleBindingSpec { - if in == nil { - return nil - } - out := new(EnvironmentRoleBindingSpec) - in.DeepCopyInto(out) - return out -} - // DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. func (in *EnvironmentRoleBindingStatus) DeepCopyInto(out *EnvironmentRoleBindingStatus) { *out = *in @@ -899,475 +483,27 @@ func (in *EnvironmentStatus) DeepCopyInto(out *EnvironmentStatus) { } // DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new EnvironmentStatus. -func (in *EnvironmentStatus) DeepCopy() *EnvironmentStatus { - if in == nil { - return nil - } - out := new(EnvironmentStatus) - in.DeepCopyInto(out) - return out -} - -// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. -func (in *EnvironmentVariable) DeepCopyInto(out *EnvironmentVariable) { - *out = *in - return -} - -// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new EnvironmentVariable. -func (in *EnvironmentVariable) DeepCopy() *EnvironmentVariable { - if in == nil { - return nil - } - out := new(EnvironmentVariable) - in.DeepCopyInto(out) - return out -} - -// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. -func (in *Extension) DeepCopyInto(out *Extension) { - *out = *in - 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 Extension. -func (in *Extension) DeepCopy() *Extension { - if in == nil { - return nil - } - out := new(Extension) - in.DeepCopyInto(out) - return out -} - -// DeepCopyObject is an autogenerated deepcopy function, copying the receiver, creating a new runtime.Object. -func (in *Extension) DeepCopyObject() runtime.Object { - if c := in.DeepCopy(); c != nil { - return c - } - return nil -} - -// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. -func (in *ExtensionConfig) DeepCopyInto(out *ExtensionConfig) { - *out = *in - if in.Parameters != nil { - in, out := &in.Parameters, &out.Parameters - *out = make([]ExtensionParameterValue, len(*in)) - copy(*out, *in) - } - return -} - -// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new ExtensionConfig. -func (in *ExtensionConfig) DeepCopy() *ExtensionConfig { - if in == nil { - return nil - } - out := new(ExtensionConfig) - in.DeepCopyInto(out) - return out -} - -// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. -func (in *ExtensionConfigList) DeepCopyInto(out *ExtensionConfigList) { - *out = *in - if in.Extensions != nil { - in, out := &in.Extensions, &out.Extensions - *out = make([]ExtensionConfig, len(*in)) - for i := range *in { - (*in)[i].DeepCopyInto(&(*out)[i]) - } - } - return -} - -// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new ExtensionConfigList. -func (in *ExtensionConfigList) DeepCopy() *ExtensionConfigList { - if in == nil { - return nil - } - out := new(ExtensionConfigList) - in.DeepCopyInto(out) - return out -} - -// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. -func (in *ExtensionDefinition) DeepCopyInto(out *ExtensionDefinition) { - *out = *in - if in.When != nil { - in, out := &in.When, &out.When - *out = make([]ExtensionWhen, len(*in)) - copy(*out, *in) - } - if in.Children != nil { - in, out := &in.Children, &out.Children - *out = make([]ExtensionDefinitionChildReference, len(*in)) - copy(*out, *in) - } - if in.Parameters != nil { - in, out := &in.Parameters, &out.Parameters - *out = make([]ExtensionParameter, len(*in)) - copy(*out, *in) - } - return -} - -// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new ExtensionDefinition. -func (in *ExtensionDefinition) DeepCopy() *ExtensionDefinition { - if in == nil { - return nil - } - out := new(ExtensionDefinition) - in.DeepCopyInto(out) - return out -} - -// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. -func (in *ExtensionDefinitionChildReference) DeepCopyInto(out *ExtensionDefinitionChildReference) { - *out = *in - return -} - -// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new ExtensionDefinitionChildReference. -func (in *ExtensionDefinitionChildReference) DeepCopy() *ExtensionDefinitionChildReference { - if in == nil { - return nil - } - out := new(ExtensionDefinitionChildReference) - in.DeepCopyInto(out) - return out -} - -// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. -func (in *ExtensionDefinitionList) DeepCopyInto(out *ExtensionDefinitionList) { - *out = *in - if in.Extensions != nil { - in, out := &in.Extensions, &out.Extensions - *out = make([]ExtensionDefinition, len(*in)) - for i := range *in { - (*in)[i].DeepCopyInto(&(*out)[i]) - } - } - return -} - -// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new ExtensionDefinitionList. -func (in *ExtensionDefinitionList) DeepCopy() *ExtensionDefinitionList { - if in == nil { - return nil - } - out := new(ExtensionDefinitionList) - in.DeepCopyInto(out) - return out -} - -// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. -func (in *ExtensionDefinitionReference) DeepCopyInto(out *ExtensionDefinitionReference) { - *out = *in - return -} - -// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new ExtensionDefinitionReference. -func (in *ExtensionDefinitionReference) DeepCopy() *ExtensionDefinitionReference { - if in == nil { - return nil - } - out := new(ExtensionDefinitionReference) - in.DeepCopyInto(out) - return out -} - -// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. -func (in *ExtensionDefinitionReferenceList) DeepCopyInto(out *ExtensionDefinitionReferenceList) { - *out = *in - if in.Remotes != nil { - in, out := &in.Remotes, &out.Remotes - *out = make([]ExtensionDefinitionReference, len(*in)) - copy(*out, *in) - } - return -} - -// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new ExtensionDefinitionReferenceList. -func (in *ExtensionDefinitionReferenceList) DeepCopy() *ExtensionDefinitionReferenceList { - if in == nil { - return nil - } - out := new(ExtensionDefinitionReferenceList) - in.DeepCopyInto(out) - return out -} - -// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. -func (in *ExtensionExecution) DeepCopyInto(out *ExtensionExecution) { - *out = *in - if in.EnvironmentVariables != nil { - in, out := &in.EnvironmentVariables, &out.EnvironmentVariables - *out = make([]EnvironmentVariable, len(*in)) - copy(*out, *in) - } - return -} - -// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new ExtensionExecution. -func (in *ExtensionExecution) DeepCopy() *ExtensionExecution { - if in == nil { - return nil - } - out := new(ExtensionExecution) - in.DeepCopyInto(out) - return out -} - -// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. -func (in *ExtensionList) DeepCopyInto(out *ExtensionList) { - *out = *in - out.TypeMeta = in.TypeMeta - in.ListMeta.DeepCopyInto(&out.ListMeta) - if in.Items != nil { - in, out := &in.Items, &out.Items - *out = make([]Extension, len(*in)) - for i := range *in { - (*in)[i].DeepCopyInto(&(*out)[i]) - } - } - return -} - -// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new ExtensionList. -func (in *ExtensionList) DeepCopy() *ExtensionList { - if in == nil { - return nil - } - out := new(ExtensionList) - in.DeepCopyInto(out) - return out -} - -// DeepCopyObject is an autogenerated deepcopy function, copying the receiver, creating a new runtime.Object. -func (in *ExtensionList) DeepCopyObject() runtime.Object { - if c := in.DeepCopy(); c != nil { - return c - } - return nil -} - -// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. -func (in *ExtensionParameter) DeepCopyInto(out *ExtensionParameter) { - *out = *in - return -} - -// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new ExtensionParameter. -func (in *ExtensionParameter) DeepCopy() *ExtensionParameter { - if in == nil { - return nil - } - out := new(ExtensionParameter) - in.DeepCopyInto(out) - return out -} - -// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. -func (in *ExtensionParameterValue) DeepCopyInto(out *ExtensionParameterValue) { - *out = *in - return -} - -// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new ExtensionParameterValue. -func (in *ExtensionParameterValue) DeepCopy() *ExtensionParameterValue { - if in == nil { - return nil - } - out := new(ExtensionParameterValue) - in.DeepCopyInto(out) - return out -} - -// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. -func (in *ExtensionRepositoryLockList) DeepCopyInto(out *ExtensionRepositoryLockList) { - *out = *in - if in.Extensions != nil { - in, out := &in.Extensions, &out.Extensions - *out = make([]ExtensionSpec, len(*in)) - for i := range *in { - (*in)[i].DeepCopyInto(&(*out)[i]) - } - } - return -} - -// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new ExtensionRepositoryLockList. -func (in *ExtensionRepositoryLockList) DeepCopy() *ExtensionRepositoryLockList { - if in == nil { - return nil - } - out := new(ExtensionRepositoryLockList) - in.DeepCopyInto(out) - return out -} - -// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. -func (in *ExtensionRepositoryReference) DeepCopyInto(out *ExtensionRepositoryReference) { - *out = *in - out.Chart = in.Chart - return -} - -// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new ExtensionRepositoryReference. -func (in *ExtensionRepositoryReference) DeepCopy() *ExtensionRepositoryReference { - if in == nil { - return nil - } - out := new(ExtensionRepositoryReference) - in.DeepCopyInto(out) - return out -} - -// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. -func (in *ExtensionRepositoryReferenceList) DeepCopyInto(out *ExtensionRepositoryReferenceList) { - *out = *in - if in.Repositories != nil { - in, out := &in.Repositories, &out.Repositories - *out = make([]ExtensionRepositoryReference, len(*in)) - copy(*out, *in) - } - return -} - -// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new ExtensionRepositoryReferenceList. -func (in *ExtensionRepositoryReferenceList) DeepCopy() *ExtensionRepositoryReferenceList { - if in == nil { - return nil - } - out := new(ExtensionRepositoryReferenceList) - in.DeepCopyInto(out) - return out -} - -// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. -func (in *ExtensionSpec) DeepCopyInto(out *ExtensionSpec) { - *out = *in - if in.When != nil { - in, out := &in.When, &out.When - *out = make([]ExtensionWhen, len(*in)) - copy(*out, *in) - } - if in.Parameters != nil { - in, out := &in.Parameters, &out.Parameters - *out = make([]ExtensionParameter, len(*in)) - copy(*out, *in) - } - if in.Children != nil { - in, out := &in.Children, &out.Children - *out = make([]string, len(*in)) - copy(*out, *in) - } - return -} - -// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new ExtensionSpec. -func (in *ExtensionSpec) DeepCopy() *ExtensionSpec { - if in == nil { - return nil - } - out := new(ExtensionSpec) - in.DeepCopyInto(out) - return out -} - -// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. -func (in *GKEConfig) DeepCopyInto(out *GKEConfig) { - *out = *in - return -} - -// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new GKEConfig. -func (in *GKEConfig) DeepCopy() *GKEConfig { - if in == nil { - return nil - } - out := new(GKEConfig) - in.DeepCopyInto(out) - return out -} - -// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. -func (in *GitService) DeepCopyInto(out *GitService) { - *out = *in - 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 GitService. -func (in *GitService) DeepCopy() *GitService { - if in == nil { - return nil - } - out := new(GitService) - in.DeepCopyInto(out) - return out -} - -// DeepCopyObject is an autogenerated deepcopy function, copying the receiver, creating a new runtime.Object. -func (in *GitService) DeepCopyObject() runtime.Object { - if c := in.DeepCopy(); c != nil { - return c - } - return nil -} - -// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. -func (in *GitServiceList) DeepCopyInto(out *GitServiceList) { - *out = *in - out.TypeMeta = in.TypeMeta - in.ListMeta.DeepCopyInto(&out.ListMeta) - if in.Items != nil { - in, out := &in.Items, &out.Items - *out = make([]GitService, len(*in)) - for i := range *in { - (*in)[i].DeepCopyInto(&(*out)[i]) - } - } - return -} - -// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new GitServiceList. -func (in *GitServiceList) DeepCopy() *GitServiceList { +func (in *EnvironmentStatus) DeepCopy() *EnvironmentStatus { if in == nil { return nil } - out := new(GitServiceList) + out := new(EnvironmentStatus) in.DeepCopyInto(out) return out } -// DeepCopyObject is an autogenerated deepcopy function, copying the receiver, creating a new runtime.Object. -func (in *GitServiceList) DeepCopyObject() runtime.Object { - if c := in.DeepCopy(); c != nil { - return c - } - return nil -} - // DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. -func (in *GitServiceSpec) DeepCopyInto(out *GitServiceSpec) { +func (in *GKEConfig) DeepCopyInto(out *GKEConfig) { *out = *in return } -// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new GitServiceSpec. -func (in *GitServiceSpec) DeepCopy() *GitServiceSpec { +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new GKEConfig. +func (in *GKEConfig) DeepCopy() *GKEConfig { if in == nil { return nil } - out := new(GitServiceSpec) + out := new(GKEConfig) in.DeepCopyInto(out) return out } @@ -1391,7 +527,11 @@ func (in *GitStatus) DeepCopy() *GitStatus { // DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. func (in *IngressConfig) DeepCopyInto(out *IngressConfig) { *out = *in - out.TLS = in.TLS + if in.TLS != nil { + in, out := &in.TLS, &out.TLS + *out = new(TLSConfig) + **out = **in + } return } @@ -1542,13 +682,6 @@ func (in *PipelineActivitySpec) DeepCopyInto(out *PipelineActivitySpec) { (*in)[i].DeepCopyInto(&(*out)[i]) } } - if in.PostExtensions != nil { - in, out := &in.PostExtensions, &out.PostExtensions - *out = make([]ExtensionExecution, len(*in)) - for i := range *in { - (*in)[i].DeepCopyInto(&(*out)[i]) - } - } if in.Attachments != nil { in, out := &in.Attachments, &out.Attachments *out = make([]Attachment, len(*in)) @@ -1982,6 +1115,25 @@ func (in *ReleaseStatus) DeepCopy() *ReleaseStatus { return out } +// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. +func (in *Requirements) DeepCopyInto(out *Requirements) { + *out = *in + 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 Requirements. +func (in *Requirements) DeepCopy() *Requirements { + if in == nil { + return nil + } + out := new(Requirements) + in.DeepCopyInto(out) + return out +} + // DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. func (in *RequirementsConfig) DeepCopyInto(out *RequirementsConfig) { *out = *in @@ -1990,17 +1142,22 @@ func (in *RequirementsConfig) DeepCopyInto(out *RequirementsConfig) { if in.Environments != nil { in, out := &in.Environments, &out.Environments *out = make([]EnvironmentConfig, len(*in)) - copy(*out, *in) + for i := range *in { + (*in)[i].DeepCopyInto(&(*out)[i]) + } } - out.Ingress = in.Ingress + in.Ingress.DeepCopyInto(&out.Ingress) if in.PipelineUser != nil { in, out := &in.PipelineUser, &out.PipelineUser *out = new(UserNameEmailConfig) **out = **in } - out.Storage = in.Storage + if in.Storage != nil { + in, out := &in.Storage, &out.Storage + *out = make([]StorageConfig, len(*in)) + copy(*out, *in) + } in.Vault.DeepCopyInto(&out.Vault) - out.Velero = in.Velero return } @@ -2078,90 +1235,6 @@ func (in *SourceRepository) DeepCopyObject() runtime.Object { return nil } -// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. -func (in *SourceRepositoryGroup) DeepCopyInto(out *SourceRepositoryGroup) { - *out = *in - 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 SourceRepositoryGroup. -func (in *SourceRepositoryGroup) DeepCopy() *SourceRepositoryGroup { - if in == nil { - return nil - } - out := new(SourceRepositoryGroup) - in.DeepCopyInto(out) - return out -} - -// DeepCopyObject is an autogenerated deepcopy function, copying the receiver, creating a new runtime.Object. -func (in *SourceRepositoryGroup) DeepCopyObject() runtime.Object { - if c := in.DeepCopy(); c != nil { - return c - } - return nil -} - -// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. -func (in *SourceRepositoryGroupList) DeepCopyInto(out *SourceRepositoryGroupList) { - *out = *in - out.TypeMeta = in.TypeMeta - in.ListMeta.DeepCopyInto(&out.ListMeta) - if in.Items != nil { - in, out := &in.Items, &out.Items - *out = make([]SourceRepositoryGroup, len(*in)) - for i := range *in { - (*in)[i].DeepCopyInto(&(*out)[i]) - } - } - return -} - -// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new SourceRepositoryGroupList. -func (in *SourceRepositoryGroupList) DeepCopy() *SourceRepositoryGroupList { - if in == nil { - return nil - } - out := new(SourceRepositoryGroupList) - in.DeepCopyInto(out) - return out -} - -// DeepCopyObject is an autogenerated deepcopy function, copying the receiver, creating a new runtime.Object. -func (in *SourceRepositoryGroupList) DeepCopyObject() runtime.Object { - if c := in.DeepCopy(); c != nil { - return c - } - return nil -} - -// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. -func (in *SourceRepositoryGroupSpec) DeepCopyInto(out *SourceRepositoryGroupSpec) { - *out = *in - out.TypeMeta = in.TypeMeta - in.ObjectMeta.DeepCopyInto(&out.ObjectMeta) - if in.SourceRepositorySpec != nil { - in, out := &in.SourceRepositorySpec, &out.SourceRepositorySpec - *out = make([]ResourceReference, len(*in)) - copy(*out, *in) - } - out.Scheduler = in.Scheduler - return -} - -// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new SourceRepositoryGroupSpec. -func (in *SourceRepositoryGroupSpec) DeepCopy() *SourceRepositoryGroupSpec { - if in == nil { - return nil - } - out := new(SourceRepositoryGroupSpec) - in.DeepCopyInto(out) - return out -} - // DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. func (in *SourceRepositoryList) DeepCopyInto(out *SourceRepositoryList) { *out = *in @@ -2239,10 +1312,6 @@ func (in *StageActivityStep) DeepCopy() *StageActivityStep { // DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. func (in *StorageConfig) DeepCopyInto(out *StorageConfig) { *out = *in - out.Logs = in.Logs - out.Reports = in.Reports - out.Repository = in.Repository - out.Backup = in.Backup return } @@ -2256,22 +1325,6 @@ func (in *StorageConfig) DeepCopy() *StorageConfig { return out } -// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. -func (in *StorageEntryConfig) DeepCopyInto(out *StorageEntryConfig) { - *out = *in - return -} - -// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new StorageEntryConfig. -func (in *StorageEntryConfig) DeepCopy() *StorageEntryConfig { - if in == nil { - return nil - } - out := new(StorageEntryConfig) - in.DeepCopyInto(out) - return out -} - // DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. func (in *StorageLocation) DeepCopyInto(out *StorageLocation) { *out = *in @@ -2304,67 +1357,6 @@ func (in *TLSConfig) DeepCopy() *TLSConfig { return out } -// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. -func (in *Team) DeepCopyInto(out *Team) { - *out = *in - out.TypeMeta = in.TypeMeta - 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 Team. -func (in *Team) DeepCopy() *Team { - if in == nil { - return nil - } - out := new(Team) - in.DeepCopyInto(out) - return out -} - -// DeepCopyObject is an autogenerated deepcopy function, copying the receiver, creating a new runtime.Object. -func (in *Team) DeepCopyObject() runtime.Object { - if c := in.DeepCopy(); c != nil { - return c - } - return nil -} - -// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. -func (in *TeamList) DeepCopyInto(out *TeamList) { - *out = *in - out.TypeMeta = in.TypeMeta - in.ListMeta.DeepCopyInto(&out.ListMeta) - if in.Items != nil { - in, out := &in.Items, &out.Items - *out = make([]Team, len(*in)) - for i := range *in { - (*in)[i].DeepCopyInto(&(*out)[i]) - } - } - return -} - -// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new TeamList. -func (in *TeamList) DeepCopy() *TeamList { - if in == nil { - return nil - } - out := new(TeamList) - in.DeepCopyInto(out) - return out -} - -// DeepCopyObject is an autogenerated deepcopy function, copying the receiver, creating a new runtime.Object. -func (in *TeamList) DeepCopyObject() runtime.Object { - if c := in.DeepCopy(); c != nil { - return c - } - return nil -} - // DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. func (in *TeamSettings) DeepCopyInto(out *TeamSettings) { *out = *in @@ -2377,7 +1369,7 @@ func (in *TeamSettings) DeepCopyInto(out *TeamSettings) { } if in.PostPreviewJobs != nil { in, out := &in.PostPreviewJobs, &out.PostPreviewJobs - *out = make([]batchv1.Job, len(*in)) + *out = make([]v1.Job, len(*in)) for i := range *in { (*in)[i].DeepCopyInto(&(*out)[i]) } @@ -2411,71 +1403,6 @@ func (in *TeamSettings) DeepCopy() *TeamSettings { return out } -// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. -func (in *TeamSpec) DeepCopyInto(out *TeamSpec) { - *out = *in - if in.Members != nil { - in, out := &in.Members, &out.Members - *out = make([]string, len(*in)) - copy(*out, *in) - } - return -} - -// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new TeamSpec. -func (in *TeamSpec) DeepCopy() *TeamSpec { - if in == nil { - return nil - } - out := new(TeamSpec) - in.DeepCopyInto(out) - return out -} - -// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. -func (in *TeamStatus) DeepCopyInto(out *TeamStatus) { - *out = *in - return -} - -// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new TeamStatus. -func (in *TeamStatus) DeepCopy() *TeamStatus { - if in == nil { - return nil - } - out := new(TeamStatus) - in.DeepCopyInto(out) - return out -} - -// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. -func (in *User) DeepCopyInto(out *User) { - *out = *in - out.TypeMeta = in.TypeMeta - in.ObjectMeta.DeepCopyInto(&out.ObjectMeta) - in.User.DeepCopyInto(&out.User) - in.Spec.DeepCopyInto(&out.Spec) - return -} - -// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new User. -func (in *User) DeepCopy() *User { - if in == nil { - return nil - } - out := new(User) - in.DeepCopyInto(out) - return out -} - -// DeepCopyObject is an autogenerated deepcopy function, copying the receiver, creating a new runtime.Object. -func (in *User) DeepCopyObject() runtime.Object { - if c := in.DeepCopy(); c != nil { - return c - } - return nil -} - // DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. func (in *UserDetails) DeepCopyInto(out *UserDetails) { *out = *in @@ -2501,39 +1428,6 @@ func (in *UserDetails) DeepCopy() *UserDetails { return out } -// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. -func (in *UserList) DeepCopyInto(out *UserList) { - *out = *in - out.TypeMeta = in.TypeMeta - in.ListMeta.DeepCopyInto(&out.ListMeta) - if in.Items != nil { - in, out := &in.Items, &out.Items - *out = make([]User, len(*in)) - for i := range *in { - (*in)[i].DeepCopyInto(&(*out)[i]) - } - } - return -} - -// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new UserList. -func (in *UserList) DeepCopy() *UserList { - if in == nil { - return nil - } - out := new(UserList) - in.DeepCopyInto(out) - return out -} - -// DeepCopyObject is an autogenerated deepcopy function, copying the receiver, creating a new runtime.Object. -func (in *UserList) DeepCopyObject() runtime.Object { - if c := in.DeepCopy(); c != nil { - return c - } - return nil -} - // DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. func (in *UserNameEmailConfig) DeepCopyInto(out *UserNameEmailConfig) { *out = *in @@ -2640,19 +1534,3 @@ func (in *VaultConfig) DeepCopy() *VaultConfig { in.DeepCopyInto(out) return out } - -// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. -func (in *VeleroConfig) DeepCopyInto(out *VeleroConfig) { - *out = *in - return -} - -// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new VeleroConfig. -func (in *VeleroConfig) DeepCopy() *VeleroConfig { - if in == nil { - return nil - } - out := new(VeleroConfig) - in.DeepCopyInto(out) - return out -} diff --git a/pkg/apis/jenkins.io/v4beta1/doc.go b/pkg/apis/jenkins.io/v4beta1/doc.go deleted file mode 100644 index 0ff6be5..0000000 --- a/pkg/apis/jenkins.io/v4beta1/doc.go +++ /dev/null @@ -1,5 +0,0 @@ -// +k8s:deepcopy-gen=package -// +k8s:openapi-gen=true -// Package v1 is the v1 version of the API. -// +groupName=jenkins.io -package v4beta1 diff --git a/pkg/apis/jenkins.io/v4beta1/types_buildpack.go b/pkg/apis/jenkins.io/v4beta1/types_buildpack.go deleted file mode 100644 index 28f3c86..0000000 --- a/pkg/apis/jenkins.io/v4beta1/types_buildpack.go +++ /dev/null @@ -1,39 +0,0 @@ -package v4beta1 - -import ( - metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" -) - -// +genclient -// +genclient:noStatus -// +k8s:deepcopy-gen:interfaces=k8s.io/apimachinery/pkg/runtime.Object -// +k8s:openapi-gen=true - -// BuildPack represents a set of language specific build packs and associated quickstarts -type BuildPack struct { - metav1.TypeMeta `json:",inline"` - // Standard object's metadata. - // More info: https://git.k8s.io/community/contributors/devel/api-conventions.md#metadata - // +optional - metav1.ObjectMeta `json:"metadata,omitempty" protobuf:"bytes,1,opt,name=metadata"` - - Spec BuildPackSpec `json:"spec,omitempty" protobuf:"bytes,2,opt,name=spec"` -} - -// BuildPackSpec is the specification of an BuildPack -type BuildPackSpec struct { - Label string `json:"label,omitempty" protobuf:"bytes,1,opt,name=label"` - GitURL string `json:"gitUrl,omitempty" protobuf:"bytes,2,opt,name=gitUrl"` - GitRef string `json:"gitRef,omitempty" protobuf:"bytes,3,opt,name=gitRef"` - QuickstartLocations []QuickStartLocation `json:"quickstartLocations,omitempty" protobuf:"bytes,4,opt,name=quickstartLocations"` -} - -// +k8s:deepcopy-gen:interfaces=k8s.io/apimachinery/pkg/runtime.Object - -// BuildPackList is a list of TypeMeta resources -type BuildPackList struct { - metav1.TypeMeta `json:",inline"` - metav1.ListMeta `json:"metadata"` - - Items []BuildPack `json:"items"` -} diff --git a/pkg/apis/jenkins.io/v4beta1/types_extensions.go b/pkg/apis/jenkins.io/v4beta1/types_extensions.go deleted file mode 100644 index 4ef5a5b..0000000 --- a/pkg/apis/jenkins.io/v4beta1/types_extensions.go +++ /dev/null @@ -1,594 +0,0 @@ -package v4beta1 - -import ( - "context" - "fmt" - "io/ioutil" - "path/filepath" - - "github.com/jenkins-x/jx-api/v3/pkg/util" - "github.com/jenkins-x/jx-logging/v3/pkg/log" - - v1 "k8s.io/api/rbac/v1" - - corev1 "k8s.io/api/core/v1" - "k8s.io/client-go/kubernetes" - - "github.com/ghodss/yaml" - - "github.com/pkg/errors" - "github.com/stoewer/go-strcase" - metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" -) - -// +genclient -// +genclient:noStatus -// +k8s:deepcopy-gen:interfaces=k8s.io/apimachinery/pkg/runtime.Object -// Disable openapi-gen as this is not an API we want to promote -// +k8s:openapi-gen=false - -// Extension represents an extension available to this Jenkins X install -type Extension struct { - metav1.TypeMeta `json:",inline"` - // Standard object's metadata. - // More info: https://git.k8s.io/community/contributors/devel/api-conventions.md#metadata - // +optional - metav1.ObjectMeta `json:"metadata,omitempty" protobuf:"bytes,1,opt,name=metadata"` - - Spec ExtensionSpec `json:"spec,omitempty" protobuf:"bytes,2,opt,name=spec"` -} - -// +k8s:deepcopy-gen:interfaces=k8s.io/apimachinery/pkg/runtime.Object - -// ExtensionList is a list of Extensions available for a team -type ExtensionList struct { - metav1.TypeMeta `json:",inline"` - metav1.ListMeta `json:"metadata"` - - Items []Extension `json:"items"` -} - -// ExtensionSpec provides details of an extension available for a team -type ExtensionSpec struct { - Name string `json:"name,omitempty" protobuf:"bytes,1,opt,name=name"` - Description string `json:"description,omitempty" protobuf:"bytes,2,opt,name=description"` - Version string `json:"version,omitempty" protobuf:"bytes,3,opt,name=version"` - Script string `json:"script,omitempty" protobuf:"bytes,4,opt,name=script"` - When []ExtensionWhen `json:"when,omitempty" protobuf:"bytes,5,opt,name=when"` - Given ExtensionGiven `json:"given,omitempty" protobuf:"bytes,6,opt,name=given"` - Parameters []ExtensionParameter `json:"parameters,omitempty" protobuf:"bytes,8,opt,name=parameters"` - Namespace string `json:"namespace,omitempty" protobuf:"bytes,9,opt,name=namespace"` - UUID string `json:"uuid,omitempty" protobuf:"bytes,10,opt,name=uuid"` - Children []string `json:"children,omitempty" protobuf:"bytes,11,opt,name=children"` -} - -// ExtensionWhen specifies when in the lifecycle an extension should execute. By default Post. -type ExtensionWhen string - -const ( - // Executed before a pipeline starts - ExtensionWhenPre ExtensionWhen = "pre" - // Executed after a pipeline completes - ExtensionWhenPost ExtensionWhen = "post" - // Executed when an extension installs - ExtensionWhenInstall ExtensionWhen = "onInstall" - // Executed when an extension uninstalls - ExtensionWhenUninstall ExtensionWhen = "onUninstall" - // Executed when an extension upgrades - ExtensionWhenUpgrade ExtensionWhen = "onUpgrade" -) - -// ExtensionGiven specifies the condition (if the extension is executing in a pipeline on which the extension should execute. By default Always. -type ExtensionGiven string - -const ( - ExtensionGivenAlways ExtensionGiven = "Always" - ExtensionGivenFailure ExtensionGiven = "Failure" - ExtensionGivenSuccess ExtensionGiven = "Success" -) - -// ExtensionParameter describes a parameter definition for an extension -type ExtensionParameter struct { - Name string `json:"name,omitempty" protobuf:"bytes,1,opt,name=name"` - Description string `json:"description,omitempty" protobuf:"bytes,2,opt,name=description"` - EnvironmentVariableName string `json:"environmentVariableName,omitempty" protobuf:"bytes,3,opt,name=environmentVariableName"` - DefaultValue string `json:"defaultValue,omitempty" protobuf:"bytes,3,opt,name=defaultValue"` -} - -// ExtensionExecution is an executable instance of an extension which can be attached into a pipeline for later execution. -// It differs from an Extension as it cannot have children and parameters have been resolved to environment variables -type ExtensionExecution struct { - Name string `json:"name,omitempty" protobuf:"bytes,1,opt,name=name"` - Description string `json:"description,omitempty" protobuf:"bytes,2,opt,name=description"` - Script string `json:"script,omitempty" protobuf:"bytes,3,opt,name=script"` - EnvironmentVariables []EnvironmentVariable `json:"environmentVariables,omitempty" protobuf:"bytes,4,opt,name=environmentvariables"` - Given ExtensionGiven `json:"given,omitempty" protobuf:"bytes,5,opt,name=given"` - Namespace string `json:"namespace,omitempty" protobuf:"bytes,7,opt,name=namespace"` - UUID string `json:"uuid,omitempty" protobuf:"bytes,8,opt,name=uuid"` -} - -// ExtensionRepositoryLockList contains a list of ExtensionRepositoryLock items -// +k8s:openapi-gen=false -type ExtensionRepositoryLockList struct { - Version string `json:"version"` - Extensions []ExtensionSpec `json:"extensions"` -} - -// ExtensionDefinitionReferenceList contains a list of ExtensionRepository items -type ExtensionDefinitionReferenceList struct { - Remotes []ExtensionDefinitionReference `json:"remotes"` -} - -// ExtensionRepositoryReference references a GitHub repo that contains extension definitions -type ExtensionDefinitionReference struct { - Remote string `json:"remote"` - Tag string `json:"tag"` -} - -// ExtensionDefinitionList contains a list of ExtensionDefinition items -type ExtensionDefinitionList struct { - Version string `json:"version,omitempty"` - Extensions []ExtensionDefinition `json:"extensions"` -} - -// ExtensionDefinition defines an Extension -type ExtensionDefinition struct { - Name string `json:"name"` - Namespace string `json:"namespace"` - UUID string `json:"uuid"` - Description string `json:"description,omitempty"` - When []ExtensionWhen `json:"when,omitempty"` - Given ExtensionGiven `json:"given,omitempty"` - Children []ExtensionDefinitionChildReference `json:"children,omitempty"` - ScriptFile string `json:"scriptFile,omitempty"` - Parameters []ExtensionParameter `json:"parameters,omitempty"` -} - -// ExtensionDefinitionChildReference provides a reference to a child -type ExtensionDefinitionChildReference struct { - UUID string `json:"uuid,omitempty"` - Name string `json:"name,omitempty"` - Namespace string `json:"namespace,omitempty"` - Remote string `json:"remote,omitempty"` - Tag string `json:"tag,omitempty"` -} - -type EnvironmentVariable struct { - Name string `json:"name,omitempty" protobuf:"bytes,1,opt,name=name"` - Value string `json:"value,omitempty" protobuf:"bytes,2,opt,name=value"` -} - -// ExtensionsConfigList contains a list of ExtensionConfig items -type ExtensionConfigList struct { - Extensions []ExtensionConfig `json:"extensions"` -} - -// ExtensionConfig is the configuration and enablement for an extension inside an app -type ExtensionConfig struct { - Name string `json:"name"` - Namespace string `json:"namespace"` - Parameters []ExtensionParameterValue `json:"parameters"` -} - -const ( - ExtensionsConfigKnownRepositories = "knownRepositories" - ExtensionsConfigRepository = "repository" -) - -type ExtensionRepositoryReferenceList struct { - Repositories []ExtensionRepositoryReference `json:"repositories,omitempty"` -} - -type ExtensionRepositoryReference struct { - Url string `json:"url,omitempty"` - GitHub string `json:"github,omitempty"` - Chart ChartRef `json:"chart,omitempty"` -} - -type ChartRef struct { - Repo string `json:"repo,omitempty"` - RepoName string `json:"repoName,omitempty"` - Name string `json:"name,omitempty"` -} - -type ExtensionParameterValue struct { - Name string `json:"name"` - Value string `json:"value"` -} - -const ( - VersionGlobalParameterName string = "extVersion" - TeamNamespaceGlobalParameterName string = "extTeamNamespace" - OwnerReferenceGlobalParameterName string = "extOwnerReference" -) - -func (e *ExtensionExecution) Execute() (err error) { - scriptFile, err := ioutil.TempFile("", fmt.Sprintf("%s-*", e.Name)) - if err != nil { - return err - } - _, err = scriptFile.Write([]byte(e.Script)) - if err != nil { - return err - } - err = scriptFile.Chmod(0755) - if err != nil { - return err - } - err = scriptFile.Close() - if err != nil { - return err - } - log.Logger().Debugf("Environment Variables:\n %s", e.EnvironmentVariables) - log.Logger().Debugf("Script:\n %s", e.Script) - envVars := make(map[string]string) - for _, v := range e.EnvironmentVariables { - envVars[v.Name] = v.Value - } - cmd := util.Command{ - Name: scriptFile.Name(), - Env: envVars, - } - out, err := cmd.RunWithoutRetry() - log.Logger().Info(out) - if err != nil { - return errors.Wrap(err, fmt.Sprintf("Error executing script %s", e.Name)) - } - return nil -} - -func (constraints *ExtensionDefinitionReferenceList) LoadFromFile(inputFile string) (err error) { - path, err := filepath.Abs(inputFile) - if err != nil { - return err - } - y, err := ioutil.ReadFile(path) - if err != nil { - return err - } - err = yaml.Unmarshal(y, constraints) - if err != nil { - return err - } - return nil -} - -func (lock *ExtensionRepositoryLockList) LoadFromFile(inputFile string) (err error) { - path, err := filepath.Abs(inputFile) - if err != nil { - return err - } - y, err := ioutil.ReadFile(path) - if err != nil { - return err - } - err = yaml.Unmarshal(y, lock) - if err != nil { - return err - } - return nil -} - -func (e *ExtensionDefinition) FullyQualifiedName() (fqn string) { - return fmt.Sprintf("%s.%s", e.Namespace, e.Name) -} - -func (e *ExtensionDefinition) FullyQualifiedKebabName() (fqn string) { - return fmt.Sprintf("%s.%s", strcase.KebabCase(e.Namespace), strcase.KebabCase(e.Name)) -} - -func (e *ExtensionDefinitionChildReference) FullyQualifiedName() (fqn string) { - return fmt.Sprintf("%s.%s", e.Namespace, e.Name) -} - -func (e *ExtensionDefinitionChildReference) FullyQualifiedKebabName() (fqn string) { - return fmt.Sprintf("%s.%s", strcase.KebabCase(e.Namespace), strcase.KebabCase(e.Name)) -} - -func (e *ExtensionSpec) FullyQualifiedName() (fqn string) { - return fmt.Sprintf("%s.%s", e.Namespace, e.Name) -} - -func (e *ExtensionSpec) FullyQualifiedKebabName() (fqn string) { - return fmt.Sprintf("%s.%s", strcase.KebabCase(e.Namespace), strcase.KebabCase(e.Name)) -} - -func (e *ExtensionConfig) FullyQualifiedName() (fqn string) { - return fmt.Sprintf("%s.%s", e.Namespace, e.Name) -} - -func (e *ExtensionConfig) FullyQualifiedKebabName() (fqn string) { - return fmt.Sprintf("%s.%s", strcase.KebabCase(e.Namespace), strcase.KebabCase(e.Name)) -} - -func (e *ExtensionExecution) FullyQualifiedName() (fqn string) { - return fmt.Sprintf("%s.%s", e.Namespace, e.Name) -} - -func (e *ExtensionExecution) FullyQualifiedKebabName() (fqn string) { - return fmt.Sprintf("%s.%s", strcase.KebabCase(e.Namespace), strcase.KebabCase(e.Name)) -} - -func (extensionsConfig *ExtensionConfigList) LoadFromFile(inputFile string) (cfg *ExtensionConfigList, err error) { - extensionsYamlPath, err := filepath.Abs(inputFile) - if err != nil { - return nil, err - } - extensionsYaml, err := ioutil.ReadFile(extensionsYamlPath) - if err != nil { - return nil, err - } - err = yaml.Unmarshal(extensionsYaml, extensionsConfig) - if err != nil { - return nil, err - } - return extensionsConfig, nil -} - -func (extensionsConfig *ExtensionConfigList) LoadFromConfigMap(configMapName string, client kubernetes.Interface, namespace string) (cfg *ExtensionConfigList, err error) { - ctx := context.Background() - cm, err := client.CoreV1().ConfigMaps(namespace).Get(ctx, configMapName, metav1.GetOptions{}) - if err != nil { - // CM doesn't exist, create it - cm, err = client.CoreV1().ConfigMaps(namespace).Create(ctx, &corev1.ConfigMap{ - ObjectMeta: metav1.ObjectMeta{ - Name: configMapName, - }, - }, metav1.CreateOptions{}) - if err != nil { - return nil, err - } - } - extensionsConfig.Extensions = make([]ExtensionConfig, 0) - - extensionConfigList := ExtensionConfigList{} - err = yaml.Unmarshal([]byte(cm.Data["extensions"]), &extensionConfigList.Extensions) - if err != nil { - return nil, err - } - return &extensionConfigList, nil -} - -func (e *ExtensionSpec) IsPost() bool { - return e.Contains(ExtensionWhenPost) || len(e.When) == 0 -} - -func (e *ExtensionSpec) IsOnUninstall() bool { - return e.Contains(ExtensionWhenUninstall) -} - -func (e *ExtensionSpec) Contains(when ExtensionWhen) bool { - for _, w := range e.When { - if when == w { - return true - } - } - return false -} - -// +genclient -// +genclient:noStatus -// +k8s:deepcopy-gen:interfaces=k8s.io/apimachinery/pkg/runtime.Object -// +k8s:openapi-gen=false - -// CommitStatus represents the commit statuses for a particular pull request -type CommitStatus struct { - metav1.TypeMeta `json:",inline"` - // Standard object's metadata. - // More info: https://git.k8s.io/community/contributors/devel/api-conventions.md#metadata - // +optional - metav1.ObjectMeta `json:"metadata,omitempty" protobuf:"bytes,1,opt,name=metadata"` - - Spec CommitStatusSpec `json:"spec,omitempty" protobuf:"bytes,2,opt,name=spec"` -} - -// +k8s:deepcopy-gen:interfaces=k8s.io/apimachinery/pkg/runtime.Object - -// CommitStatusList is a structure used by k8s to store lists of commit statuses -type CommitStatusList struct { - metav1.TypeMeta `json:",inline"` - metav1.ListMeta `json:"metadata"` - - Items []CommitStatus `json:"Items"` -} - -// CommitStatusSpec provides details of a particular commit status -type CommitStatusSpec struct { - Items []CommitStatusDetails `json:"items" protobuf:"bytes,1,opt,name=items"` -} - -type CommitStatusDetails struct { - PipelineActivity ResourceReference `json:"pipelineActivity" protobuf:"bytes,1,opt,name=pipelineActivity"` - Items []CommitStatusItem `json:"Items,omitempty" protobuf:"bytes,2,opt,name=Items"` - Checked bool `json:"checked" protobuf:"bytes,3,opt,name=checked"` - Commit CommitStatusCommitReference `json:"commit" protobuf:"bytes,4,opt,name=commit"` - Context string `json:"context" protobuf:"bytes,5,opt,name=context"` -} - -type CommitStatusCommitReference struct { - GitURL string `json:"gitUrl,omitempty" protobuf:"bytes,1,opt,name=gitUrl"` - PullRequest string `json:"pullRequest,omitempty" protobuf:"bytes,2,opt,name=pullRequest"` - SHA string `json:"sha,omitempty" protobuf:"bytes,3,opt,name=sha"` -} - -type CommitStatusItem struct { - Name string `json:"name,omitempty" protobuf:"bytes,1,opt,name=name"` - Description string `json:"description,omitempty" protobuf:"bytes,2,opt,name=description"` - Pass bool `json:"pass" protobuf:"bytes,3,opt,name=pass"` -} - -// +genclient -// +genclient:noStatus -// +k8s:deepcopy-gen:interfaces=k8s.io/apimachinery/pkg/runtime.Object -// +k8s:openapi-gen=true - -// App is the metadata for an App -type App struct { - metav1.TypeMeta `json:",inline"` - // Standard object's metadata. - // More info: https://git.k8s.io/community/contributors/devel/api-conventions.md#metadata - // +optional - metav1.ObjectMeta `json:"metadata,omitempty" protobuf:"bytes,1,opt,name=metadata"` - - Spec AppSpec `json:"spec,omitempty" protobuf:"bytes,2,opt,name=spec"` -} - -// +k8s:deepcopy-gen:interfaces=k8s.io/apimachinery/pkg/runtime.Object - -// AppList is a structure used by k8s to store lists of apps -type AppList struct { - metav1.TypeMeta `json:",inline"` - metav1.ListMeta `json:"metadata"` - - Items []App `json:"items"` -} - -// +genclient -// +genclient:noStatus -// +k8s:deepcopy-gen:interfaces=k8s.io/apimachinery/pkg/runtime.Object -// +k8s:openapi-gen=true - -// SourceRepositoryGroup is the metadata for an Application/Project/SourceRepository -type SourceRepositoryGroup struct { - metav1.TypeMeta `json:",inline"` - metav1.ObjectMeta `json:"metadata,omitempty" protobuf:"bytes,1,opt,name=metadata"` - Spec SourceRepositoryGroupSpec `json:"spec,omitempty" protobuf:"bytes,2,opt,name=spec"` -} - -// +k8s:deepcopy-gen:interfaces=k8s.io/apimachinery/pkg/runtime.Object - -// SourceRepositoryGroupList is a structure used by k8s to store lists of apps -type SourceRepositoryGroupList struct { - metav1.TypeMeta `json:",inline"` - metav1.ListMeta `json:"metadata"` - - Items []SourceRepositoryGroup `json:"items"` -} - -// SourceRepositoryGroupSpec is the metadata for an Application/Project/SourceRepository -type SourceRepositoryGroupSpec struct { - metav1.TypeMeta `json:",inline"` - metav1.ObjectMeta `json:"metadata,omitempty" protobuf:"bytes,1,opt,name=metadata"` - - SourceRepositorySpec []ResourceReference `json:"repositories" protobuf:"bytes,2,opt,name=repositories"` - Scheduler ResourceReference `json:"scheduler" protobuf:"bytes,3,opt,name=scheduler"` -} - -// +genclient -// +genclient:noStatus -// +k8s:deepcopy-gen:interfaces=k8s.io/apimachinery/pkg/runtime.Object - -// SourceRepository is the metadata for an Application/Project/SourceRepository -type SourceRepository struct { - metav1.TypeMeta `json:",inline"` - // Standard object's metadata. - // More info: https://git.k8s.io/community/contributors/devel/api-conventions.md#metadata - // +optional - metav1.ObjectMeta `json:"metadata,omitempty" protobuf:"bytes,1,opt,name=metadata"` - - Spec SourceRepositorySpec `json:"spec,omitempty" protobuf:"bytes,2,opt,name=spec"` -} - -// Sanitize sanitizes the source repository URL -func (repo *SourceRepository) Sanitize() { - repo.Spec.URL = util.SanitizeURL(repo.Spec.URL) - repo.Spec.HTTPCloneURL = util.SanitizeURL(repo.Spec.HTTPCloneURL) - repo.Spec.SSHCloneURL = util.SanitizeURL(repo.Spec.SSHCloneURL) - // The URL is stored sometimes in the provider and provider name - repo.Spec.Provider = util.SanitizeURL(repo.Spec.Provider) - repo.Spec.ProviderName = util.SanitizeURL(repo.Spec.ProviderName) -} - -// +k8s:deepcopy-gen:interfaces=k8s.io/apimachinery/pkg/runtime.Object - -// SourceRepositoryList is a structure used by k8s to store lists of apps -type SourceRepositoryList struct { - metav1.TypeMeta `json:",inline"` - metav1.ListMeta `json:"metadata"` - - Items []SourceRepository `json:"items"` -} - -// SourceRepositorySpec provides details of the metadata for an App -type SourceRepositorySpec struct { - Description string `json:"description,omitempty" protobuf:"bytes,1,opt,name=description"` - // Provider stores the URL of the git provider such as https://github.com - Provider string `json:"provider,omitempty" protobuf:"bytes,2,opt,name=provider"` - Org string `json:"org,omitempty" protobuf:"bytes,3,opt,name=org"` - Repo string `json:"repo,omitempty" protobuf:"bytes,4,opt,name=repo"` - // ProviderName is a logical name for the provider without any URL scheme which can be used in a label selector - ProviderName string `json:"providerName,omitempty" protobuf:"bytes,5,opt,name=providerName"` - // ProviderKind is the kind of provider (github / bitbucketcloud / bitbucketserver etc) - ProviderKind string `json:"providerKind,omitempty" protobuf:"bytes,6,opt,name=providerKind"` - // URL is the web URL of the project page - URL string `json:"url,omitempty" protobuf:"bytes,7,opt,name=url"` - // SSHCloneURL is the git URL to clone this repository using SSH - SSHCloneURL string `json:"sshCloneURL,omitempty" protobuf:"bytes,8,opt,name=sshCloneURL"` - // HTTPCloneURL is the git URL to clone this repository using HTTP/HTTPS - HTTPCloneURL string `json:"httpCloneURL,omitempty" protobuf:"bytes,9,opt,name=httpCloneURL"` - // Scheduler a reference to a custom scheduler otherwise we default to the Team's Scededuler - Scheduler ResourceReference `json:"scheduler,omitempty" protobuf:"bytes,10,opt,name=scheduler"` -} - -// AppSpec provides details of the metadata for an App -type AppSpec struct { - SchemaPreprocessor *corev1.Container `json:"schemaPreprocessor,omitempty" protobuf:"bytes,1,opt,name=schemaPreprocessor"` - SchemaPreprocessorRole *v1.Role `json:"schemaPreprocessorRole,omitempty" protobuf:"bytes,2,opt,name=schemaPreprocessorRole"` - - PipelineExtension *PipelineExtension `json:"pipelineExtension,omitempty" protobuf:"bytes,3,opt,name=pipelineExtension"` -} - -// PipelineExtension defines the image and command of an app which wants to modify/extend the pipeline -type PipelineExtension struct { - // Name of the container specified as a DNS_LABEL. - Name string `json:"name" protobuf:"bytes,1,opt,name=name"` - // Docker image name. - Image string `json:"image,omitempty" protobuf:"bytes,2,opt,name=image"` - // Entrypoint array. Not executed within a shell. - Command string `json:"command,omitempty" protobuf:"bytes,3,rep,name=command"` - // Arguments to the entrypoint. - Args []string `json:"args,omitempty" protobuf:"bytes,4,rep,name=args"` -} - -// +k8s:deepcopy-gen:interfaces=k8s.io/apimachinery/pkg/runtime.Object - -// PluginList is a list of Plugins available for a team -type PluginList struct { - metav1.TypeMeta `json:",inline"` - metav1.ListMeta `json:"metadata"` - - Items []Plugin `json:"items"` -} - -// +genclient -// +genclient:noStatus -// +k8s:deepcopy-gen:interfaces=k8s.io/apimachinery/pkg/runtime.Object -// +k8s:openapi-gen=true - -// Plugin represents a binary plugin installed into this Jenkins X team -type Plugin struct { - metav1.TypeMeta `json:",inline"` - // Standard object's metadata. - // More info: https://git.k8s.io/community/contributors/devel/api-conventions.md#metadata - // +optional - metav1.ObjectMeta `json:"metadata,omitempty" protobuf:"bytes,1,opt,name=metadata"` - - Spec PluginSpec `json:"spec,omitempty" protobuf:"bytes,2,opt,name=spec"` -} - -// PluginSpec provides details of a binary plugin available for a team -type PluginSpec struct { - SubCommand string `json:"subCommand,omitempty" protobuf:"bytes,3,opt,name=subCommand"` - Group string `json:"group,omitempty" protobuf:"bytes,4,opt,name=group"` - Binaries []Binary `json:"binaries,omitempty" protobuf:"bytes,7opt,name=binaries"` - Description string `json:"description,omitempty" protobuf:"bytes,2,opt,name=description"` - Name string `json:"name,omitempty" protobuf:"bytes,5,opt,name=name"` - Version string `json:"version,omitempty" protobuf:"bytes,6,opt,name=version"` -} - -// Binary provies the details of a downloadable binary -type Binary struct { - Goarch string `json:"goarch,omitempty" protobuf:"bytes,1,opt,name=goarch"` - Goos string `json:"goos,omitempty" protobuf:"bytes,2,opt,name=goos"` - URL string `json:"url,omitempty" protobuf:"bytes,3,opt,name=url"` -} diff --git a/pkg/apis/jenkins.io/v4beta1/types_teams.go b/pkg/apis/jenkins.io/v4beta1/types_teams.go deleted file mode 100644 index ce40735..0000000 --- a/pkg/apis/jenkins.io/v4beta1/types_teams.go +++ /dev/null @@ -1,75 +0,0 @@ -package v4beta1 - -import ( - metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" -) - -// +genclient -// +genclient:noStatus -// +k8s:deepcopy-gen:interfaces=k8s.io/apimachinery/pkg/runtime.Object -// +k8s:openapi-gen=true - -// Team represents a request to create an actual Team which is a group of users, a development environment and optional other environments -type Team struct { - metav1.TypeMeta `json:",inline"` - // Standard object's metadata. - // More info: https://git.k8s.io/community/contributors/devel/api-conventions.md#metadata - // +optional - metav1.ObjectMeta `json:"metadata,omitempty" protobuf:"bytes,1,opt,name=metadata"` - - Spec TeamSpec `json:"spec,omitempty" protobuf:"bytes,2,opt,name=spec"` - Status TeamStatus `json:"status,omitempty" protobuf:"bytes,3,opt,name=status"` -} - -// TeamSpec is the specification of an Team -type TeamSpec struct { - Label string `json:"label,omitempty" protobuf:"bytes,1,opt,name=label"` - Kind TeamKindType `json:"kind,omitempty" protobuf:"bytes,2,opt,name=kind"` - Members []string `json:"members,omitempty" protobuf:"bytes,3,opt,name=members"` -} - -// TeamStatus is the status for an Team resource -type TeamStatus struct { - ProvisionStatus TeamProvisionStatusType `json:"provisionStatus,omitempty"` - Message string `json:"message,omitempty"` -} - -// +k8s:deepcopy-gen:interfaces=k8s.io/apimachinery/pkg/runtime.Object - -// TeamList is a list of TypeMeta resources -type TeamList struct { - metav1.TypeMeta `json:",inline"` - metav1.ListMeta `json:"metadata"` - - Items []Team `json:"items"` -} - -// TeamKindType is the kind of an Team -type TeamKindType string - -const ( - // TeamKindTypeCD specifies that the Team is a regular permanent one - TeamKindTypeCD TeamKindType = "CD" - // TeamKindTypeCI specifies that the Team is a regular permanent one - TeamKindTypeCI TeamKindType = "CI" -) - -// TeamProvisionStatusType is the kind of an Team -type TeamProvisionStatusType string - -const ( - // TeamProvisionStatusNone provisioning not started yet - TeamProvisionStatusNone TeamProvisionStatusType = "" - - // TeamProvisionStatusPending specifies that the Team is being provisioned - TeamProvisionStatusPending TeamProvisionStatusType = "Pending" - - // TeamProvisionStatusComplete specifies that the Team has been provisioned - TeamProvisionStatusComplete TeamProvisionStatusType = "Complete" - - // TeamProvisionStatusDeleting specifies that the Team is being deleted - TeamProvisionStatusDeleting TeamProvisionStatusType = "Deleting" - - // TeamProvisionStatusError specifies that the Team provisioning failed with some error - TeamProvisionStatusError TeamProvisionStatusType = "Error" -) diff --git a/pkg/apis/jenkins.io/v4beta1/types_users.go b/pkg/apis/jenkins.io/v4beta1/types_users.go deleted file mode 100644 index e652d0d..0000000 --- a/pkg/apis/jenkins.io/v4beta1/types_users.go +++ /dev/null @@ -1,138 +0,0 @@ -package v4beta1 - -import ( - "encoding/json" - - metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" -) - -const ( - // UserTypeLocal represents a User who is native to K8S (e.g. backed by GKE). - UserTypeLocal = "User" - // UserTypeExternal represents a User who is managed externally (e.g. in GitHub) and will have a linked ServiceAccount. - UserTypeExternal = "ServiceAccount" -) - -// +genclient -// +genclient:noStatus -// +k8s:deepcopy-gen:interfaces=k8s.io/apimachinery/pkg/runtime.Object -// +k8s:openapi-gen=true - -// User represents a git user so we have a cache to find by email address -type User struct { - metav1.TypeMeta `json:",inline"` - // Standard object's metadata. - // More info: https://git.k8s.io/community/contributors/devel/api-conventions.md#metadata - // +optional - metav1.ObjectMeta `json:"metadata,omitempty" protobuf:"bytes,1,opt,name=metadata"` - - // Deprecated, use Spec - User UserDetails `json:"user,omitempty" protobuf:"bytes,2,opt,name=user"` - - Spec UserDetails `json:"spec,omitempty" protobuf:"bytes,3,opt,name=spec"` -} - -// +k8s:deepcopy-gen:interfaces=k8s.io/apimachinery/pkg/runtime.Object - -// UserList is a list of User resources -type UserList struct { - metav1.TypeMeta `json:",inline"` - metav1.ListMeta `json:"metadata"` - - Items []User `json:"items"` -} - -// UserDetails containers details of a user -type UserDetails struct { - Login string `json:"login,omitempty" protobuf:"bytes,1,opt,name=login"` - Name string `json:"name,omitempty" protobuf:"bytes,2,opt,name=name"` - Email string `json:"email,omitempty" protobuf:"bytes,3,opt,name=email"` - CreationTimestamp *metav1.Time `json:"creationTimestamp,omitempty" protobuf:"bytes,4,opt,name=creationTimestamp"` - URL string `json:"url,omitempty" protobuf:"bytes,5,opt,name=url"` - AvatarURL string `json:"avatarUrl,omitempty" protobuf:"bytes,6,opt,name=avatarUrl"` - ServiceAccount string `json:"serviceAccount,omitempty" protobuf:"bytes,7,opt,name=serviceAccount"` - Accounts []AccountReference `json:"accountReference,omitempty" protobuf:"bytes,8,opt,name=accountReference"` - ExternalUser bool `json:"externalUser,omitempty" protobuf:"bytes,9,opt,name=externalUser"` -} - -// AccountReference is a reference to a user account in another system that is attached to this user -type AccountReference struct { - Provider string `json:"provider,omitempty" protobuf:"bytes,1,opt,name=provider"` - ID string `json:"id,omitempty" protobuf:"bytes,2,opt,name=id"` -} - -// SubjectKind returns the subject kind of user - either "User" (native K8S user) or "ServiceAccount" (externally managed -// user). -func (u *User) SubjectKind() string { - if u.Spec.ExternalUser { - return UserTypeExternal - } - return UserTypeLocal -} - -// UnmarshalJSON method merges the deprecated User field and the Spec field on User, preferring Spec -func (u *User) UnmarshalJSON(bs []byte) error { - var intermediate map[string]json.RawMessage - err := json.Unmarshal(bs, &intermediate) - if err != nil { - return err - } - kind, ok := intermediate["kind"] - if ok { - err = json.Unmarshal(kind, &u.Kind) - if err != nil { - return err - } - } - apiVersion, ok := intermediate["apiVersion"] - if ok { - err = json.Unmarshal(apiVersion, &u.APIVersion) - if err != nil { - return err - } - } - objectMeta, ok := intermediate["metadata"] - if ok { - err = json.Unmarshal(objectMeta, &u.ObjectMeta) - if err != nil { - return err - } - } - user, userOk := intermediate["user"] - spec, specOk := intermediate["spec"] - if specOk && userOk { - // If both are there, merge them, with preference given to spec - merged := UserDetails{} - err = json.Unmarshal(user, &merged) - if err != nil { - return err - } - err = json.Unmarshal(spec, &merged) - if err != nil { - return err - } - u.Spec = merged - u.User = merged - } else if !specOk && userOk { - // If only user is there, copy it into spec - err = json.Unmarshal(user, &u.Spec) - if err != nil { - return err - } - err = json.Unmarshal(user, &u.User) - if err != nil { - return err - } - } else if specOk { - // If only spec is there, copy it into user - err = json.Unmarshal(spec, &u.User) - if err != nil { - return err - } - err = json.Unmarshal(spec, &u.Spec) - if err != nil { - return err - } - } - return nil -} diff --git a/pkg/client/clientset/versioned/clientset.go b/pkg/client/clientset/versioned/clientset.go index f8947d8..9f3b906 100644 --- a/pkg/client/clientset/versioned/clientset.go +++ b/pkg/client/clientset/versioned/clientset.go @@ -20,7 +20,7 @@ package versioned import ( "fmt" - jenkinsv4beta1 "github.com/jenkins-x/jx-api/v4/pkg/client/clientset/versioned/typed/jenkins.io/v4beta1" + corev4beta1 "github.com/jenkins-x/jx-api/v4/pkg/client/clientset/versioned/typed/core/v4beta1" discovery "k8s.io/client-go/discovery" rest "k8s.io/client-go/rest" flowcontrol "k8s.io/client-go/util/flowcontrol" @@ -28,19 +28,19 @@ import ( type Interface interface { Discovery() discovery.DiscoveryInterface - JenkinsV4beta1() jenkinsv4beta1.JenkinsV4beta1Interface + CoreV4beta1() corev4beta1.CoreV4beta1Interface } // Clientset contains the clients for groups. Each group has exactly one // version included in a Clientset. type Clientset struct { *discovery.DiscoveryClient - jenkinsV4beta1 *jenkinsv4beta1.JenkinsV4beta1Client + coreV4beta1 *corev4beta1.CoreV4beta1Client } -// JenkinsV4beta1 retrieves the JenkinsV4beta1Client -func (c *Clientset) JenkinsV4beta1() jenkinsv4beta1.JenkinsV4beta1Interface { - return c.jenkinsV4beta1 +// CoreV4beta1 retrieves the CoreV4beta1Client +func (c *Clientset) CoreV4beta1() corev4beta1.CoreV4beta1Interface { + return c.coreV4beta1 } // Discovery retrieves the DiscoveryClient @@ -64,7 +64,7 @@ func NewForConfig(c *rest.Config) (*Clientset, error) { } var cs Clientset var err error - cs.jenkinsV4beta1, err = jenkinsv4beta1.NewForConfig(&configShallowCopy) + cs.coreV4beta1, err = corev4beta1.NewForConfig(&configShallowCopy) if err != nil { return nil, err } @@ -80,7 +80,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.jenkinsV4beta1 = jenkinsv4beta1.NewForConfigOrDie(c) + cs.coreV4beta1 = corev4beta1.NewForConfigOrDie(c) cs.DiscoveryClient = discovery.NewDiscoveryClientForConfigOrDie(c) return &cs @@ -89,7 +89,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.jenkinsV4beta1 = jenkinsv4beta1.New(c) + cs.coreV4beta1 = corev4beta1.New(c) cs.DiscoveryClient = discovery.NewDiscoveryClient(c) return &cs diff --git a/pkg/client/clientset/versioned/fake/clientset_generated.go b/pkg/client/clientset/versioned/fake/clientset_generated.go index 4de7790..e820072 100644 --- a/pkg/client/clientset/versioned/fake/clientset_generated.go +++ b/pkg/client/clientset/versioned/fake/clientset_generated.go @@ -19,8 +19,8 @@ package fake import ( clientset "github.com/jenkins-x/jx-api/v4/pkg/client/clientset/versioned" - jenkinsv4beta1 "github.com/jenkins-x/jx-api/v4/pkg/client/clientset/versioned/typed/jenkins.io/v4beta1" - fakejenkinsv4beta1 "github.com/jenkins-x/jx-api/v4/pkg/client/clientset/versioned/typed/jenkins.io/v4beta1/fake" + corev4beta1 "github.com/jenkins-x/jx-api/v4/pkg/client/clientset/versioned/typed/core/v4beta1" + fakecorev4beta1 "github.com/jenkins-x/jx-api/v4/pkg/client/clientset/versioned/typed/core/v4beta1/fake" "k8s.io/apimachinery/pkg/runtime" "k8s.io/apimachinery/pkg/watch" "k8s.io/client-go/discovery" @@ -75,7 +75,7 @@ func (c *Clientset) Tracker() testing.ObjectTracker { var _ clientset.Interface = &Clientset{} -// JenkinsV4beta1 retrieves the JenkinsV4beta1Client -func (c *Clientset) JenkinsV4beta1() jenkinsv4beta1.JenkinsV4beta1Interface { - return &fakejenkinsv4beta1.FakeJenkinsV4beta1{Fake: &c.Fake} +// CoreV4beta1 retrieves the CoreV4beta1Client +func (c *Clientset) CoreV4beta1() corev4beta1.CoreV4beta1Interface { + return &fakecorev4beta1.FakeCoreV4beta1{Fake: &c.Fake} } diff --git a/pkg/client/clientset/versioned/fake/register.go b/pkg/client/clientset/versioned/fake/register.go index 11a161c..d19474f 100644 --- a/pkg/client/clientset/versioned/fake/register.go +++ b/pkg/client/clientset/versioned/fake/register.go @@ -18,7 +18,7 @@ limitations under the License. package fake import ( - jenkinsv4beta1 "github.com/jenkins-x/jx-api/v4/pkg/apis/jenkins.io/v4beta1" + corev4beta1 "github.com/jenkins-x/jx-api/v4/pkg/apis/core/v4beta1" v1 "k8s.io/apimachinery/pkg/apis/meta/v1" runtime "k8s.io/apimachinery/pkg/runtime" schema "k8s.io/apimachinery/pkg/runtime/schema" @@ -30,7 +30,7 @@ var scheme = runtime.NewScheme() var codecs = serializer.NewCodecFactory(scheme) var localSchemeBuilder = runtime.SchemeBuilder{ - jenkinsv4beta1.AddToScheme, + corev4beta1.AddToScheme, } // AddToScheme adds all types of this clientset into the given scheme. This allows composition diff --git a/pkg/client/clientset/versioned/scheme/register.go b/pkg/client/clientset/versioned/scheme/register.go index 92affaa..5649298 100644 --- a/pkg/client/clientset/versioned/scheme/register.go +++ b/pkg/client/clientset/versioned/scheme/register.go @@ -18,7 +18,7 @@ limitations under the License. package scheme import ( - jenkinsv4beta1 "github.com/jenkins-x/jx-api/v4/pkg/apis/jenkins.io/v4beta1" + corev4beta1 "github.com/jenkins-x/jx-api/v4/pkg/apis/core/v4beta1" v1 "k8s.io/apimachinery/pkg/apis/meta/v1" runtime "k8s.io/apimachinery/pkg/runtime" schema "k8s.io/apimachinery/pkg/runtime/schema" @@ -30,7 +30,7 @@ var Scheme = runtime.NewScheme() var Codecs = serializer.NewCodecFactory(Scheme) var ParameterCodec = runtime.NewParameterCodec(Scheme) var localSchemeBuilder = runtime.SchemeBuilder{ - jenkinsv4beta1.AddToScheme, + corev4beta1.AddToScheme, } // AddToScheme adds all types of this clientset into the given scheme. This allows composition diff --git a/pkg/client/clientset/versioned/typed/core/v4beta1/core_client.go b/pkg/client/clientset/versioned/typed/core/v4beta1/core_client.go new file mode 100644 index 0000000..740f9e2 --- /dev/null +++ b/pkg/client/clientset/versioned/typed/core/v4beta1/core_client.go @@ -0,0 +1,108 @@ +/* +Copyright 2020 The Jenkins X 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 v4beta1 + +import ( + v4beta1 "github.com/jenkins-x/jx-api/v4/pkg/apis/core/v4beta1" + "github.com/jenkins-x/jx-api/v4/pkg/client/clientset/versioned/scheme" + rest "k8s.io/client-go/rest" +) + +type CoreV4beta1Interface interface { + RESTClient() rest.Interface + EnvironmentsGetter + PipelineActivitiesGetter + PluginsGetter + ReleasesGetter + SourceRepositoriesGetter +} + +// CoreV4beta1Client is used to interact with features provided by the core.jenkins-x.io group. +type CoreV4beta1Client struct { + restClient rest.Interface +} + +func (c *CoreV4beta1Client) Environments(namespace string) EnvironmentInterface { + return newEnvironments(c, namespace) +} + +func (c *CoreV4beta1Client) PipelineActivities(namespace string) PipelineActivityInterface { + return newPipelineActivities(c, namespace) +} + +func (c *CoreV4beta1Client) Plugins(namespace string) PluginInterface { + return newPlugins(c, namespace) +} + +func (c *CoreV4beta1Client) Releases(namespace string) ReleaseInterface { + return newReleases(c, namespace) +} + +func (c *CoreV4beta1Client) SourceRepositories(namespace string) SourceRepositoryInterface { + return newSourceRepositories(c, namespace) +} + +// NewForConfig creates a new CoreV4beta1Client for the given config. +func NewForConfig(c *rest.Config) (*CoreV4beta1Client, error) { + config := *c + if err := setConfigDefaults(&config); err != nil { + return nil, err + } + client, err := rest.RESTClientFor(&config) + if err != nil { + return nil, err + } + return &CoreV4beta1Client{client}, nil +} + +// NewForConfigOrDie creates a new CoreV4beta1Client for the given config and +// panics if there is an error in the config. +func NewForConfigOrDie(c *rest.Config) *CoreV4beta1Client { + client, err := NewForConfig(c) + if err != nil { + panic(err) + } + return client +} + +// New creates a new CoreV4beta1Client for the given RESTClient. +func New(c rest.Interface) *CoreV4beta1Client { + return &CoreV4beta1Client{c} +} + +func setConfigDefaults(config *rest.Config) error { + gv := v4beta1.SchemeGroupVersion + config.GroupVersion = &gv + config.APIPath = "/apis" + config.NegotiatedSerializer = scheme.Codecs.WithoutConversion() + + if config.UserAgent == "" { + config.UserAgent = rest.DefaultKubernetesUserAgent() + } + + return nil +} + +// RESTClient returns a RESTClient that is used to communicate +// with API server by this client implementation. +func (c *CoreV4beta1Client) RESTClient() rest.Interface { + if c == nil { + return nil + } + return c.restClient +} diff --git a/pkg/client/clientset/versioned/typed/jenkins.io/v4beta1/doc.go b/pkg/client/clientset/versioned/typed/core/v4beta1/doc.go similarity index 100% rename from pkg/client/clientset/versioned/typed/jenkins.io/v4beta1/doc.go rename to pkg/client/clientset/versioned/typed/core/v4beta1/doc.go diff --git a/pkg/client/clientset/versioned/typed/jenkins.io/v4beta1/environment.go b/pkg/client/clientset/versioned/typed/core/v4beta1/environment.go similarity index 97% rename from pkg/client/clientset/versioned/typed/jenkins.io/v4beta1/environment.go rename to pkg/client/clientset/versioned/typed/core/v4beta1/environment.go index fb8e24a..7d6f0a4 100644 --- a/pkg/client/clientset/versioned/typed/jenkins.io/v4beta1/environment.go +++ b/pkg/client/clientset/versioned/typed/core/v4beta1/environment.go @@ -21,7 +21,7 @@ import ( "context" "time" - v4beta1 "github.com/jenkins-x/jx-api/v4/pkg/apis/jenkins.io/v4beta1" + v4beta1 "github.com/jenkins-x/jx-api/v4/pkg/apis/core/v4beta1" scheme "github.com/jenkins-x/jx-api/v4/pkg/client/clientset/versioned/scheme" v1 "k8s.io/apimachinery/pkg/apis/meta/v1" types "k8s.io/apimachinery/pkg/types" @@ -55,7 +55,7 @@ type environments struct { } // newEnvironments returns a Environments -func newEnvironments(c *JenkinsV4beta1Client, namespace string) *environments { +func newEnvironments(c *CoreV4beta1Client, namespace string) *environments { return &environments{ client: c.RESTClient(), ns: namespace, diff --git a/pkg/client/clientset/versioned/typed/jenkins.io/v4beta1/fake/doc.go b/pkg/client/clientset/versioned/typed/core/v4beta1/fake/doc.go similarity index 100% rename from pkg/client/clientset/versioned/typed/jenkins.io/v4beta1/fake/doc.go rename to pkg/client/clientset/versioned/typed/core/v4beta1/fake/doc.go diff --git a/pkg/client/clientset/versioned/typed/core/v4beta1/fake/fake_core_client.go b/pkg/client/clientset/versioned/typed/core/v4beta1/fake/fake_core_client.go new file mode 100644 index 0000000..989bfe1 --- /dev/null +++ b/pkg/client/clientset/versioned/typed/core/v4beta1/fake/fake_core_client.go @@ -0,0 +1,55 @@ +/* +Copyright 2020 The Jenkins X 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 + +import ( + v4beta1 "github.com/jenkins-x/jx-api/v4/pkg/client/clientset/versioned/typed/core/v4beta1" + rest "k8s.io/client-go/rest" + testing "k8s.io/client-go/testing" +) + +type FakeCoreV4beta1 struct { + *testing.Fake +} + +func (c *FakeCoreV4beta1) Environments(namespace string) v4beta1.EnvironmentInterface { + return &FakeEnvironments{c, namespace} +} + +func (c *FakeCoreV4beta1) PipelineActivities(namespace string) v4beta1.PipelineActivityInterface { + return &FakePipelineActivities{c, namespace} +} + +func (c *FakeCoreV4beta1) Plugins(namespace string) v4beta1.PluginInterface { + return &FakePlugins{c, namespace} +} + +func (c *FakeCoreV4beta1) Releases(namespace string) v4beta1.ReleaseInterface { + return &FakeReleases{c, namespace} +} + +func (c *FakeCoreV4beta1) SourceRepositories(namespace string) v4beta1.SourceRepositoryInterface { + return &FakeSourceRepositories{c, namespace} +} + +// RESTClient returns a RESTClient that is used to communicate +// with API server by this client implementation. +func (c *FakeCoreV4beta1) RESTClient() rest.Interface { + var ret *rest.RESTClient + return ret +} diff --git a/pkg/client/clientset/versioned/typed/jenkins.io/v4beta1/fake/fake_environment.go b/pkg/client/clientset/versioned/typed/core/v4beta1/fake/fake_environment.go similarity index 93% rename from pkg/client/clientset/versioned/typed/jenkins.io/v4beta1/fake/fake_environment.go rename to pkg/client/clientset/versioned/typed/core/v4beta1/fake/fake_environment.go index 3837c17..5c08e2f 100644 --- a/pkg/client/clientset/versioned/typed/jenkins.io/v4beta1/fake/fake_environment.go +++ b/pkg/client/clientset/versioned/typed/core/v4beta1/fake/fake_environment.go @@ -20,7 +20,7 @@ package fake import ( "context" - v4beta1 "github.com/jenkins-x/jx-api/v4/pkg/apis/jenkins.io/v4beta1" + v4beta1 "github.com/jenkins-x/jx-api/v4/pkg/apis/core/v4beta1" v1 "k8s.io/apimachinery/pkg/apis/meta/v1" labels "k8s.io/apimachinery/pkg/labels" schema "k8s.io/apimachinery/pkg/runtime/schema" @@ -31,13 +31,13 @@ import ( // FakeEnvironments implements EnvironmentInterface type FakeEnvironments struct { - Fake *FakeJenkinsV4beta1 + Fake *FakeCoreV4beta1 ns string } -var environmentsResource = schema.GroupVersionResource{Group: "jenkins.io", Version: "v4beta1", Resource: "environments"} +var environmentsResource = schema.GroupVersionResource{Group: "core.jenkins-x.io", Version: "v4beta1", Resource: "environments"} -var environmentsKind = schema.GroupVersionKind{Group: "jenkins.io", Version: "v4beta1", Kind: "Environment"} +var environmentsKind = schema.GroupVersionKind{Group: "core.jenkins-x.io", Version: "v4beta1", Kind: "Environment"} // Get takes name of the environment, and returns the corresponding environment object, and an error if there is any. func (c *FakeEnvironments) Get(ctx context.Context, name string, options v1.GetOptions) (result *v4beta1.Environment, err error) { diff --git a/pkg/client/clientset/versioned/typed/jenkins.io/v4beta1/fake/fake_pipelineactivity.go b/pkg/client/clientset/versioned/typed/core/v4beta1/fake/fake_pipelineactivity.go similarity index 94% rename from pkg/client/clientset/versioned/typed/jenkins.io/v4beta1/fake/fake_pipelineactivity.go rename to pkg/client/clientset/versioned/typed/core/v4beta1/fake/fake_pipelineactivity.go index f025505..421c0a5 100644 --- a/pkg/client/clientset/versioned/typed/jenkins.io/v4beta1/fake/fake_pipelineactivity.go +++ b/pkg/client/clientset/versioned/typed/core/v4beta1/fake/fake_pipelineactivity.go @@ -20,7 +20,7 @@ package fake import ( "context" - v4beta1 "github.com/jenkins-x/jx-api/v4/pkg/apis/jenkins.io/v4beta1" + v4beta1 "github.com/jenkins-x/jx-api/v4/pkg/apis/core/v4beta1" v1 "k8s.io/apimachinery/pkg/apis/meta/v1" labels "k8s.io/apimachinery/pkg/labels" schema "k8s.io/apimachinery/pkg/runtime/schema" @@ -31,13 +31,13 @@ import ( // FakePipelineActivities implements PipelineActivityInterface type FakePipelineActivities struct { - Fake *FakeJenkinsV4beta1 + Fake *FakeCoreV4beta1 ns string } -var pipelineactivitiesResource = schema.GroupVersionResource{Group: "jenkins.io", Version: "v4beta1", Resource: "pipelineactivities"} +var pipelineactivitiesResource = schema.GroupVersionResource{Group: "core.jenkins-x.io", Version: "v4beta1", Resource: "pipelineactivities"} -var pipelineactivitiesKind = schema.GroupVersionKind{Group: "jenkins.io", Version: "v4beta1", Kind: "PipelineActivity"} +var pipelineactivitiesKind = schema.GroupVersionKind{Group: "core.jenkins-x.io", Version: "v4beta1", Kind: "PipelineActivity"} // Get takes name of the pipelineActivity, and returns the corresponding pipelineActivity object, and an error if there is any. func (c *FakePipelineActivities) Get(ctx context.Context, name string, options v1.GetOptions) (result *v4beta1.PipelineActivity, err error) { diff --git a/pkg/client/clientset/versioned/typed/jenkins.io/v4beta1/fake/fake_plugin.go b/pkg/client/clientset/versioned/typed/core/v4beta1/fake/fake_plugin.go similarity index 93% rename from pkg/client/clientset/versioned/typed/jenkins.io/v4beta1/fake/fake_plugin.go rename to pkg/client/clientset/versioned/typed/core/v4beta1/fake/fake_plugin.go index f25801d..dc0f276 100644 --- a/pkg/client/clientset/versioned/typed/jenkins.io/v4beta1/fake/fake_plugin.go +++ b/pkg/client/clientset/versioned/typed/core/v4beta1/fake/fake_plugin.go @@ -20,7 +20,7 @@ package fake import ( "context" - v4beta1 "github.com/jenkins-x/jx-api/v4/pkg/apis/jenkins.io/v4beta1" + v4beta1 "github.com/jenkins-x/jx-api/v4/pkg/apis/core/v4beta1" v1 "k8s.io/apimachinery/pkg/apis/meta/v1" labels "k8s.io/apimachinery/pkg/labels" schema "k8s.io/apimachinery/pkg/runtime/schema" @@ -31,13 +31,13 @@ import ( // FakePlugins implements PluginInterface type FakePlugins struct { - Fake *FakeJenkinsV4beta1 + Fake *FakeCoreV4beta1 ns string } -var pluginsResource = schema.GroupVersionResource{Group: "jenkins.io", Version: "v4beta1", Resource: "plugins"} +var pluginsResource = schema.GroupVersionResource{Group: "core.jenkins-x.io", Version: "v4beta1", Resource: "plugins"} -var pluginsKind = schema.GroupVersionKind{Group: "jenkins.io", Version: "v4beta1", Kind: "Plugin"} +var pluginsKind = schema.GroupVersionKind{Group: "core.jenkins-x.io", Version: "v4beta1", Kind: "Plugin"} // Get takes name of the plugin, and returns the corresponding plugin object, and an error if there is any. func (c *FakePlugins) Get(ctx context.Context, name string, options v1.GetOptions) (result *v4beta1.Plugin, err error) { diff --git a/pkg/client/clientset/versioned/typed/jenkins.io/v4beta1/fake/fake_release.go b/pkg/client/clientset/versioned/typed/core/v4beta1/fake/fake_release.go similarity index 93% rename from pkg/client/clientset/versioned/typed/jenkins.io/v4beta1/fake/fake_release.go rename to pkg/client/clientset/versioned/typed/core/v4beta1/fake/fake_release.go index 0f5c3cc..77e81e9 100644 --- a/pkg/client/clientset/versioned/typed/jenkins.io/v4beta1/fake/fake_release.go +++ b/pkg/client/clientset/versioned/typed/core/v4beta1/fake/fake_release.go @@ -20,7 +20,7 @@ package fake import ( "context" - v4beta1 "github.com/jenkins-x/jx-api/v4/pkg/apis/jenkins.io/v4beta1" + v4beta1 "github.com/jenkins-x/jx-api/v4/pkg/apis/core/v4beta1" v1 "k8s.io/apimachinery/pkg/apis/meta/v1" labels "k8s.io/apimachinery/pkg/labels" schema "k8s.io/apimachinery/pkg/runtime/schema" @@ -31,13 +31,13 @@ import ( // FakeReleases implements ReleaseInterface type FakeReleases struct { - Fake *FakeJenkinsV4beta1 + Fake *FakeCoreV4beta1 ns string } -var releasesResource = schema.GroupVersionResource{Group: "jenkins.io", Version: "v4beta1", Resource: "releases"} +var releasesResource = schema.GroupVersionResource{Group: "core.jenkins-x.io", Version: "v4beta1", Resource: "releases"} -var releasesKind = schema.GroupVersionKind{Group: "jenkins.io", Version: "v4beta1", Kind: "Release"} +var releasesKind = schema.GroupVersionKind{Group: "core.jenkins-x.io", Version: "v4beta1", Kind: "Release"} // Get takes name of the release, and returns the corresponding release object, and an error if there is any. func (c *FakeReleases) Get(ctx context.Context, name string, options v1.GetOptions) (result *v4beta1.Release, err error) { diff --git a/pkg/client/clientset/versioned/typed/jenkins.io/v4beta1/fake/fake_sourcerepository.go b/pkg/client/clientset/versioned/typed/core/v4beta1/fake/fake_sourcerepository.go similarity index 94% rename from pkg/client/clientset/versioned/typed/jenkins.io/v4beta1/fake/fake_sourcerepository.go rename to pkg/client/clientset/versioned/typed/core/v4beta1/fake/fake_sourcerepository.go index 47ab87b..5b4e984 100644 --- a/pkg/client/clientset/versioned/typed/jenkins.io/v4beta1/fake/fake_sourcerepository.go +++ b/pkg/client/clientset/versioned/typed/core/v4beta1/fake/fake_sourcerepository.go @@ -20,7 +20,7 @@ package fake import ( "context" - v4beta1 "github.com/jenkins-x/jx-api/v4/pkg/apis/jenkins.io/v4beta1" + v4beta1 "github.com/jenkins-x/jx-api/v4/pkg/apis/core/v4beta1" v1 "k8s.io/apimachinery/pkg/apis/meta/v1" labels "k8s.io/apimachinery/pkg/labels" schema "k8s.io/apimachinery/pkg/runtime/schema" @@ -31,13 +31,13 @@ import ( // FakeSourceRepositories implements SourceRepositoryInterface type FakeSourceRepositories struct { - Fake *FakeJenkinsV4beta1 + Fake *FakeCoreV4beta1 ns string } -var sourcerepositoriesResource = schema.GroupVersionResource{Group: "jenkins.io", Version: "v4beta1", Resource: "sourcerepositories"} +var sourcerepositoriesResource = schema.GroupVersionResource{Group: "core.jenkins-x.io", Version: "v4beta1", Resource: "sourcerepositories"} -var sourcerepositoriesKind = schema.GroupVersionKind{Group: "jenkins.io", Version: "v4beta1", Kind: "SourceRepository"} +var sourcerepositoriesKind = schema.GroupVersionKind{Group: "core.jenkins-x.io", Version: "v4beta1", Kind: "SourceRepository"} // Get takes name of the sourceRepository, and returns the corresponding sourceRepository object, and an error if there is any. func (c *FakeSourceRepositories) Get(ctx context.Context, name string, options v1.GetOptions) (result *v4beta1.SourceRepository, err error) { diff --git a/pkg/client/clientset/versioned/typed/jenkins.io/v4beta1/generated_expansion.go b/pkg/client/clientset/versioned/typed/core/v4beta1/generated_expansion.go similarity index 70% rename from pkg/client/clientset/versioned/typed/jenkins.io/v4beta1/generated_expansion.go rename to pkg/client/clientset/versioned/typed/core/v4beta1/generated_expansion.go index 215e65c..9cdd649 100644 --- a/pkg/client/clientset/versioned/typed/jenkins.io/v4beta1/generated_expansion.go +++ b/pkg/client/clientset/versioned/typed/core/v4beta1/generated_expansion.go @@ -17,20 +17,8 @@ limitations under the License. package v4beta1 -type AppExpansion interface{} - -type BuildPackExpansion interface{} - -type CommitStatusExpansion interface{} - type EnvironmentExpansion interface{} -type EnvironmentRoleBindingExpansion interface{} - -type ExtensionExpansion interface{} - -type GitServiceExpansion interface{} - type PipelineActivityExpansion interface{} type PluginExpansion interface{} @@ -38,9 +26,3 @@ type PluginExpansion interface{} type ReleaseExpansion interface{} type SourceRepositoryExpansion interface{} - -type SourceRepositoryGroupExpansion interface{} - -type TeamExpansion interface{} - -type UserExpansion interface{} diff --git a/pkg/client/clientset/versioned/typed/jenkins.io/v4beta1/pipelineactivity.go b/pkg/client/clientset/versioned/typed/core/v4beta1/pipelineactivity.go similarity index 97% rename from pkg/client/clientset/versioned/typed/jenkins.io/v4beta1/pipelineactivity.go rename to pkg/client/clientset/versioned/typed/core/v4beta1/pipelineactivity.go index 33d185f..49e3082 100644 --- a/pkg/client/clientset/versioned/typed/jenkins.io/v4beta1/pipelineactivity.go +++ b/pkg/client/clientset/versioned/typed/core/v4beta1/pipelineactivity.go @@ -21,7 +21,7 @@ import ( "context" "time" - v4beta1 "github.com/jenkins-x/jx-api/v4/pkg/apis/jenkins.io/v4beta1" + v4beta1 "github.com/jenkins-x/jx-api/v4/pkg/apis/core/v4beta1" scheme "github.com/jenkins-x/jx-api/v4/pkg/client/clientset/versioned/scheme" v1 "k8s.io/apimachinery/pkg/apis/meta/v1" types "k8s.io/apimachinery/pkg/types" @@ -55,7 +55,7 @@ type pipelineActivities struct { } // newPipelineActivities returns a PipelineActivities -func newPipelineActivities(c *JenkinsV4beta1Client, namespace string) *pipelineActivities { +func newPipelineActivities(c *CoreV4beta1Client, namespace string) *pipelineActivities { return &pipelineActivities{ client: c.RESTClient(), ns: namespace, diff --git a/pkg/client/clientset/versioned/typed/jenkins.io/v4beta1/plugin.go b/pkg/client/clientset/versioned/typed/core/v4beta1/plugin.go similarity index 97% rename from pkg/client/clientset/versioned/typed/jenkins.io/v4beta1/plugin.go rename to pkg/client/clientset/versioned/typed/core/v4beta1/plugin.go index e6192ad..2a8704c 100644 --- a/pkg/client/clientset/versioned/typed/jenkins.io/v4beta1/plugin.go +++ b/pkg/client/clientset/versioned/typed/core/v4beta1/plugin.go @@ -21,7 +21,7 @@ import ( "context" "time" - v4beta1 "github.com/jenkins-x/jx-api/v4/pkg/apis/jenkins.io/v4beta1" + v4beta1 "github.com/jenkins-x/jx-api/v4/pkg/apis/core/v4beta1" scheme "github.com/jenkins-x/jx-api/v4/pkg/client/clientset/versioned/scheme" v1 "k8s.io/apimachinery/pkg/apis/meta/v1" types "k8s.io/apimachinery/pkg/types" @@ -55,7 +55,7 @@ type plugins struct { } // newPlugins returns a Plugins -func newPlugins(c *JenkinsV4beta1Client, namespace string) *plugins { +func newPlugins(c *CoreV4beta1Client, namespace string) *plugins { return &plugins{ client: c.RESTClient(), ns: namespace, diff --git a/pkg/client/clientset/versioned/typed/jenkins.io/v4beta1/release.go b/pkg/client/clientset/versioned/typed/core/v4beta1/release.go similarity index 97% rename from pkg/client/clientset/versioned/typed/jenkins.io/v4beta1/release.go rename to pkg/client/clientset/versioned/typed/core/v4beta1/release.go index f9a686f..3a448a0 100644 --- a/pkg/client/clientset/versioned/typed/jenkins.io/v4beta1/release.go +++ b/pkg/client/clientset/versioned/typed/core/v4beta1/release.go @@ -21,7 +21,7 @@ import ( "context" "time" - v4beta1 "github.com/jenkins-x/jx-api/v4/pkg/apis/jenkins.io/v4beta1" + v4beta1 "github.com/jenkins-x/jx-api/v4/pkg/apis/core/v4beta1" scheme "github.com/jenkins-x/jx-api/v4/pkg/client/clientset/versioned/scheme" v1 "k8s.io/apimachinery/pkg/apis/meta/v1" types "k8s.io/apimachinery/pkg/types" @@ -55,7 +55,7 @@ type releases struct { } // newReleases returns a Releases -func newReleases(c *JenkinsV4beta1Client, namespace string) *releases { +func newReleases(c *CoreV4beta1Client, namespace string) *releases { return &releases{ client: c.RESTClient(), ns: namespace, diff --git a/pkg/client/clientset/versioned/typed/jenkins.io/v4beta1/sourcerepository.go b/pkg/client/clientset/versioned/typed/core/v4beta1/sourcerepository.go similarity index 97% rename from pkg/client/clientset/versioned/typed/jenkins.io/v4beta1/sourcerepository.go rename to pkg/client/clientset/versioned/typed/core/v4beta1/sourcerepository.go index 119a8f6..88fa65e 100644 --- a/pkg/client/clientset/versioned/typed/jenkins.io/v4beta1/sourcerepository.go +++ b/pkg/client/clientset/versioned/typed/core/v4beta1/sourcerepository.go @@ -21,7 +21,7 @@ import ( "context" "time" - v4beta1 "github.com/jenkins-x/jx-api/v4/pkg/apis/jenkins.io/v4beta1" + v4beta1 "github.com/jenkins-x/jx-api/v4/pkg/apis/core/v4beta1" scheme "github.com/jenkins-x/jx-api/v4/pkg/client/clientset/versioned/scheme" v1 "k8s.io/apimachinery/pkg/apis/meta/v1" types "k8s.io/apimachinery/pkg/types" @@ -55,7 +55,7 @@ type sourceRepositories struct { } // newSourceRepositories returns a SourceRepositories -func newSourceRepositories(c *JenkinsV4beta1Client, namespace string) *sourceRepositories { +func newSourceRepositories(c *CoreV4beta1Client, namespace string) *sourceRepositories { return &sourceRepositories{ client: c.RESTClient(), ns: namespace, diff --git a/pkg/client/clientset/versioned/typed/jenkins.io/v4beta1/app.go b/pkg/client/clientset/versioned/typed/jenkins.io/v4beta1/app.go deleted file mode 100644 index 9c57cad..0000000 --- a/pkg/client/clientset/versioned/typed/jenkins.io/v4beta1/app.go +++ /dev/null @@ -1,177 +0,0 @@ -/* -Copyright 2020 The Jenkins X 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 v4beta1 - -import ( - "context" - "time" - - v4beta1 "github.com/jenkins-x/jx-api/v4/pkg/apis/jenkins.io/v4beta1" - scheme "github.com/jenkins-x/jx-api/v4/pkg/client/clientset/versioned/scheme" - v1 "k8s.io/apimachinery/pkg/apis/meta/v1" - types "k8s.io/apimachinery/pkg/types" - watch "k8s.io/apimachinery/pkg/watch" - rest "k8s.io/client-go/rest" -) - -// AppsGetter has a method to return a AppInterface. -// A group's client should implement this interface. -type AppsGetter interface { - Apps(namespace string) AppInterface -} - -// AppInterface has methods to work with App resources. -type AppInterface interface { - Create(ctx context.Context, app *v4beta1.App, opts v1.CreateOptions) (*v4beta1.App, error) - Update(ctx context.Context, app *v4beta1.App, opts v1.UpdateOptions) (*v4beta1.App, error) - Delete(ctx context.Context, name string, opts v1.DeleteOptions) error - DeleteCollection(ctx context.Context, opts v1.DeleteOptions, listOpts v1.ListOptions) error - Get(ctx context.Context, name string, opts v1.GetOptions) (*v4beta1.App, error) - List(ctx context.Context, opts v1.ListOptions) (*v4beta1.AppList, error) - Watch(ctx context.Context, opts v1.ListOptions) (watch.Interface, error) - Patch(ctx context.Context, name string, pt types.PatchType, data []byte, opts v1.PatchOptions, subresources ...string) (result *v4beta1.App, err error) - AppExpansion -} - -// apps implements AppInterface -type apps struct { - client rest.Interface - ns string -} - -// newApps returns a Apps -func newApps(c *JenkinsV4beta1Client, namespace string) *apps { - return &apps{ - client: c.RESTClient(), - ns: namespace, - } -} - -// Get takes name of the app, and returns the corresponding app object, and an error if there is any. -func (c *apps) Get(ctx context.Context, name string, options v1.GetOptions) (result *v4beta1.App, err error) { - result = &v4beta1.App{} - err = c.client.Get(). - Namespace(c.ns). - Resource("apps"). - Name(name). - VersionedParams(&options, scheme.ParameterCodec). - Do(ctx). - Into(result) - return -} - -// List takes label and field selectors, and returns the list of Apps that match those selectors. -func (c *apps) List(ctx context.Context, opts v1.ListOptions) (result *v4beta1.AppList, err error) { - var timeout time.Duration - if opts.TimeoutSeconds != nil { - timeout = time.Duration(*opts.TimeoutSeconds) * time.Second - } - result = &v4beta1.AppList{} - err = c.client.Get(). - Namespace(c.ns). - Resource("apps"). - VersionedParams(&opts, scheme.ParameterCodec). - Timeout(timeout). - Do(ctx). - Into(result) - return -} - -// Watch returns a watch.Interface that watches the requested apps. -func (c *apps) Watch(ctx context.Context, opts v1.ListOptions) (watch.Interface, error) { - var timeout time.Duration - if opts.TimeoutSeconds != nil { - timeout = time.Duration(*opts.TimeoutSeconds) * time.Second - } - opts.Watch = true - return c.client.Get(). - Namespace(c.ns). - Resource("apps"). - VersionedParams(&opts, scheme.ParameterCodec). - Timeout(timeout). - Watch(ctx) -} - -// Create takes the representation of a app and creates it. Returns the server's representation of the app, and an error, if there is any. -func (c *apps) Create(ctx context.Context, app *v4beta1.App, opts v1.CreateOptions) (result *v4beta1.App, err error) { - result = &v4beta1.App{} - err = c.client.Post(). - Namespace(c.ns). - Resource("apps"). - VersionedParams(&opts, scheme.ParameterCodec). - Body(app). - Do(ctx). - Into(result) - return -} - -// Update takes the representation of a app and updates it. Returns the server's representation of the app, and an error, if there is any. -func (c *apps) Update(ctx context.Context, app *v4beta1.App, opts v1.UpdateOptions) (result *v4beta1.App, err error) { - result = &v4beta1.App{} - err = c.client.Put(). - Namespace(c.ns). - Resource("apps"). - Name(app.Name). - VersionedParams(&opts, scheme.ParameterCodec). - Body(app). - Do(ctx). - Into(result) - return -} - -// Delete takes name of the app and deletes it. Returns an error if one occurs. -func (c *apps) Delete(ctx context.Context, name string, opts v1.DeleteOptions) error { - return c.client.Delete(). - Namespace(c.ns). - Resource("apps"). - Name(name). - Body(&opts). - Do(ctx). - Error() -} - -// DeleteCollection deletes a collection of objects. -func (c *apps) DeleteCollection(ctx context.Context, opts v1.DeleteOptions, listOpts v1.ListOptions) error { - var timeout time.Duration - if listOpts.TimeoutSeconds != nil { - timeout = time.Duration(*listOpts.TimeoutSeconds) * time.Second - } - return c.client.Delete(). - Namespace(c.ns). - Resource("apps"). - VersionedParams(&listOpts, scheme.ParameterCodec). - Timeout(timeout). - Body(&opts). - Do(ctx). - Error() -} - -// Patch applies the patch and returns the patched app. -func (c *apps) Patch(ctx context.Context, name string, pt types.PatchType, data []byte, opts v1.PatchOptions, subresources ...string) (result *v4beta1.App, err error) { - result = &v4beta1.App{} - err = c.client.Patch(pt). - Namespace(c.ns). - Resource("apps"). - Name(name). - SubResource(subresources...). - VersionedParams(&opts, scheme.ParameterCodec). - Body(data). - Do(ctx). - Into(result) - return -} diff --git a/pkg/client/clientset/versioned/typed/jenkins.io/v4beta1/buildpack.go b/pkg/client/clientset/versioned/typed/jenkins.io/v4beta1/buildpack.go deleted file mode 100644 index 6009ea7..0000000 --- a/pkg/client/clientset/versioned/typed/jenkins.io/v4beta1/buildpack.go +++ /dev/null @@ -1,177 +0,0 @@ -/* -Copyright 2020 The Jenkins X 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 v4beta1 - -import ( - "context" - "time" - - v4beta1 "github.com/jenkins-x/jx-api/v4/pkg/apis/jenkins.io/v4beta1" - scheme "github.com/jenkins-x/jx-api/v4/pkg/client/clientset/versioned/scheme" - v1 "k8s.io/apimachinery/pkg/apis/meta/v1" - types "k8s.io/apimachinery/pkg/types" - watch "k8s.io/apimachinery/pkg/watch" - rest "k8s.io/client-go/rest" -) - -// BuildPacksGetter has a method to return a BuildPackInterface. -// A group's client should implement this interface. -type BuildPacksGetter interface { - BuildPacks(namespace string) BuildPackInterface -} - -// BuildPackInterface has methods to work with BuildPack resources. -type BuildPackInterface interface { - Create(ctx context.Context, buildPack *v4beta1.BuildPack, opts v1.CreateOptions) (*v4beta1.BuildPack, error) - Update(ctx context.Context, buildPack *v4beta1.BuildPack, opts v1.UpdateOptions) (*v4beta1.BuildPack, error) - Delete(ctx context.Context, name string, opts v1.DeleteOptions) error - DeleteCollection(ctx context.Context, opts v1.DeleteOptions, listOpts v1.ListOptions) error - Get(ctx context.Context, name string, opts v1.GetOptions) (*v4beta1.BuildPack, error) - List(ctx context.Context, opts v1.ListOptions) (*v4beta1.BuildPackList, error) - Watch(ctx context.Context, opts v1.ListOptions) (watch.Interface, error) - Patch(ctx context.Context, name string, pt types.PatchType, data []byte, opts v1.PatchOptions, subresources ...string) (result *v4beta1.BuildPack, err error) - BuildPackExpansion -} - -// buildPacks implements BuildPackInterface -type buildPacks struct { - client rest.Interface - ns string -} - -// newBuildPacks returns a BuildPacks -func newBuildPacks(c *JenkinsV4beta1Client, namespace string) *buildPacks { - return &buildPacks{ - client: c.RESTClient(), - ns: namespace, - } -} - -// Get takes name of the buildPack, and returns the corresponding buildPack object, and an error if there is any. -func (c *buildPacks) Get(ctx context.Context, name string, options v1.GetOptions) (result *v4beta1.BuildPack, err error) { - result = &v4beta1.BuildPack{} - err = c.client.Get(). - Namespace(c.ns). - Resource("buildpacks"). - Name(name). - VersionedParams(&options, scheme.ParameterCodec). - Do(ctx). - Into(result) - return -} - -// List takes label and field selectors, and returns the list of BuildPacks that match those selectors. -func (c *buildPacks) List(ctx context.Context, opts v1.ListOptions) (result *v4beta1.BuildPackList, err error) { - var timeout time.Duration - if opts.TimeoutSeconds != nil { - timeout = time.Duration(*opts.TimeoutSeconds) * time.Second - } - result = &v4beta1.BuildPackList{} - err = c.client.Get(). - Namespace(c.ns). - Resource("buildpacks"). - VersionedParams(&opts, scheme.ParameterCodec). - Timeout(timeout). - Do(ctx). - Into(result) - return -} - -// Watch returns a watch.Interface that watches the requested buildPacks. -func (c *buildPacks) Watch(ctx context.Context, opts v1.ListOptions) (watch.Interface, error) { - var timeout time.Duration - if opts.TimeoutSeconds != nil { - timeout = time.Duration(*opts.TimeoutSeconds) * time.Second - } - opts.Watch = true - return c.client.Get(). - Namespace(c.ns). - Resource("buildpacks"). - VersionedParams(&opts, scheme.ParameterCodec). - Timeout(timeout). - Watch(ctx) -} - -// Create takes the representation of a buildPack and creates it. Returns the server's representation of the buildPack, and an error, if there is any. -func (c *buildPacks) Create(ctx context.Context, buildPack *v4beta1.BuildPack, opts v1.CreateOptions) (result *v4beta1.BuildPack, err error) { - result = &v4beta1.BuildPack{} - err = c.client.Post(). - Namespace(c.ns). - Resource("buildpacks"). - VersionedParams(&opts, scheme.ParameterCodec). - Body(buildPack). - Do(ctx). - Into(result) - return -} - -// Update takes the representation of a buildPack and updates it. Returns the server's representation of the buildPack, and an error, if there is any. -func (c *buildPacks) Update(ctx context.Context, buildPack *v4beta1.BuildPack, opts v1.UpdateOptions) (result *v4beta1.BuildPack, err error) { - result = &v4beta1.BuildPack{} - err = c.client.Put(). - Namespace(c.ns). - Resource("buildpacks"). - Name(buildPack.Name). - VersionedParams(&opts, scheme.ParameterCodec). - Body(buildPack). - Do(ctx). - Into(result) - return -} - -// Delete takes name of the buildPack and deletes it. Returns an error if one occurs. -func (c *buildPacks) Delete(ctx context.Context, name string, opts v1.DeleteOptions) error { - return c.client.Delete(). - Namespace(c.ns). - Resource("buildpacks"). - Name(name). - Body(&opts). - Do(ctx). - Error() -} - -// DeleteCollection deletes a collection of objects. -func (c *buildPacks) DeleteCollection(ctx context.Context, opts v1.DeleteOptions, listOpts v1.ListOptions) error { - var timeout time.Duration - if listOpts.TimeoutSeconds != nil { - timeout = time.Duration(*listOpts.TimeoutSeconds) * time.Second - } - return c.client.Delete(). - Namespace(c.ns). - Resource("buildpacks"). - VersionedParams(&listOpts, scheme.ParameterCodec). - Timeout(timeout). - Body(&opts). - Do(ctx). - Error() -} - -// Patch applies the patch and returns the patched buildPack. -func (c *buildPacks) Patch(ctx context.Context, name string, pt types.PatchType, data []byte, opts v1.PatchOptions, subresources ...string) (result *v4beta1.BuildPack, err error) { - result = &v4beta1.BuildPack{} - err = c.client.Patch(pt). - Namespace(c.ns). - Resource("buildpacks"). - Name(name). - SubResource(subresources...). - VersionedParams(&opts, scheme.ParameterCodec). - Body(data). - Do(ctx). - Into(result) - return -} diff --git a/pkg/client/clientset/versioned/typed/jenkins.io/v4beta1/commitstatus.go b/pkg/client/clientset/versioned/typed/jenkins.io/v4beta1/commitstatus.go deleted file mode 100644 index af836bd..0000000 --- a/pkg/client/clientset/versioned/typed/jenkins.io/v4beta1/commitstatus.go +++ /dev/null @@ -1,177 +0,0 @@ -/* -Copyright 2020 The Jenkins X 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 v4beta1 - -import ( - "context" - "time" - - v4beta1 "github.com/jenkins-x/jx-api/v4/pkg/apis/jenkins.io/v4beta1" - scheme "github.com/jenkins-x/jx-api/v4/pkg/client/clientset/versioned/scheme" - v1 "k8s.io/apimachinery/pkg/apis/meta/v1" - types "k8s.io/apimachinery/pkg/types" - watch "k8s.io/apimachinery/pkg/watch" - rest "k8s.io/client-go/rest" -) - -// CommitStatusesGetter has a method to return a CommitStatusInterface. -// A group's client should implement this interface. -type CommitStatusesGetter interface { - CommitStatuses(namespace string) CommitStatusInterface -} - -// CommitStatusInterface has methods to work with CommitStatus resources. -type CommitStatusInterface interface { - Create(ctx context.Context, commitStatus *v4beta1.CommitStatus, opts v1.CreateOptions) (*v4beta1.CommitStatus, error) - Update(ctx context.Context, commitStatus *v4beta1.CommitStatus, opts v1.UpdateOptions) (*v4beta1.CommitStatus, error) - Delete(ctx context.Context, name string, opts v1.DeleteOptions) error - DeleteCollection(ctx context.Context, opts v1.DeleteOptions, listOpts v1.ListOptions) error - Get(ctx context.Context, name string, opts v1.GetOptions) (*v4beta1.CommitStatus, error) - List(ctx context.Context, opts v1.ListOptions) (*v4beta1.CommitStatusList, error) - Watch(ctx context.Context, opts v1.ListOptions) (watch.Interface, error) - Patch(ctx context.Context, name string, pt types.PatchType, data []byte, opts v1.PatchOptions, subresources ...string) (result *v4beta1.CommitStatus, err error) - CommitStatusExpansion -} - -// commitStatuses implements CommitStatusInterface -type commitStatuses struct { - client rest.Interface - ns string -} - -// newCommitStatuses returns a CommitStatuses -func newCommitStatuses(c *JenkinsV4beta1Client, namespace string) *commitStatuses { - return &commitStatuses{ - client: c.RESTClient(), - ns: namespace, - } -} - -// Get takes name of the commitStatus, and returns the corresponding commitStatus object, and an error if there is any. -func (c *commitStatuses) Get(ctx context.Context, name string, options v1.GetOptions) (result *v4beta1.CommitStatus, err error) { - result = &v4beta1.CommitStatus{} - err = c.client.Get(). - Namespace(c.ns). - Resource("commitstatuses"). - Name(name). - VersionedParams(&options, scheme.ParameterCodec). - Do(ctx). - Into(result) - return -} - -// List takes label and field selectors, and returns the list of CommitStatuses that match those selectors. -func (c *commitStatuses) List(ctx context.Context, opts v1.ListOptions) (result *v4beta1.CommitStatusList, err error) { - var timeout time.Duration - if opts.TimeoutSeconds != nil { - timeout = time.Duration(*opts.TimeoutSeconds) * time.Second - } - result = &v4beta1.CommitStatusList{} - err = c.client.Get(). - Namespace(c.ns). - Resource("commitstatuses"). - VersionedParams(&opts, scheme.ParameterCodec). - Timeout(timeout). - Do(ctx). - Into(result) - return -} - -// Watch returns a watch.Interface that watches the requested commitStatuses. -func (c *commitStatuses) Watch(ctx context.Context, opts v1.ListOptions) (watch.Interface, error) { - var timeout time.Duration - if opts.TimeoutSeconds != nil { - timeout = time.Duration(*opts.TimeoutSeconds) * time.Second - } - opts.Watch = true - return c.client.Get(). - Namespace(c.ns). - Resource("commitstatuses"). - VersionedParams(&opts, scheme.ParameterCodec). - Timeout(timeout). - Watch(ctx) -} - -// Create takes the representation of a commitStatus and creates it. Returns the server's representation of the commitStatus, and an error, if there is any. -func (c *commitStatuses) Create(ctx context.Context, commitStatus *v4beta1.CommitStatus, opts v1.CreateOptions) (result *v4beta1.CommitStatus, err error) { - result = &v4beta1.CommitStatus{} - err = c.client.Post(). - Namespace(c.ns). - Resource("commitstatuses"). - VersionedParams(&opts, scheme.ParameterCodec). - Body(commitStatus). - Do(ctx). - Into(result) - return -} - -// Update takes the representation of a commitStatus and updates it. Returns the server's representation of the commitStatus, and an error, if there is any. -func (c *commitStatuses) Update(ctx context.Context, commitStatus *v4beta1.CommitStatus, opts v1.UpdateOptions) (result *v4beta1.CommitStatus, err error) { - result = &v4beta1.CommitStatus{} - err = c.client.Put(). - Namespace(c.ns). - Resource("commitstatuses"). - Name(commitStatus.Name). - VersionedParams(&opts, scheme.ParameterCodec). - Body(commitStatus). - Do(ctx). - Into(result) - return -} - -// Delete takes name of the commitStatus and deletes it. Returns an error if one occurs. -func (c *commitStatuses) Delete(ctx context.Context, name string, opts v1.DeleteOptions) error { - return c.client.Delete(). - Namespace(c.ns). - Resource("commitstatuses"). - Name(name). - Body(&opts). - Do(ctx). - Error() -} - -// DeleteCollection deletes a collection of objects. -func (c *commitStatuses) DeleteCollection(ctx context.Context, opts v1.DeleteOptions, listOpts v1.ListOptions) error { - var timeout time.Duration - if listOpts.TimeoutSeconds != nil { - timeout = time.Duration(*listOpts.TimeoutSeconds) * time.Second - } - return c.client.Delete(). - Namespace(c.ns). - Resource("commitstatuses"). - VersionedParams(&listOpts, scheme.ParameterCodec). - Timeout(timeout). - Body(&opts). - Do(ctx). - Error() -} - -// Patch applies the patch and returns the patched commitStatus. -func (c *commitStatuses) Patch(ctx context.Context, name string, pt types.PatchType, data []byte, opts v1.PatchOptions, subresources ...string) (result *v4beta1.CommitStatus, err error) { - result = &v4beta1.CommitStatus{} - err = c.client.Patch(pt). - Namespace(c.ns). - Resource("commitstatuses"). - Name(name). - SubResource(subresources...). - VersionedParams(&opts, scheme.ParameterCodec). - Body(data). - Do(ctx). - Into(result) - return -} diff --git a/pkg/client/clientset/versioned/typed/jenkins.io/v4beta1/environmentrolebinding.go b/pkg/client/clientset/versioned/typed/jenkins.io/v4beta1/environmentrolebinding.go deleted file mode 100644 index 8c6dc60..0000000 --- a/pkg/client/clientset/versioned/typed/jenkins.io/v4beta1/environmentrolebinding.go +++ /dev/null @@ -1,177 +0,0 @@ -/* -Copyright 2020 The Jenkins X 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 v4beta1 - -import ( - "context" - "time" - - v4beta1 "github.com/jenkins-x/jx-api/v4/pkg/apis/jenkins.io/v4beta1" - scheme "github.com/jenkins-x/jx-api/v4/pkg/client/clientset/versioned/scheme" - v1 "k8s.io/apimachinery/pkg/apis/meta/v1" - types "k8s.io/apimachinery/pkg/types" - watch "k8s.io/apimachinery/pkg/watch" - rest "k8s.io/client-go/rest" -) - -// EnvironmentRoleBindingsGetter has a method to return a EnvironmentRoleBindingInterface. -// A group's client should implement this interface. -type EnvironmentRoleBindingsGetter interface { - EnvironmentRoleBindings(namespace string) EnvironmentRoleBindingInterface -} - -// EnvironmentRoleBindingInterface has methods to work with EnvironmentRoleBinding resources. -type EnvironmentRoleBindingInterface interface { - Create(ctx context.Context, environmentRoleBinding *v4beta1.EnvironmentRoleBinding, opts v1.CreateOptions) (*v4beta1.EnvironmentRoleBinding, error) - Update(ctx context.Context, environmentRoleBinding *v4beta1.EnvironmentRoleBinding, opts v1.UpdateOptions) (*v4beta1.EnvironmentRoleBinding, error) - Delete(ctx context.Context, name string, opts v1.DeleteOptions) error - DeleteCollection(ctx context.Context, opts v1.DeleteOptions, listOpts v1.ListOptions) error - Get(ctx context.Context, name string, opts v1.GetOptions) (*v4beta1.EnvironmentRoleBinding, error) - List(ctx context.Context, opts v1.ListOptions) (*v4beta1.EnvironmentRoleBindingList, error) - Watch(ctx context.Context, opts v1.ListOptions) (watch.Interface, error) - Patch(ctx context.Context, name string, pt types.PatchType, data []byte, opts v1.PatchOptions, subresources ...string) (result *v4beta1.EnvironmentRoleBinding, err error) - EnvironmentRoleBindingExpansion -} - -// environmentRoleBindings implements EnvironmentRoleBindingInterface -type environmentRoleBindings struct { - client rest.Interface - ns string -} - -// newEnvironmentRoleBindings returns a EnvironmentRoleBindings -func newEnvironmentRoleBindings(c *JenkinsV4beta1Client, namespace string) *environmentRoleBindings { - return &environmentRoleBindings{ - client: c.RESTClient(), - ns: namespace, - } -} - -// Get takes name of the environmentRoleBinding, and returns the corresponding environmentRoleBinding object, and an error if there is any. -func (c *environmentRoleBindings) Get(ctx context.Context, name string, options v1.GetOptions) (result *v4beta1.EnvironmentRoleBinding, err error) { - result = &v4beta1.EnvironmentRoleBinding{} - err = c.client.Get(). - Namespace(c.ns). - Resource("environmentrolebindings"). - Name(name). - VersionedParams(&options, scheme.ParameterCodec). - Do(ctx). - Into(result) - return -} - -// List takes label and field selectors, and returns the list of EnvironmentRoleBindings that match those selectors. -func (c *environmentRoleBindings) List(ctx context.Context, opts v1.ListOptions) (result *v4beta1.EnvironmentRoleBindingList, err error) { - var timeout time.Duration - if opts.TimeoutSeconds != nil { - timeout = time.Duration(*opts.TimeoutSeconds) * time.Second - } - result = &v4beta1.EnvironmentRoleBindingList{} - err = c.client.Get(). - Namespace(c.ns). - Resource("environmentrolebindings"). - VersionedParams(&opts, scheme.ParameterCodec). - Timeout(timeout). - Do(ctx). - Into(result) - return -} - -// Watch returns a watch.Interface that watches the requested environmentRoleBindings. -func (c *environmentRoleBindings) Watch(ctx context.Context, opts v1.ListOptions) (watch.Interface, error) { - var timeout time.Duration - if opts.TimeoutSeconds != nil { - timeout = time.Duration(*opts.TimeoutSeconds) * time.Second - } - opts.Watch = true - return c.client.Get(). - Namespace(c.ns). - Resource("environmentrolebindings"). - VersionedParams(&opts, scheme.ParameterCodec). - Timeout(timeout). - Watch(ctx) -} - -// Create takes the representation of a environmentRoleBinding and creates it. Returns the server's representation of the environmentRoleBinding, and an error, if there is any. -func (c *environmentRoleBindings) Create(ctx context.Context, environmentRoleBinding *v4beta1.EnvironmentRoleBinding, opts v1.CreateOptions) (result *v4beta1.EnvironmentRoleBinding, err error) { - result = &v4beta1.EnvironmentRoleBinding{} - err = c.client.Post(). - Namespace(c.ns). - Resource("environmentrolebindings"). - VersionedParams(&opts, scheme.ParameterCodec). - Body(environmentRoleBinding). - Do(ctx). - Into(result) - return -} - -// Update takes the representation of a environmentRoleBinding and updates it. Returns the server's representation of the environmentRoleBinding, and an error, if there is any. -func (c *environmentRoleBindings) Update(ctx context.Context, environmentRoleBinding *v4beta1.EnvironmentRoleBinding, opts v1.UpdateOptions) (result *v4beta1.EnvironmentRoleBinding, err error) { - result = &v4beta1.EnvironmentRoleBinding{} - err = c.client.Put(). - Namespace(c.ns). - Resource("environmentrolebindings"). - Name(environmentRoleBinding.Name). - VersionedParams(&opts, scheme.ParameterCodec). - Body(environmentRoleBinding). - Do(ctx). - Into(result) - return -} - -// Delete takes name of the environmentRoleBinding and deletes it. Returns an error if one occurs. -func (c *environmentRoleBindings) Delete(ctx context.Context, name string, opts v1.DeleteOptions) error { - return c.client.Delete(). - Namespace(c.ns). - Resource("environmentrolebindings"). - Name(name). - Body(&opts). - Do(ctx). - Error() -} - -// DeleteCollection deletes a collection of objects. -func (c *environmentRoleBindings) DeleteCollection(ctx context.Context, opts v1.DeleteOptions, listOpts v1.ListOptions) error { - var timeout time.Duration - if listOpts.TimeoutSeconds != nil { - timeout = time.Duration(*listOpts.TimeoutSeconds) * time.Second - } - return c.client.Delete(). - Namespace(c.ns). - Resource("environmentrolebindings"). - VersionedParams(&listOpts, scheme.ParameterCodec). - Timeout(timeout). - Body(&opts). - Do(ctx). - Error() -} - -// Patch applies the patch and returns the patched environmentRoleBinding. -func (c *environmentRoleBindings) Patch(ctx context.Context, name string, pt types.PatchType, data []byte, opts v1.PatchOptions, subresources ...string) (result *v4beta1.EnvironmentRoleBinding, err error) { - result = &v4beta1.EnvironmentRoleBinding{} - err = c.client.Patch(pt). - Namespace(c.ns). - Resource("environmentrolebindings"). - Name(name). - SubResource(subresources...). - VersionedParams(&opts, scheme.ParameterCodec). - Body(data). - Do(ctx). - Into(result) - return -} diff --git a/pkg/client/clientset/versioned/typed/jenkins.io/v4beta1/extension.go b/pkg/client/clientset/versioned/typed/jenkins.io/v4beta1/extension.go deleted file mode 100644 index 531f9e2..0000000 --- a/pkg/client/clientset/versioned/typed/jenkins.io/v4beta1/extension.go +++ /dev/null @@ -1,177 +0,0 @@ -/* -Copyright 2020 The Jenkins X 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 v4beta1 - -import ( - "context" - "time" - - v4beta1 "github.com/jenkins-x/jx-api/v4/pkg/apis/jenkins.io/v4beta1" - scheme "github.com/jenkins-x/jx-api/v4/pkg/client/clientset/versioned/scheme" - v1 "k8s.io/apimachinery/pkg/apis/meta/v1" - types "k8s.io/apimachinery/pkg/types" - watch "k8s.io/apimachinery/pkg/watch" - rest "k8s.io/client-go/rest" -) - -// ExtensionsGetter has a method to return a ExtensionInterface. -// A group's client should implement this interface. -type ExtensionsGetter interface { - Extensions(namespace string) ExtensionInterface -} - -// ExtensionInterface has methods to work with Extension resources. -type ExtensionInterface interface { - Create(ctx context.Context, extension *v4beta1.Extension, opts v1.CreateOptions) (*v4beta1.Extension, error) - Update(ctx context.Context, extension *v4beta1.Extension, opts v1.UpdateOptions) (*v4beta1.Extension, error) - Delete(ctx context.Context, name string, opts v1.DeleteOptions) error - DeleteCollection(ctx context.Context, opts v1.DeleteOptions, listOpts v1.ListOptions) error - Get(ctx context.Context, name string, opts v1.GetOptions) (*v4beta1.Extension, error) - List(ctx context.Context, opts v1.ListOptions) (*v4beta1.ExtensionList, error) - Watch(ctx context.Context, opts v1.ListOptions) (watch.Interface, error) - Patch(ctx context.Context, name string, pt types.PatchType, data []byte, opts v1.PatchOptions, subresources ...string) (result *v4beta1.Extension, err error) - ExtensionExpansion -} - -// extensions implements ExtensionInterface -type extensions struct { - client rest.Interface - ns string -} - -// newExtensions returns a Extensions -func newExtensions(c *JenkinsV4beta1Client, namespace string) *extensions { - return &extensions{ - client: c.RESTClient(), - ns: namespace, - } -} - -// Get takes name of the extension, and returns the corresponding extension object, and an error if there is any. -func (c *extensions) Get(ctx context.Context, name string, options v1.GetOptions) (result *v4beta1.Extension, err error) { - result = &v4beta1.Extension{} - err = c.client.Get(). - Namespace(c.ns). - Resource("extensions"). - Name(name). - VersionedParams(&options, scheme.ParameterCodec). - Do(ctx). - Into(result) - return -} - -// List takes label and field selectors, and returns the list of Extensions that match those selectors. -func (c *extensions) List(ctx context.Context, opts v1.ListOptions) (result *v4beta1.ExtensionList, err error) { - var timeout time.Duration - if opts.TimeoutSeconds != nil { - timeout = time.Duration(*opts.TimeoutSeconds) * time.Second - } - result = &v4beta1.ExtensionList{} - err = c.client.Get(). - Namespace(c.ns). - Resource("extensions"). - VersionedParams(&opts, scheme.ParameterCodec). - Timeout(timeout). - Do(ctx). - Into(result) - return -} - -// Watch returns a watch.Interface that watches the requested extensions. -func (c *extensions) Watch(ctx context.Context, opts v1.ListOptions) (watch.Interface, error) { - var timeout time.Duration - if opts.TimeoutSeconds != nil { - timeout = time.Duration(*opts.TimeoutSeconds) * time.Second - } - opts.Watch = true - return c.client.Get(). - Namespace(c.ns). - Resource("extensions"). - VersionedParams(&opts, scheme.ParameterCodec). - Timeout(timeout). - Watch(ctx) -} - -// Create takes the representation of a extension and creates it. Returns the server's representation of the extension, and an error, if there is any. -func (c *extensions) Create(ctx context.Context, extension *v4beta1.Extension, opts v1.CreateOptions) (result *v4beta1.Extension, err error) { - result = &v4beta1.Extension{} - err = c.client.Post(). - Namespace(c.ns). - Resource("extensions"). - VersionedParams(&opts, scheme.ParameterCodec). - Body(extension). - Do(ctx). - Into(result) - return -} - -// Update takes the representation of a extension and updates it. Returns the server's representation of the extension, and an error, if there is any. -func (c *extensions) Update(ctx context.Context, extension *v4beta1.Extension, opts v1.UpdateOptions) (result *v4beta1.Extension, err error) { - result = &v4beta1.Extension{} - err = c.client.Put(). - Namespace(c.ns). - Resource("extensions"). - Name(extension.Name). - VersionedParams(&opts, scheme.ParameterCodec). - Body(extension). - Do(ctx). - Into(result) - return -} - -// Delete takes name of the extension and deletes it. Returns an error if one occurs. -func (c *extensions) Delete(ctx context.Context, name string, opts v1.DeleteOptions) error { - return c.client.Delete(). - Namespace(c.ns). - Resource("extensions"). - Name(name). - Body(&opts). - Do(ctx). - Error() -} - -// DeleteCollection deletes a collection of objects. -func (c *extensions) DeleteCollection(ctx context.Context, opts v1.DeleteOptions, listOpts v1.ListOptions) error { - var timeout time.Duration - if listOpts.TimeoutSeconds != nil { - timeout = time.Duration(*listOpts.TimeoutSeconds) * time.Second - } - return c.client.Delete(). - Namespace(c.ns). - Resource("extensions"). - VersionedParams(&listOpts, scheme.ParameterCodec). - Timeout(timeout). - Body(&opts). - Do(ctx). - Error() -} - -// Patch applies the patch and returns the patched extension. -func (c *extensions) Patch(ctx context.Context, name string, pt types.PatchType, data []byte, opts v1.PatchOptions, subresources ...string) (result *v4beta1.Extension, err error) { - result = &v4beta1.Extension{} - err = c.client.Patch(pt). - Namespace(c.ns). - Resource("extensions"). - Name(name). - SubResource(subresources...). - VersionedParams(&opts, scheme.ParameterCodec). - Body(data). - Do(ctx). - Into(result) - return -} diff --git a/pkg/client/clientset/versioned/typed/jenkins.io/v4beta1/fake/fake_app.go b/pkg/client/clientset/versioned/typed/jenkins.io/v4beta1/fake/fake_app.go deleted file mode 100644 index c0246b1..0000000 --- a/pkg/client/clientset/versioned/typed/jenkins.io/v4beta1/fake/fake_app.go +++ /dev/null @@ -1,129 +0,0 @@ -/* -Copyright 2020 The Jenkins X 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 - -import ( - "context" - - v4beta1 "github.com/jenkins-x/jx-api/v4/pkg/apis/jenkins.io/v4beta1" - v1 "k8s.io/apimachinery/pkg/apis/meta/v1" - labels "k8s.io/apimachinery/pkg/labels" - schema "k8s.io/apimachinery/pkg/runtime/schema" - types "k8s.io/apimachinery/pkg/types" - watch "k8s.io/apimachinery/pkg/watch" - testing "k8s.io/client-go/testing" -) - -// FakeApps implements AppInterface -type FakeApps struct { - Fake *FakeJenkinsV4beta1 - ns string -} - -var appsResource = schema.GroupVersionResource{Group: "jenkins.io", Version: "v4beta1", Resource: "apps"} - -var appsKind = schema.GroupVersionKind{Group: "jenkins.io", Version: "v4beta1", Kind: "App"} - -// Get takes name of the app, and returns the corresponding app object, and an error if there is any. -func (c *FakeApps) Get(ctx context.Context, name string, options v1.GetOptions) (result *v4beta1.App, err error) { - obj, err := c.Fake. - Invokes(testing.NewGetAction(appsResource, c.ns, name), &v4beta1.App{}) - - if obj == nil { - return nil, err - } - return obj.(*v4beta1.App), err -} - -// List takes label and field selectors, and returns the list of Apps that match those selectors. -func (c *FakeApps) List(ctx context.Context, opts v1.ListOptions) (result *v4beta1.AppList, err error) { - obj, err := c.Fake. - Invokes(testing.NewListAction(appsResource, appsKind, c.ns, opts), &v4beta1.AppList{}) - - if obj == nil { - return nil, err - } - - label, _, _ := testing.ExtractFromListOptions(opts) - if label == nil { - label = labels.Everything() - } - list := &v4beta1.AppList{ListMeta: obj.(*v4beta1.AppList).ListMeta} - for _, item := range obj.(*v4beta1.AppList).Items { - if label.Matches(labels.Set(item.Labels)) { - list.Items = append(list.Items, item) - } - } - return list, err -} - -// Watch returns a watch.Interface that watches the requested apps. -func (c *FakeApps) Watch(ctx context.Context, opts v1.ListOptions) (watch.Interface, error) { - return c.Fake. - InvokesWatch(testing.NewWatchAction(appsResource, c.ns, opts)) - -} - -// Create takes the representation of a app and creates it. Returns the server's representation of the app, and an error, if there is any. -func (c *FakeApps) Create(ctx context.Context, app *v4beta1.App, opts v1.CreateOptions) (result *v4beta1.App, err error) { - obj, err := c.Fake. - Invokes(testing.NewCreateAction(appsResource, c.ns, app), &v4beta1.App{}) - - if obj == nil { - return nil, err - } - return obj.(*v4beta1.App), err -} - -// Update takes the representation of a app and updates it. Returns the server's representation of the app, and an error, if there is any. -func (c *FakeApps) Update(ctx context.Context, app *v4beta1.App, opts v1.UpdateOptions) (result *v4beta1.App, err error) { - obj, err := c.Fake. - Invokes(testing.NewUpdateAction(appsResource, c.ns, app), &v4beta1.App{}) - - if obj == nil { - return nil, err - } - return obj.(*v4beta1.App), err -} - -// Delete takes name of the app and deletes it. Returns an error if one occurs. -func (c *FakeApps) Delete(ctx context.Context, name string, opts v1.DeleteOptions) error { - _, err := c.Fake. - Invokes(testing.NewDeleteAction(appsResource, c.ns, name), &v4beta1.App{}) - - return err -} - -// DeleteCollection deletes a collection of objects. -func (c *FakeApps) DeleteCollection(ctx context.Context, opts v1.DeleteOptions, listOpts v1.ListOptions) error { - action := testing.NewDeleteCollectionAction(appsResource, c.ns, listOpts) - - _, err := c.Fake.Invokes(action, &v4beta1.AppList{}) - return err -} - -// Patch applies the patch and returns the patched app. -func (c *FakeApps) Patch(ctx context.Context, name string, pt types.PatchType, data []byte, opts v1.PatchOptions, subresources ...string) (result *v4beta1.App, err error) { - obj, err := c.Fake. - Invokes(testing.NewPatchSubresourceAction(appsResource, c.ns, name, pt, data, subresources...), &v4beta1.App{}) - - if obj == nil { - return nil, err - } - return obj.(*v4beta1.App), err -} diff --git a/pkg/client/clientset/versioned/typed/jenkins.io/v4beta1/fake/fake_buildpack.go b/pkg/client/clientset/versioned/typed/jenkins.io/v4beta1/fake/fake_buildpack.go deleted file mode 100644 index 50ac035..0000000 --- a/pkg/client/clientset/versioned/typed/jenkins.io/v4beta1/fake/fake_buildpack.go +++ /dev/null @@ -1,129 +0,0 @@ -/* -Copyright 2020 The Jenkins X 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 - -import ( - "context" - - v4beta1 "github.com/jenkins-x/jx-api/v4/pkg/apis/jenkins.io/v4beta1" - v1 "k8s.io/apimachinery/pkg/apis/meta/v1" - labels "k8s.io/apimachinery/pkg/labels" - schema "k8s.io/apimachinery/pkg/runtime/schema" - types "k8s.io/apimachinery/pkg/types" - watch "k8s.io/apimachinery/pkg/watch" - testing "k8s.io/client-go/testing" -) - -// FakeBuildPacks implements BuildPackInterface -type FakeBuildPacks struct { - Fake *FakeJenkinsV4beta1 - ns string -} - -var buildpacksResource = schema.GroupVersionResource{Group: "jenkins.io", Version: "v4beta1", Resource: "buildpacks"} - -var buildpacksKind = schema.GroupVersionKind{Group: "jenkins.io", Version: "v4beta1", Kind: "BuildPack"} - -// Get takes name of the buildPack, and returns the corresponding buildPack object, and an error if there is any. -func (c *FakeBuildPacks) Get(ctx context.Context, name string, options v1.GetOptions) (result *v4beta1.BuildPack, err error) { - obj, err := c.Fake. - Invokes(testing.NewGetAction(buildpacksResource, c.ns, name), &v4beta1.BuildPack{}) - - if obj == nil { - return nil, err - } - return obj.(*v4beta1.BuildPack), err -} - -// List takes label and field selectors, and returns the list of BuildPacks that match those selectors. -func (c *FakeBuildPacks) List(ctx context.Context, opts v1.ListOptions) (result *v4beta1.BuildPackList, err error) { - obj, err := c.Fake. - Invokes(testing.NewListAction(buildpacksResource, buildpacksKind, c.ns, opts), &v4beta1.BuildPackList{}) - - if obj == nil { - return nil, err - } - - label, _, _ := testing.ExtractFromListOptions(opts) - if label == nil { - label = labels.Everything() - } - list := &v4beta1.BuildPackList{ListMeta: obj.(*v4beta1.BuildPackList).ListMeta} - for _, item := range obj.(*v4beta1.BuildPackList).Items { - if label.Matches(labels.Set(item.Labels)) { - list.Items = append(list.Items, item) - } - } - return list, err -} - -// Watch returns a watch.Interface that watches the requested buildPacks. -func (c *FakeBuildPacks) Watch(ctx context.Context, opts v1.ListOptions) (watch.Interface, error) { - return c.Fake. - InvokesWatch(testing.NewWatchAction(buildpacksResource, c.ns, opts)) - -} - -// Create takes the representation of a buildPack and creates it. Returns the server's representation of the buildPack, and an error, if there is any. -func (c *FakeBuildPacks) Create(ctx context.Context, buildPack *v4beta1.BuildPack, opts v1.CreateOptions) (result *v4beta1.BuildPack, err error) { - obj, err := c.Fake. - Invokes(testing.NewCreateAction(buildpacksResource, c.ns, buildPack), &v4beta1.BuildPack{}) - - if obj == nil { - return nil, err - } - return obj.(*v4beta1.BuildPack), err -} - -// Update takes the representation of a buildPack and updates it. Returns the server's representation of the buildPack, and an error, if there is any. -func (c *FakeBuildPacks) Update(ctx context.Context, buildPack *v4beta1.BuildPack, opts v1.UpdateOptions) (result *v4beta1.BuildPack, err error) { - obj, err := c.Fake. - Invokes(testing.NewUpdateAction(buildpacksResource, c.ns, buildPack), &v4beta1.BuildPack{}) - - if obj == nil { - return nil, err - } - return obj.(*v4beta1.BuildPack), err -} - -// Delete takes name of the buildPack and deletes it. Returns an error if one occurs. -func (c *FakeBuildPacks) Delete(ctx context.Context, name string, opts v1.DeleteOptions) error { - _, err := c.Fake. - Invokes(testing.NewDeleteAction(buildpacksResource, c.ns, name), &v4beta1.BuildPack{}) - - return err -} - -// DeleteCollection deletes a collection of objects. -func (c *FakeBuildPacks) DeleteCollection(ctx context.Context, opts v1.DeleteOptions, listOpts v1.ListOptions) error { - action := testing.NewDeleteCollectionAction(buildpacksResource, c.ns, listOpts) - - _, err := c.Fake.Invokes(action, &v4beta1.BuildPackList{}) - return err -} - -// Patch applies the patch and returns the patched buildPack. -func (c *FakeBuildPacks) Patch(ctx context.Context, name string, pt types.PatchType, data []byte, opts v1.PatchOptions, subresources ...string) (result *v4beta1.BuildPack, err error) { - obj, err := c.Fake. - Invokes(testing.NewPatchSubresourceAction(buildpacksResource, c.ns, name, pt, data, subresources...), &v4beta1.BuildPack{}) - - if obj == nil { - return nil, err - } - return obj.(*v4beta1.BuildPack), err -} diff --git a/pkg/client/clientset/versioned/typed/jenkins.io/v4beta1/fake/fake_commitstatus.go b/pkg/client/clientset/versioned/typed/jenkins.io/v4beta1/fake/fake_commitstatus.go deleted file mode 100644 index b978a11..0000000 --- a/pkg/client/clientset/versioned/typed/jenkins.io/v4beta1/fake/fake_commitstatus.go +++ /dev/null @@ -1,129 +0,0 @@ -/* -Copyright 2020 The Jenkins X 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 - -import ( - "context" - - v4beta1 "github.com/jenkins-x/jx-api/v4/pkg/apis/jenkins.io/v4beta1" - v1 "k8s.io/apimachinery/pkg/apis/meta/v1" - labels "k8s.io/apimachinery/pkg/labels" - schema "k8s.io/apimachinery/pkg/runtime/schema" - types "k8s.io/apimachinery/pkg/types" - watch "k8s.io/apimachinery/pkg/watch" - testing "k8s.io/client-go/testing" -) - -// FakeCommitStatuses implements CommitStatusInterface -type FakeCommitStatuses struct { - Fake *FakeJenkinsV4beta1 - ns string -} - -var commitstatusesResource = schema.GroupVersionResource{Group: "jenkins.io", Version: "v4beta1", Resource: "commitstatuses"} - -var commitstatusesKind = schema.GroupVersionKind{Group: "jenkins.io", Version: "v4beta1", Kind: "CommitStatus"} - -// Get takes name of the commitStatus, and returns the corresponding commitStatus object, and an error if there is any. -func (c *FakeCommitStatuses) Get(ctx context.Context, name string, options v1.GetOptions) (result *v4beta1.CommitStatus, err error) { - obj, err := c.Fake. - Invokes(testing.NewGetAction(commitstatusesResource, c.ns, name), &v4beta1.CommitStatus{}) - - if obj == nil { - return nil, err - } - return obj.(*v4beta1.CommitStatus), err -} - -// List takes label and field selectors, and returns the list of CommitStatuses that match those selectors. -func (c *FakeCommitStatuses) List(ctx context.Context, opts v1.ListOptions) (result *v4beta1.CommitStatusList, err error) { - obj, err := c.Fake. - Invokes(testing.NewListAction(commitstatusesResource, commitstatusesKind, c.ns, opts), &v4beta1.CommitStatusList{}) - - if obj == nil { - return nil, err - } - - label, _, _ := testing.ExtractFromListOptions(opts) - if label == nil { - label = labels.Everything() - } - list := &v4beta1.CommitStatusList{ListMeta: obj.(*v4beta1.CommitStatusList).ListMeta} - for _, item := range obj.(*v4beta1.CommitStatusList).Items { - if label.Matches(labels.Set(item.Labels)) { - list.Items = append(list.Items, item) - } - } - return list, err -} - -// Watch returns a watch.Interface that watches the requested commitStatuses. -func (c *FakeCommitStatuses) Watch(ctx context.Context, opts v1.ListOptions) (watch.Interface, error) { - return c.Fake. - InvokesWatch(testing.NewWatchAction(commitstatusesResource, c.ns, opts)) - -} - -// Create takes the representation of a commitStatus and creates it. Returns the server's representation of the commitStatus, and an error, if there is any. -func (c *FakeCommitStatuses) Create(ctx context.Context, commitStatus *v4beta1.CommitStatus, opts v1.CreateOptions) (result *v4beta1.CommitStatus, err error) { - obj, err := c.Fake. - Invokes(testing.NewCreateAction(commitstatusesResource, c.ns, commitStatus), &v4beta1.CommitStatus{}) - - if obj == nil { - return nil, err - } - return obj.(*v4beta1.CommitStatus), err -} - -// Update takes the representation of a commitStatus and updates it. Returns the server's representation of the commitStatus, and an error, if there is any. -func (c *FakeCommitStatuses) Update(ctx context.Context, commitStatus *v4beta1.CommitStatus, opts v1.UpdateOptions) (result *v4beta1.CommitStatus, err error) { - obj, err := c.Fake. - Invokes(testing.NewUpdateAction(commitstatusesResource, c.ns, commitStatus), &v4beta1.CommitStatus{}) - - if obj == nil { - return nil, err - } - return obj.(*v4beta1.CommitStatus), err -} - -// Delete takes name of the commitStatus and deletes it. Returns an error if one occurs. -func (c *FakeCommitStatuses) Delete(ctx context.Context, name string, opts v1.DeleteOptions) error { - _, err := c.Fake. - Invokes(testing.NewDeleteAction(commitstatusesResource, c.ns, name), &v4beta1.CommitStatus{}) - - return err -} - -// DeleteCollection deletes a collection of objects. -func (c *FakeCommitStatuses) DeleteCollection(ctx context.Context, opts v1.DeleteOptions, listOpts v1.ListOptions) error { - action := testing.NewDeleteCollectionAction(commitstatusesResource, c.ns, listOpts) - - _, err := c.Fake.Invokes(action, &v4beta1.CommitStatusList{}) - return err -} - -// Patch applies the patch and returns the patched commitStatus. -func (c *FakeCommitStatuses) Patch(ctx context.Context, name string, pt types.PatchType, data []byte, opts v1.PatchOptions, subresources ...string) (result *v4beta1.CommitStatus, err error) { - obj, err := c.Fake. - Invokes(testing.NewPatchSubresourceAction(commitstatusesResource, c.ns, name, pt, data, subresources...), &v4beta1.CommitStatus{}) - - if obj == nil { - return nil, err - } - return obj.(*v4beta1.CommitStatus), err -} diff --git a/pkg/client/clientset/versioned/typed/jenkins.io/v4beta1/fake/fake_environmentrolebinding.go b/pkg/client/clientset/versioned/typed/jenkins.io/v4beta1/fake/fake_environmentrolebinding.go deleted file mode 100644 index b042504..0000000 --- a/pkg/client/clientset/versioned/typed/jenkins.io/v4beta1/fake/fake_environmentrolebinding.go +++ /dev/null @@ -1,129 +0,0 @@ -/* -Copyright 2020 The Jenkins X 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 - -import ( - "context" - - v4beta1 "github.com/jenkins-x/jx-api/v4/pkg/apis/jenkins.io/v4beta1" - v1 "k8s.io/apimachinery/pkg/apis/meta/v1" - labels "k8s.io/apimachinery/pkg/labels" - schema "k8s.io/apimachinery/pkg/runtime/schema" - types "k8s.io/apimachinery/pkg/types" - watch "k8s.io/apimachinery/pkg/watch" - testing "k8s.io/client-go/testing" -) - -// FakeEnvironmentRoleBindings implements EnvironmentRoleBindingInterface -type FakeEnvironmentRoleBindings struct { - Fake *FakeJenkinsV4beta1 - ns string -} - -var environmentrolebindingsResource = schema.GroupVersionResource{Group: "jenkins.io", Version: "v4beta1", Resource: "environmentrolebindings"} - -var environmentrolebindingsKind = schema.GroupVersionKind{Group: "jenkins.io", Version: "v4beta1", Kind: "EnvironmentRoleBinding"} - -// Get takes name of the environmentRoleBinding, and returns the corresponding environmentRoleBinding object, and an error if there is any. -func (c *FakeEnvironmentRoleBindings) Get(ctx context.Context, name string, options v1.GetOptions) (result *v4beta1.EnvironmentRoleBinding, err error) { - obj, err := c.Fake. - Invokes(testing.NewGetAction(environmentrolebindingsResource, c.ns, name), &v4beta1.EnvironmentRoleBinding{}) - - if obj == nil { - return nil, err - } - return obj.(*v4beta1.EnvironmentRoleBinding), err -} - -// List takes label and field selectors, and returns the list of EnvironmentRoleBindings that match those selectors. -func (c *FakeEnvironmentRoleBindings) List(ctx context.Context, opts v1.ListOptions) (result *v4beta1.EnvironmentRoleBindingList, err error) { - obj, err := c.Fake. - Invokes(testing.NewListAction(environmentrolebindingsResource, environmentrolebindingsKind, c.ns, opts), &v4beta1.EnvironmentRoleBindingList{}) - - if obj == nil { - return nil, err - } - - label, _, _ := testing.ExtractFromListOptions(opts) - if label == nil { - label = labels.Everything() - } - list := &v4beta1.EnvironmentRoleBindingList{ListMeta: obj.(*v4beta1.EnvironmentRoleBindingList).ListMeta} - for _, item := range obj.(*v4beta1.EnvironmentRoleBindingList).Items { - if label.Matches(labels.Set(item.Labels)) { - list.Items = append(list.Items, item) - } - } - return list, err -} - -// Watch returns a watch.Interface that watches the requested environmentRoleBindings. -func (c *FakeEnvironmentRoleBindings) Watch(ctx context.Context, opts v1.ListOptions) (watch.Interface, error) { - return c.Fake. - InvokesWatch(testing.NewWatchAction(environmentrolebindingsResource, c.ns, opts)) - -} - -// Create takes the representation of a environmentRoleBinding and creates it. Returns the server's representation of the environmentRoleBinding, and an error, if there is any. -func (c *FakeEnvironmentRoleBindings) Create(ctx context.Context, environmentRoleBinding *v4beta1.EnvironmentRoleBinding, opts v1.CreateOptions) (result *v4beta1.EnvironmentRoleBinding, err error) { - obj, err := c.Fake. - Invokes(testing.NewCreateAction(environmentrolebindingsResource, c.ns, environmentRoleBinding), &v4beta1.EnvironmentRoleBinding{}) - - if obj == nil { - return nil, err - } - return obj.(*v4beta1.EnvironmentRoleBinding), err -} - -// Update takes the representation of a environmentRoleBinding and updates it. Returns the server's representation of the environmentRoleBinding, and an error, if there is any. -func (c *FakeEnvironmentRoleBindings) Update(ctx context.Context, environmentRoleBinding *v4beta1.EnvironmentRoleBinding, opts v1.UpdateOptions) (result *v4beta1.EnvironmentRoleBinding, err error) { - obj, err := c.Fake. - Invokes(testing.NewUpdateAction(environmentrolebindingsResource, c.ns, environmentRoleBinding), &v4beta1.EnvironmentRoleBinding{}) - - if obj == nil { - return nil, err - } - return obj.(*v4beta1.EnvironmentRoleBinding), err -} - -// Delete takes name of the environmentRoleBinding and deletes it. Returns an error if one occurs. -func (c *FakeEnvironmentRoleBindings) Delete(ctx context.Context, name string, opts v1.DeleteOptions) error { - _, err := c.Fake. - Invokes(testing.NewDeleteAction(environmentrolebindingsResource, c.ns, name), &v4beta1.EnvironmentRoleBinding{}) - - return err -} - -// DeleteCollection deletes a collection of objects. -func (c *FakeEnvironmentRoleBindings) DeleteCollection(ctx context.Context, opts v1.DeleteOptions, listOpts v1.ListOptions) error { - action := testing.NewDeleteCollectionAction(environmentrolebindingsResource, c.ns, listOpts) - - _, err := c.Fake.Invokes(action, &v4beta1.EnvironmentRoleBindingList{}) - return err -} - -// Patch applies the patch and returns the patched environmentRoleBinding. -func (c *FakeEnvironmentRoleBindings) Patch(ctx context.Context, name string, pt types.PatchType, data []byte, opts v1.PatchOptions, subresources ...string) (result *v4beta1.EnvironmentRoleBinding, err error) { - obj, err := c.Fake. - Invokes(testing.NewPatchSubresourceAction(environmentrolebindingsResource, c.ns, name, pt, data, subresources...), &v4beta1.EnvironmentRoleBinding{}) - - if obj == nil { - return nil, err - } - return obj.(*v4beta1.EnvironmentRoleBinding), err -} diff --git a/pkg/client/clientset/versioned/typed/jenkins.io/v4beta1/fake/fake_extension.go b/pkg/client/clientset/versioned/typed/jenkins.io/v4beta1/fake/fake_extension.go deleted file mode 100644 index 226e992..0000000 --- a/pkg/client/clientset/versioned/typed/jenkins.io/v4beta1/fake/fake_extension.go +++ /dev/null @@ -1,129 +0,0 @@ -/* -Copyright 2020 The Jenkins X 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 - -import ( - "context" - - v4beta1 "github.com/jenkins-x/jx-api/v4/pkg/apis/jenkins.io/v4beta1" - v1 "k8s.io/apimachinery/pkg/apis/meta/v1" - labels "k8s.io/apimachinery/pkg/labels" - schema "k8s.io/apimachinery/pkg/runtime/schema" - types "k8s.io/apimachinery/pkg/types" - watch "k8s.io/apimachinery/pkg/watch" - testing "k8s.io/client-go/testing" -) - -// FakeExtensions implements ExtensionInterface -type FakeExtensions struct { - Fake *FakeJenkinsV4beta1 - ns string -} - -var extensionsResource = schema.GroupVersionResource{Group: "jenkins.io", Version: "v4beta1", Resource: "extensions"} - -var extensionsKind = schema.GroupVersionKind{Group: "jenkins.io", Version: "v4beta1", Kind: "Extension"} - -// Get takes name of the extension, and returns the corresponding extension object, and an error if there is any. -func (c *FakeExtensions) Get(ctx context.Context, name string, options v1.GetOptions) (result *v4beta1.Extension, err error) { - obj, err := c.Fake. - Invokes(testing.NewGetAction(extensionsResource, c.ns, name), &v4beta1.Extension{}) - - if obj == nil { - return nil, err - } - return obj.(*v4beta1.Extension), err -} - -// List takes label and field selectors, and returns the list of Extensions that match those selectors. -func (c *FakeExtensions) List(ctx context.Context, opts v1.ListOptions) (result *v4beta1.ExtensionList, err error) { - obj, err := c.Fake. - Invokes(testing.NewListAction(extensionsResource, extensionsKind, c.ns, opts), &v4beta1.ExtensionList{}) - - if obj == nil { - return nil, err - } - - label, _, _ := testing.ExtractFromListOptions(opts) - if label == nil { - label = labels.Everything() - } - list := &v4beta1.ExtensionList{ListMeta: obj.(*v4beta1.ExtensionList).ListMeta} - for _, item := range obj.(*v4beta1.ExtensionList).Items { - if label.Matches(labels.Set(item.Labels)) { - list.Items = append(list.Items, item) - } - } - return list, err -} - -// Watch returns a watch.Interface that watches the requested extensions. -func (c *FakeExtensions) Watch(ctx context.Context, opts v1.ListOptions) (watch.Interface, error) { - return c.Fake. - InvokesWatch(testing.NewWatchAction(extensionsResource, c.ns, opts)) - -} - -// Create takes the representation of a extension and creates it. Returns the server's representation of the extension, and an error, if there is any. -func (c *FakeExtensions) Create(ctx context.Context, extension *v4beta1.Extension, opts v1.CreateOptions) (result *v4beta1.Extension, err error) { - obj, err := c.Fake. - Invokes(testing.NewCreateAction(extensionsResource, c.ns, extension), &v4beta1.Extension{}) - - if obj == nil { - return nil, err - } - return obj.(*v4beta1.Extension), err -} - -// Update takes the representation of a extension and updates it. Returns the server's representation of the extension, and an error, if there is any. -func (c *FakeExtensions) Update(ctx context.Context, extension *v4beta1.Extension, opts v1.UpdateOptions) (result *v4beta1.Extension, err error) { - obj, err := c.Fake. - Invokes(testing.NewUpdateAction(extensionsResource, c.ns, extension), &v4beta1.Extension{}) - - if obj == nil { - return nil, err - } - return obj.(*v4beta1.Extension), err -} - -// Delete takes name of the extension and deletes it. Returns an error if one occurs. -func (c *FakeExtensions) Delete(ctx context.Context, name string, opts v1.DeleteOptions) error { - _, err := c.Fake. - Invokes(testing.NewDeleteAction(extensionsResource, c.ns, name), &v4beta1.Extension{}) - - return err -} - -// DeleteCollection deletes a collection of objects. -func (c *FakeExtensions) DeleteCollection(ctx context.Context, opts v1.DeleteOptions, listOpts v1.ListOptions) error { - action := testing.NewDeleteCollectionAction(extensionsResource, c.ns, listOpts) - - _, err := c.Fake.Invokes(action, &v4beta1.ExtensionList{}) - return err -} - -// Patch applies the patch and returns the patched extension. -func (c *FakeExtensions) Patch(ctx context.Context, name string, pt types.PatchType, data []byte, opts v1.PatchOptions, subresources ...string) (result *v4beta1.Extension, err error) { - obj, err := c.Fake. - Invokes(testing.NewPatchSubresourceAction(extensionsResource, c.ns, name, pt, data, subresources...), &v4beta1.Extension{}) - - if obj == nil { - return nil, err - } - return obj.(*v4beta1.Extension), err -} diff --git a/pkg/client/clientset/versioned/typed/jenkins.io/v4beta1/fake/fake_gitservice.go b/pkg/client/clientset/versioned/typed/jenkins.io/v4beta1/fake/fake_gitservice.go deleted file mode 100644 index 41723b8..0000000 --- a/pkg/client/clientset/versioned/typed/jenkins.io/v4beta1/fake/fake_gitservice.go +++ /dev/null @@ -1,129 +0,0 @@ -/* -Copyright 2020 The Jenkins X 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 - -import ( - "context" - - v4beta1 "github.com/jenkins-x/jx-api/v4/pkg/apis/jenkins.io/v4beta1" - v1 "k8s.io/apimachinery/pkg/apis/meta/v1" - labels "k8s.io/apimachinery/pkg/labels" - schema "k8s.io/apimachinery/pkg/runtime/schema" - types "k8s.io/apimachinery/pkg/types" - watch "k8s.io/apimachinery/pkg/watch" - testing "k8s.io/client-go/testing" -) - -// FakeGitServices implements GitServiceInterface -type FakeGitServices struct { - Fake *FakeJenkinsV4beta1 - ns string -} - -var gitservicesResource = schema.GroupVersionResource{Group: "jenkins.io", Version: "v4beta1", Resource: "gitservices"} - -var gitservicesKind = schema.GroupVersionKind{Group: "jenkins.io", Version: "v4beta1", Kind: "GitService"} - -// Get takes name of the gitService, and returns the corresponding gitService object, and an error if there is any. -func (c *FakeGitServices) Get(ctx context.Context, name string, options v1.GetOptions) (result *v4beta1.GitService, err error) { - obj, err := c.Fake. - Invokes(testing.NewGetAction(gitservicesResource, c.ns, name), &v4beta1.GitService{}) - - if obj == nil { - return nil, err - } - return obj.(*v4beta1.GitService), err -} - -// List takes label and field selectors, and returns the list of GitServices that match those selectors. -func (c *FakeGitServices) List(ctx context.Context, opts v1.ListOptions) (result *v4beta1.GitServiceList, err error) { - obj, err := c.Fake. - Invokes(testing.NewListAction(gitservicesResource, gitservicesKind, c.ns, opts), &v4beta1.GitServiceList{}) - - if obj == nil { - return nil, err - } - - label, _, _ := testing.ExtractFromListOptions(opts) - if label == nil { - label = labels.Everything() - } - list := &v4beta1.GitServiceList{ListMeta: obj.(*v4beta1.GitServiceList).ListMeta} - for _, item := range obj.(*v4beta1.GitServiceList).Items { - if label.Matches(labels.Set(item.Labels)) { - list.Items = append(list.Items, item) - } - } - return list, err -} - -// Watch returns a watch.Interface that watches the requested gitServices. -func (c *FakeGitServices) Watch(ctx context.Context, opts v1.ListOptions) (watch.Interface, error) { - return c.Fake. - InvokesWatch(testing.NewWatchAction(gitservicesResource, c.ns, opts)) - -} - -// Create takes the representation of a gitService and creates it. Returns the server's representation of the gitService, and an error, if there is any. -func (c *FakeGitServices) Create(ctx context.Context, gitService *v4beta1.GitService, opts v1.CreateOptions) (result *v4beta1.GitService, err error) { - obj, err := c.Fake. - Invokes(testing.NewCreateAction(gitservicesResource, c.ns, gitService), &v4beta1.GitService{}) - - if obj == nil { - return nil, err - } - return obj.(*v4beta1.GitService), err -} - -// Update takes the representation of a gitService and updates it. Returns the server's representation of the gitService, and an error, if there is any. -func (c *FakeGitServices) Update(ctx context.Context, gitService *v4beta1.GitService, opts v1.UpdateOptions) (result *v4beta1.GitService, err error) { - obj, err := c.Fake. - Invokes(testing.NewUpdateAction(gitservicesResource, c.ns, gitService), &v4beta1.GitService{}) - - if obj == nil { - return nil, err - } - return obj.(*v4beta1.GitService), err -} - -// Delete takes name of the gitService and deletes it. Returns an error if one occurs. -func (c *FakeGitServices) Delete(ctx context.Context, name string, opts v1.DeleteOptions) error { - _, err := c.Fake. - Invokes(testing.NewDeleteAction(gitservicesResource, c.ns, name), &v4beta1.GitService{}) - - return err -} - -// DeleteCollection deletes a collection of objects. -func (c *FakeGitServices) DeleteCollection(ctx context.Context, opts v1.DeleteOptions, listOpts v1.ListOptions) error { - action := testing.NewDeleteCollectionAction(gitservicesResource, c.ns, listOpts) - - _, err := c.Fake.Invokes(action, &v4beta1.GitServiceList{}) - return err -} - -// Patch applies the patch and returns the patched gitService. -func (c *FakeGitServices) Patch(ctx context.Context, name string, pt types.PatchType, data []byte, opts v1.PatchOptions, subresources ...string) (result *v4beta1.GitService, err error) { - obj, err := c.Fake. - Invokes(testing.NewPatchSubresourceAction(gitservicesResource, c.ns, name, pt, data, subresources...), &v4beta1.GitService{}) - - if obj == nil { - return nil, err - } - return obj.(*v4beta1.GitService), err -} diff --git a/pkg/client/clientset/versioned/typed/jenkins.io/v4beta1/fake/fake_jenkins.io_client.go b/pkg/client/clientset/versioned/typed/jenkins.io/v4beta1/fake/fake_jenkins.io_client.go deleted file mode 100644 index dc15333..0000000 --- a/pkg/client/clientset/versioned/typed/jenkins.io/v4beta1/fake/fake_jenkins.io_client.go +++ /dev/null @@ -1,91 +0,0 @@ -/* -Copyright 2020 The Jenkins X 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 - -import ( - v4beta1 "github.com/jenkins-x/jx-api/v4/pkg/client/clientset/versioned/typed/jenkins.io/v4beta1" - rest "k8s.io/client-go/rest" - testing "k8s.io/client-go/testing" -) - -type FakeJenkinsV4beta1 struct { - *testing.Fake -} - -func (c *FakeJenkinsV4beta1) Apps(namespace string) v4beta1.AppInterface { - return &FakeApps{c, namespace} -} - -func (c *FakeJenkinsV4beta1) BuildPacks(namespace string) v4beta1.BuildPackInterface { - return &FakeBuildPacks{c, namespace} -} - -func (c *FakeJenkinsV4beta1) CommitStatuses(namespace string) v4beta1.CommitStatusInterface { - return &FakeCommitStatuses{c, namespace} -} - -func (c *FakeJenkinsV4beta1) Environments(namespace string) v4beta1.EnvironmentInterface { - return &FakeEnvironments{c, namespace} -} - -func (c *FakeJenkinsV4beta1) EnvironmentRoleBindings(namespace string) v4beta1.EnvironmentRoleBindingInterface { - return &FakeEnvironmentRoleBindings{c, namespace} -} - -func (c *FakeJenkinsV4beta1) Extensions(namespace string) v4beta1.ExtensionInterface { - return &FakeExtensions{c, namespace} -} - -func (c *FakeJenkinsV4beta1) GitServices(namespace string) v4beta1.GitServiceInterface { - return &FakeGitServices{c, namespace} -} - -func (c *FakeJenkinsV4beta1) PipelineActivities(namespace string) v4beta1.PipelineActivityInterface { - return &FakePipelineActivities{c, namespace} -} - -func (c *FakeJenkinsV4beta1) Plugins(namespace string) v4beta1.PluginInterface { - return &FakePlugins{c, namespace} -} - -func (c *FakeJenkinsV4beta1) Releases(namespace string) v4beta1.ReleaseInterface { - return &FakeReleases{c, namespace} -} - -func (c *FakeJenkinsV4beta1) SourceRepositories(namespace string) v4beta1.SourceRepositoryInterface { - return &FakeSourceRepositories{c, namespace} -} - -func (c *FakeJenkinsV4beta1) SourceRepositoryGroups(namespace string) v4beta1.SourceRepositoryGroupInterface { - return &FakeSourceRepositoryGroups{c, namespace} -} - -func (c *FakeJenkinsV4beta1) Teams(namespace string) v4beta1.TeamInterface { - return &FakeTeams{c, namespace} -} - -func (c *FakeJenkinsV4beta1) Users(namespace string) v4beta1.UserInterface { - return &FakeUsers{c, namespace} -} - -// RESTClient returns a RESTClient that is used to communicate -// with API server by this client implementation. -func (c *FakeJenkinsV4beta1) RESTClient() rest.Interface { - var ret *rest.RESTClient - return ret -} diff --git a/pkg/client/clientset/versioned/typed/jenkins.io/v4beta1/fake/fake_sourcerepositorygroup.go b/pkg/client/clientset/versioned/typed/jenkins.io/v4beta1/fake/fake_sourcerepositorygroup.go deleted file mode 100644 index 1d724bb..0000000 --- a/pkg/client/clientset/versioned/typed/jenkins.io/v4beta1/fake/fake_sourcerepositorygroup.go +++ /dev/null @@ -1,129 +0,0 @@ -/* -Copyright 2020 The Jenkins X 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 - -import ( - "context" - - v4beta1 "github.com/jenkins-x/jx-api/v4/pkg/apis/jenkins.io/v4beta1" - v1 "k8s.io/apimachinery/pkg/apis/meta/v1" - labels "k8s.io/apimachinery/pkg/labels" - schema "k8s.io/apimachinery/pkg/runtime/schema" - types "k8s.io/apimachinery/pkg/types" - watch "k8s.io/apimachinery/pkg/watch" - testing "k8s.io/client-go/testing" -) - -// FakeSourceRepositoryGroups implements SourceRepositoryGroupInterface -type FakeSourceRepositoryGroups struct { - Fake *FakeJenkinsV4beta1 - ns string -} - -var sourcerepositorygroupsResource = schema.GroupVersionResource{Group: "jenkins.io", Version: "v4beta1", Resource: "sourcerepositorygroups"} - -var sourcerepositorygroupsKind = schema.GroupVersionKind{Group: "jenkins.io", Version: "v4beta1", Kind: "SourceRepositoryGroup"} - -// Get takes name of the sourceRepositoryGroup, and returns the corresponding sourceRepositoryGroup object, and an error if there is any. -func (c *FakeSourceRepositoryGroups) Get(ctx context.Context, name string, options v1.GetOptions) (result *v4beta1.SourceRepositoryGroup, err error) { - obj, err := c.Fake. - Invokes(testing.NewGetAction(sourcerepositorygroupsResource, c.ns, name), &v4beta1.SourceRepositoryGroup{}) - - if obj == nil { - return nil, err - } - return obj.(*v4beta1.SourceRepositoryGroup), err -} - -// List takes label and field selectors, and returns the list of SourceRepositoryGroups that match those selectors. -func (c *FakeSourceRepositoryGroups) List(ctx context.Context, opts v1.ListOptions) (result *v4beta1.SourceRepositoryGroupList, err error) { - obj, err := c.Fake. - Invokes(testing.NewListAction(sourcerepositorygroupsResource, sourcerepositorygroupsKind, c.ns, opts), &v4beta1.SourceRepositoryGroupList{}) - - if obj == nil { - return nil, err - } - - label, _, _ := testing.ExtractFromListOptions(opts) - if label == nil { - label = labels.Everything() - } - list := &v4beta1.SourceRepositoryGroupList{ListMeta: obj.(*v4beta1.SourceRepositoryGroupList).ListMeta} - for _, item := range obj.(*v4beta1.SourceRepositoryGroupList).Items { - if label.Matches(labels.Set(item.Labels)) { - list.Items = append(list.Items, item) - } - } - return list, err -} - -// Watch returns a watch.Interface that watches the requested sourceRepositoryGroups. -func (c *FakeSourceRepositoryGroups) Watch(ctx context.Context, opts v1.ListOptions) (watch.Interface, error) { - return c.Fake. - InvokesWatch(testing.NewWatchAction(sourcerepositorygroupsResource, c.ns, opts)) - -} - -// Create takes the representation of a sourceRepositoryGroup and creates it. Returns the server's representation of the sourceRepositoryGroup, and an error, if there is any. -func (c *FakeSourceRepositoryGroups) Create(ctx context.Context, sourceRepositoryGroup *v4beta1.SourceRepositoryGroup, opts v1.CreateOptions) (result *v4beta1.SourceRepositoryGroup, err error) { - obj, err := c.Fake. - Invokes(testing.NewCreateAction(sourcerepositorygroupsResource, c.ns, sourceRepositoryGroup), &v4beta1.SourceRepositoryGroup{}) - - if obj == nil { - return nil, err - } - return obj.(*v4beta1.SourceRepositoryGroup), err -} - -// Update takes the representation of a sourceRepositoryGroup and updates it. Returns the server's representation of the sourceRepositoryGroup, and an error, if there is any. -func (c *FakeSourceRepositoryGroups) Update(ctx context.Context, sourceRepositoryGroup *v4beta1.SourceRepositoryGroup, opts v1.UpdateOptions) (result *v4beta1.SourceRepositoryGroup, err error) { - obj, err := c.Fake. - Invokes(testing.NewUpdateAction(sourcerepositorygroupsResource, c.ns, sourceRepositoryGroup), &v4beta1.SourceRepositoryGroup{}) - - if obj == nil { - return nil, err - } - return obj.(*v4beta1.SourceRepositoryGroup), err -} - -// Delete takes name of the sourceRepositoryGroup and deletes it. Returns an error if one occurs. -func (c *FakeSourceRepositoryGroups) Delete(ctx context.Context, name string, opts v1.DeleteOptions) error { - _, err := c.Fake. - Invokes(testing.NewDeleteAction(sourcerepositorygroupsResource, c.ns, name), &v4beta1.SourceRepositoryGroup{}) - - return err -} - -// DeleteCollection deletes a collection of objects. -func (c *FakeSourceRepositoryGroups) DeleteCollection(ctx context.Context, opts v1.DeleteOptions, listOpts v1.ListOptions) error { - action := testing.NewDeleteCollectionAction(sourcerepositorygroupsResource, c.ns, listOpts) - - _, err := c.Fake.Invokes(action, &v4beta1.SourceRepositoryGroupList{}) - return err -} - -// Patch applies the patch and returns the patched sourceRepositoryGroup. -func (c *FakeSourceRepositoryGroups) Patch(ctx context.Context, name string, pt types.PatchType, data []byte, opts v1.PatchOptions, subresources ...string) (result *v4beta1.SourceRepositoryGroup, err error) { - obj, err := c.Fake. - Invokes(testing.NewPatchSubresourceAction(sourcerepositorygroupsResource, c.ns, name, pt, data, subresources...), &v4beta1.SourceRepositoryGroup{}) - - if obj == nil { - return nil, err - } - return obj.(*v4beta1.SourceRepositoryGroup), err -} diff --git a/pkg/client/clientset/versioned/typed/jenkins.io/v4beta1/fake/fake_team.go b/pkg/client/clientset/versioned/typed/jenkins.io/v4beta1/fake/fake_team.go deleted file mode 100644 index ce02001..0000000 --- a/pkg/client/clientset/versioned/typed/jenkins.io/v4beta1/fake/fake_team.go +++ /dev/null @@ -1,129 +0,0 @@ -/* -Copyright 2020 The Jenkins X 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 - -import ( - "context" - - v4beta1 "github.com/jenkins-x/jx-api/v4/pkg/apis/jenkins.io/v4beta1" - v1 "k8s.io/apimachinery/pkg/apis/meta/v1" - labels "k8s.io/apimachinery/pkg/labels" - schema "k8s.io/apimachinery/pkg/runtime/schema" - types "k8s.io/apimachinery/pkg/types" - watch "k8s.io/apimachinery/pkg/watch" - testing "k8s.io/client-go/testing" -) - -// FakeTeams implements TeamInterface -type FakeTeams struct { - Fake *FakeJenkinsV4beta1 - ns string -} - -var teamsResource = schema.GroupVersionResource{Group: "jenkins.io", Version: "v4beta1", Resource: "teams"} - -var teamsKind = schema.GroupVersionKind{Group: "jenkins.io", Version: "v4beta1", Kind: "Team"} - -// Get takes name of the team, and returns the corresponding team object, and an error if there is any. -func (c *FakeTeams) Get(ctx context.Context, name string, options v1.GetOptions) (result *v4beta1.Team, err error) { - obj, err := c.Fake. - Invokes(testing.NewGetAction(teamsResource, c.ns, name), &v4beta1.Team{}) - - if obj == nil { - return nil, err - } - return obj.(*v4beta1.Team), err -} - -// List takes label and field selectors, and returns the list of Teams that match those selectors. -func (c *FakeTeams) List(ctx context.Context, opts v1.ListOptions) (result *v4beta1.TeamList, err error) { - obj, err := c.Fake. - Invokes(testing.NewListAction(teamsResource, teamsKind, c.ns, opts), &v4beta1.TeamList{}) - - if obj == nil { - return nil, err - } - - label, _, _ := testing.ExtractFromListOptions(opts) - if label == nil { - label = labels.Everything() - } - list := &v4beta1.TeamList{ListMeta: obj.(*v4beta1.TeamList).ListMeta} - for _, item := range obj.(*v4beta1.TeamList).Items { - if label.Matches(labels.Set(item.Labels)) { - list.Items = append(list.Items, item) - } - } - return list, err -} - -// Watch returns a watch.Interface that watches the requested teams. -func (c *FakeTeams) Watch(ctx context.Context, opts v1.ListOptions) (watch.Interface, error) { - return c.Fake. - InvokesWatch(testing.NewWatchAction(teamsResource, c.ns, opts)) - -} - -// Create takes the representation of a team and creates it. Returns the server's representation of the team, and an error, if there is any. -func (c *FakeTeams) Create(ctx context.Context, team *v4beta1.Team, opts v1.CreateOptions) (result *v4beta1.Team, err error) { - obj, err := c.Fake. - Invokes(testing.NewCreateAction(teamsResource, c.ns, team), &v4beta1.Team{}) - - if obj == nil { - return nil, err - } - return obj.(*v4beta1.Team), err -} - -// Update takes the representation of a team and updates it. Returns the server's representation of the team, and an error, if there is any. -func (c *FakeTeams) Update(ctx context.Context, team *v4beta1.Team, opts v1.UpdateOptions) (result *v4beta1.Team, err error) { - obj, err := c.Fake. - Invokes(testing.NewUpdateAction(teamsResource, c.ns, team), &v4beta1.Team{}) - - if obj == nil { - return nil, err - } - return obj.(*v4beta1.Team), err -} - -// Delete takes name of the team and deletes it. Returns an error if one occurs. -func (c *FakeTeams) Delete(ctx context.Context, name string, opts v1.DeleteOptions) error { - _, err := c.Fake. - Invokes(testing.NewDeleteAction(teamsResource, c.ns, name), &v4beta1.Team{}) - - return err -} - -// DeleteCollection deletes a collection of objects. -func (c *FakeTeams) DeleteCollection(ctx context.Context, opts v1.DeleteOptions, listOpts v1.ListOptions) error { - action := testing.NewDeleteCollectionAction(teamsResource, c.ns, listOpts) - - _, err := c.Fake.Invokes(action, &v4beta1.TeamList{}) - return err -} - -// Patch applies the patch and returns the patched team. -func (c *FakeTeams) Patch(ctx context.Context, name string, pt types.PatchType, data []byte, opts v1.PatchOptions, subresources ...string) (result *v4beta1.Team, err error) { - obj, err := c.Fake. - Invokes(testing.NewPatchSubresourceAction(teamsResource, c.ns, name, pt, data, subresources...), &v4beta1.Team{}) - - if obj == nil { - return nil, err - } - return obj.(*v4beta1.Team), err -} diff --git a/pkg/client/clientset/versioned/typed/jenkins.io/v4beta1/fake/fake_user.go b/pkg/client/clientset/versioned/typed/jenkins.io/v4beta1/fake/fake_user.go deleted file mode 100644 index 0b898c0..0000000 --- a/pkg/client/clientset/versioned/typed/jenkins.io/v4beta1/fake/fake_user.go +++ /dev/null @@ -1,129 +0,0 @@ -/* -Copyright 2020 The Jenkins X 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 - -import ( - "context" - - v4beta1 "github.com/jenkins-x/jx-api/v4/pkg/apis/jenkins.io/v4beta1" - v1 "k8s.io/apimachinery/pkg/apis/meta/v1" - labels "k8s.io/apimachinery/pkg/labels" - schema "k8s.io/apimachinery/pkg/runtime/schema" - types "k8s.io/apimachinery/pkg/types" - watch "k8s.io/apimachinery/pkg/watch" - testing "k8s.io/client-go/testing" -) - -// FakeUsers implements UserInterface -type FakeUsers struct { - Fake *FakeJenkinsV4beta1 - ns string -} - -var usersResource = schema.GroupVersionResource{Group: "jenkins.io", Version: "v4beta1", Resource: "users"} - -var usersKind = schema.GroupVersionKind{Group: "jenkins.io", Version: "v4beta1", Kind: "User"} - -// Get takes name of the user, and returns the corresponding user object, and an error if there is any. -func (c *FakeUsers) Get(ctx context.Context, name string, options v1.GetOptions) (result *v4beta1.User, err error) { - obj, err := c.Fake. - Invokes(testing.NewGetAction(usersResource, c.ns, name), &v4beta1.User{}) - - if obj == nil { - return nil, err - } - return obj.(*v4beta1.User), err -} - -// List takes label and field selectors, and returns the list of Users that match those selectors. -func (c *FakeUsers) List(ctx context.Context, opts v1.ListOptions) (result *v4beta1.UserList, err error) { - obj, err := c.Fake. - Invokes(testing.NewListAction(usersResource, usersKind, c.ns, opts), &v4beta1.UserList{}) - - if obj == nil { - return nil, err - } - - label, _, _ := testing.ExtractFromListOptions(opts) - if label == nil { - label = labels.Everything() - } - list := &v4beta1.UserList{ListMeta: obj.(*v4beta1.UserList).ListMeta} - for _, item := range obj.(*v4beta1.UserList).Items { - if label.Matches(labels.Set(item.Labels)) { - list.Items = append(list.Items, item) - } - } - return list, err -} - -// Watch returns a watch.Interface that watches the requested users. -func (c *FakeUsers) Watch(ctx context.Context, opts v1.ListOptions) (watch.Interface, error) { - return c.Fake. - InvokesWatch(testing.NewWatchAction(usersResource, c.ns, opts)) - -} - -// Create takes the representation of a user and creates it. Returns the server's representation of the user, and an error, if there is any. -func (c *FakeUsers) Create(ctx context.Context, user *v4beta1.User, opts v1.CreateOptions) (result *v4beta1.User, err error) { - obj, err := c.Fake. - Invokes(testing.NewCreateAction(usersResource, c.ns, user), &v4beta1.User{}) - - if obj == nil { - return nil, err - } - return obj.(*v4beta1.User), err -} - -// Update takes the representation of a user and updates it. Returns the server's representation of the user, and an error, if there is any. -func (c *FakeUsers) Update(ctx context.Context, user *v4beta1.User, opts v1.UpdateOptions) (result *v4beta1.User, err error) { - obj, err := c.Fake. - Invokes(testing.NewUpdateAction(usersResource, c.ns, user), &v4beta1.User{}) - - if obj == nil { - return nil, err - } - return obj.(*v4beta1.User), err -} - -// Delete takes name of the user and deletes it. Returns an error if one occurs. -func (c *FakeUsers) Delete(ctx context.Context, name string, opts v1.DeleteOptions) error { - _, err := c.Fake. - Invokes(testing.NewDeleteAction(usersResource, c.ns, name), &v4beta1.User{}) - - return err -} - -// DeleteCollection deletes a collection of objects. -func (c *FakeUsers) DeleteCollection(ctx context.Context, opts v1.DeleteOptions, listOpts v1.ListOptions) error { - action := testing.NewDeleteCollectionAction(usersResource, c.ns, listOpts) - - _, err := c.Fake.Invokes(action, &v4beta1.UserList{}) - return err -} - -// Patch applies the patch and returns the patched user. -func (c *FakeUsers) Patch(ctx context.Context, name string, pt types.PatchType, data []byte, opts v1.PatchOptions, subresources ...string) (result *v4beta1.User, err error) { - obj, err := c.Fake. - Invokes(testing.NewPatchSubresourceAction(usersResource, c.ns, name, pt, data, subresources...), &v4beta1.User{}) - - if obj == nil { - return nil, err - } - return obj.(*v4beta1.User), err -} diff --git a/pkg/client/clientset/versioned/typed/jenkins.io/v4beta1/gitservice.go b/pkg/client/clientset/versioned/typed/jenkins.io/v4beta1/gitservice.go deleted file mode 100644 index fbce1cf..0000000 --- a/pkg/client/clientset/versioned/typed/jenkins.io/v4beta1/gitservice.go +++ /dev/null @@ -1,177 +0,0 @@ -/* -Copyright 2020 The Jenkins X 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 v4beta1 - -import ( - "context" - "time" - - v4beta1 "github.com/jenkins-x/jx-api/v4/pkg/apis/jenkins.io/v4beta1" - scheme "github.com/jenkins-x/jx-api/v4/pkg/client/clientset/versioned/scheme" - v1 "k8s.io/apimachinery/pkg/apis/meta/v1" - types "k8s.io/apimachinery/pkg/types" - watch "k8s.io/apimachinery/pkg/watch" - rest "k8s.io/client-go/rest" -) - -// GitServicesGetter has a method to return a GitServiceInterface. -// A group's client should implement this interface. -type GitServicesGetter interface { - GitServices(namespace string) GitServiceInterface -} - -// GitServiceInterface has methods to work with GitService resources. -type GitServiceInterface interface { - Create(ctx context.Context, gitService *v4beta1.GitService, opts v1.CreateOptions) (*v4beta1.GitService, error) - Update(ctx context.Context, gitService *v4beta1.GitService, opts v1.UpdateOptions) (*v4beta1.GitService, error) - Delete(ctx context.Context, name string, opts v1.DeleteOptions) error - DeleteCollection(ctx context.Context, opts v1.DeleteOptions, listOpts v1.ListOptions) error - Get(ctx context.Context, name string, opts v1.GetOptions) (*v4beta1.GitService, error) - List(ctx context.Context, opts v1.ListOptions) (*v4beta1.GitServiceList, error) - Watch(ctx context.Context, opts v1.ListOptions) (watch.Interface, error) - Patch(ctx context.Context, name string, pt types.PatchType, data []byte, opts v1.PatchOptions, subresources ...string) (result *v4beta1.GitService, err error) - GitServiceExpansion -} - -// gitServices implements GitServiceInterface -type gitServices struct { - client rest.Interface - ns string -} - -// newGitServices returns a GitServices -func newGitServices(c *JenkinsV4beta1Client, namespace string) *gitServices { - return &gitServices{ - client: c.RESTClient(), - ns: namespace, - } -} - -// Get takes name of the gitService, and returns the corresponding gitService object, and an error if there is any. -func (c *gitServices) Get(ctx context.Context, name string, options v1.GetOptions) (result *v4beta1.GitService, err error) { - result = &v4beta1.GitService{} - err = c.client.Get(). - Namespace(c.ns). - Resource("gitservices"). - Name(name). - VersionedParams(&options, scheme.ParameterCodec). - Do(ctx). - Into(result) - return -} - -// List takes label and field selectors, and returns the list of GitServices that match those selectors. -func (c *gitServices) List(ctx context.Context, opts v1.ListOptions) (result *v4beta1.GitServiceList, err error) { - var timeout time.Duration - if opts.TimeoutSeconds != nil { - timeout = time.Duration(*opts.TimeoutSeconds) * time.Second - } - result = &v4beta1.GitServiceList{} - err = c.client.Get(). - Namespace(c.ns). - Resource("gitservices"). - VersionedParams(&opts, scheme.ParameterCodec). - Timeout(timeout). - Do(ctx). - Into(result) - return -} - -// Watch returns a watch.Interface that watches the requested gitServices. -func (c *gitServices) Watch(ctx context.Context, opts v1.ListOptions) (watch.Interface, error) { - var timeout time.Duration - if opts.TimeoutSeconds != nil { - timeout = time.Duration(*opts.TimeoutSeconds) * time.Second - } - opts.Watch = true - return c.client.Get(). - Namespace(c.ns). - Resource("gitservices"). - VersionedParams(&opts, scheme.ParameterCodec). - Timeout(timeout). - Watch(ctx) -} - -// Create takes the representation of a gitService and creates it. Returns the server's representation of the gitService, and an error, if there is any. -func (c *gitServices) Create(ctx context.Context, gitService *v4beta1.GitService, opts v1.CreateOptions) (result *v4beta1.GitService, err error) { - result = &v4beta1.GitService{} - err = c.client.Post(). - Namespace(c.ns). - Resource("gitservices"). - VersionedParams(&opts, scheme.ParameterCodec). - Body(gitService). - Do(ctx). - Into(result) - return -} - -// Update takes the representation of a gitService and updates it. Returns the server's representation of the gitService, and an error, if there is any. -func (c *gitServices) Update(ctx context.Context, gitService *v4beta1.GitService, opts v1.UpdateOptions) (result *v4beta1.GitService, err error) { - result = &v4beta1.GitService{} - err = c.client.Put(). - Namespace(c.ns). - Resource("gitservices"). - Name(gitService.Name). - VersionedParams(&opts, scheme.ParameterCodec). - Body(gitService). - Do(ctx). - Into(result) - return -} - -// Delete takes name of the gitService and deletes it. Returns an error if one occurs. -func (c *gitServices) Delete(ctx context.Context, name string, opts v1.DeleteOptions) error { - return c.client.Delete(). - Namespace(c.ns). - Resource("gitservices"). - Name(name). - Body(&opts). - Do(ctx). - Error() -} - -// DeleteCollection deletes a collection of objects. -func (c *gitServices) DeleteCollection(ctx context.Context, opts v1.DeleteOptions, listOpts v1.ListOptions) error { - var timeout time.Duration - if listOpts.TimeoutSeconds != nil { - timeout = time.Duration(*listOpts.TimeoutSeconds) * time.Second - } - return c.client.Delete(). - Namespace(c.ns). - Resource("gitservices"). - VersionedParams(&listOpts, scheme.ParameterCodec). - Timeout(timeout). - Body(&opts). - Do(ctx). - Error() -} - -// Patch applies the patch and returns the patched gitService. -func (c *gitServices) Patch(ctx context.Context, name string, pt types.PatchType, data []byte, opts v1.PatchOptions, subresources ...string) (result *v4beta1.GitService, err error) { - result = &v4beta1.GitService{} - err = c.client.Patch(pt). - Namespace(c.ns). - Resource("gitservices"). - Name(name). - SubResource(subresources...). - VersionedParams(&opts, scheme.ParameterCodec). - Body(data). - Do(ctx). - Into(result) - return -} diff --git a/pkg/client/clientset/versioned/typed/jenkins.io/v4beta1/jenkins.io_client.go b/pkg/client/clientset/versioned/typed/jenkins.io/v4beta1/jenkins.io_client.go deleted file mode 100644 index 5c1540b..0000000 --- a/pkg/client/clientset/versioned/typed/jenkins.io/v4beta1/jenkins.io_client.go +++ /dev/null @@ -1,153 +0,0 @@ -/* -Copyright 2020 The Jenkins X 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 v4beta1 - -import ( - v4beta1 "github.com/jenkins-x/jx-api/v4/pkg/apis/jenkins.io/v4beta1" - "github.com/jenkins-x/jx-api/v4/pkg/client/clientset/versioned/scheme" - rest "k8s.io/client-go/rest" -) - -type JenkinsV4beta1Interface interface { - RESTClient() rest.Interface - AppsGetter - BuildPacksGetter - CommitStatusesGetter - EnvironmentsGetter - EnvironmentRoleBindingsGetter - ExtensionsGetter - GitServicesGetter - PipelineActivitiesGetter - PluginsGetter - ReleasesGetter - SourceRepositoriesGetter - SourceRepositoryGroupsGetter - TeamsGetter - UsersGetter -} - -// JenkinsV4beta1Client is used to interact with features provided by the jenkins.io group. -type JenkinsV4beta1Client struct { - restClient rest.Interface -} - -func (c *JenkinsV4beta1Client) Apps(namespace string) AppInterface { - return newApps(c, namespace) -} - -func (c *JenkinsV4beta1Client) BuildPacks(namespace string) BuildPackInterface { - return newBuildPacks(c, namespace) -} - -func (c *JenkinsV4beta1Client) CommitStatuses(namespace string) CommitStatusInterface { - return newCommitStatuses(c, namespace) -} - -func (c *JenkinsV4beta1Client) Environments(namespace string) EnvironmentInterface { - return newEnvironments(c, namespace) -} - -func (c *JenkinsV4beta1Client) EnvironmentRoleBindings(namespace string) EnvironmentRoleBindingInterface { - return newEnvironmentRoleBindings(c, namespace) -} - -func (c *JenkinsV4beta1Client) Extensions(namespace string) ExtensionInterface { - return newExtensions(c, namespace) -} - -func (c *JenkinsV4beta1Client) GitServices(namespace string) GitServiceInterface { - return newGitServices(c, namespace) -} - -func (c *JenkinsV4beta1Client) PipelineActivities(namespace string) PipelineActivityInterface { - return newPipelineActivities(c, namespace) -} - -func (c *JenkinsV4beta1Client) Plugins(namespace string) PluginInterface { - return newPlugins(c, namespace) -} - -func (c *JenkinsV4beta1Client) Releases(namespace string) ReleaseInterface { - return newReleases(c, namespace) -} - -func (c *JenkinsV4beta1Client) SourceRepositories(namespace string) SourceRepositoryInterface { - return newSourceRepositories(c, namespace) -} - -func (c *JenkinsV4beta1Client) SourceRepositoryGroups(namespace string) SourceRepositoryGroupInterface { - return newSourceRepositoryGroups(c, namespace) -} - -func (c *JenkinsV4beta1Client) Teams(namespace string) TeamInterface { - return newTeams(c, namespace) -} - -func (c *JenkinsV4beta1Client) Users(namespace string) UserInterface { - return newUsers(c, namespace) -} - -// NewForConfig creates a new JenkinsV4beta1Client for the given config. -func NewForConfig(c *rest.Config) (*JenkinsV4beta1Client, error) { - config := *c - if err := setConfigDefaults(&config); err != nil { - return nil, err - } - client, err := rest.RESTClientFor(&config) - if err != nil { - return nil, err - } - return &JenkinsV4beta1Client{client}, nil -} - -// NewForConfigOrDie creates a new JenkinsV4beta1Client for the given config and -// panics if there is an error in the config. -func NewForConfigOrDie(c *rest.Config) *JenkinsV4beta1Client { - client, err := NewForConfig(c) - if err != nil { - panic(err) - } - return client -} - -// New creates a new JenkinsV4beta1Client for the given RESTClient. -func New(c rest.Interface) *JenkinsV4beta1Client { - return &JenkinsV4beta1Client{c} -} - -func setConfigDefaults(config *rest.Config) error { - gv := v4beta1.SchemeGroupVersion - config.GroupVersion = &gv - config.APIPath = "/apis" - config.NegotiatedSerializer = scheme.Codecs.WithoutConversion() - - if config.UserAgent == "" { - config.UserAgent = rest.DefaultKubernetesUserAgent() - } - - return nil -} - -// RESTClient returns a RESTClient that is used to communicate -// with API server by this client implementation. -func (c *JenkinsV4beta1Client) RESTClient() rest.Interface { - if c == nil { - return nil - } - return c.restClient -} diff --git a/pkg/client/clientset/versioned/typed/jenkins.io/v4beta1/sourcerepositorygroup.go b/pkg/client/clientset/versioned/typed/jenkins.io/v4beta1/sourcerepositorygroup.go deleted file mode 100644 index 0f46f7c..0000000 --- a/pkg/client/clientset/versioned/typed/jenkins.io/v4beta1/sourcerepositorygroup.go +++ /dev/null @@ -1,177 +0,0 @@ -/* -Copyright 2020 The Jenkins X 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 v4beta1 - -import ( - "context" - "time" - - v4beta1 "github.com/jenkins-x/jx-api/v4/pkg/apis/jenkins.io/v4beta1" - scheme "github.com/jenkins-x/jx-api/v4/pkg/client/clientset/versioned/scheme" - v1 "k8s.io/apimachinery/pkg/apis/meta/v1" - types "k8s.io/apimachinery/pkg/types" - watch "k8s.io/apimachinery/pkg/watch" - rest "k8s.io/client-go/rest" -) - -// SourceRepositoryGroupsGetter has a method to return a SourceRepositoryGroupInterface. -// A group's client should implement this interface. -type SourceRepositoryGroupsGetter interface { - SourceRepositoryGroups(namespace string) SourceRepositoryGroupInterface -} - -// SourceRepositoryGroupInterface has methods to work with SourceRepositoryGroup resources. -type SourceRepositoryGroupInterface interface { - Create(ctx context.Context, sourceRepositoryGroup *v4beta1.SourceRepositoryGroup, opts v1.CreateOptions) (*v4beta1.SourceRepositoryGroup, error) - Update(ctx context.Context, sourceRepositoryGroup *v4beta1.SourceRepositoryGroup, opts v1.UpdateOptions) (*v4beta1.SourceRepositoryGroup, error) - Delete(ctx context.Context, name string, opts v1.DeleteOptions) error - DeleteCollection(ctx context.Context, opts v1.DeleteOptions, listOpts v1.ListOptions) error - Get(ctx context.Context, name string, opts v1.GetOptions) (*v4beta1.SourceRepositoryGroup, error) - List(ctx context.Context, opts v1.ListOptions) (*v4beta1.SourceRepositoryGroupList, error) - Watch(ctx context.Context, opts v1.ListOptions) (watch.Interface, error) - Patch(ctx context.Context, name string, pt types.PatchType, data []byte, opts v1.PatchOptions, subresources ...string) (result *v4beta1.SourceRepositoryGroup, err error) - SourceRepositoryGroupExpansion -} - -// sourceRepositoryGroups implements SourceRepositoryGroupInterface -type sourceRepositoryGroups struct { - client rest.Interface - ns string -} - -// newSourceRepositoryGroups returns a SourceRepositoryGroups -func newSourceRepositoryGroups(c *JenkinsV4beta1Client, namespace string) *sourceRepositoryGroups { - return &sourceRepositoryGroups{ - client: c.RESTClient(), - ns: namespace, - } -} - -// Get takes name of the sourceRepositoryGroup, and returns the corresponding sourceRepositoryGroup object, and an error if there is any. -func (c *sourceRepositoryGroups) Get(ctx context.Context, name string, options v1.GetOptions) (result *v4beta1.SourceRepositoryGroup, err error) { - result = &v4beta1.SourceRepositoryGroup{} - err = c.client.Get(). - Namespace(c.ns). - Resource("sourcerepositorygroups"). - Name(name). - VersionedParams(&options, scheme.ParameterCodec). - Do(ctx). - Into(result) - return -} - -// List takes label and field selectors, and returns the list of SourceRepositoryGroups that match those selectors. -func (c *sourceRepositoryGroups) List(ctx context.Context, opts v1.ListOptions) (result *v4beta1.SourceRepositoryGroupList, err error) { - var timeout time.Duration - if opts.TimeoutSeconds != nil { - timeout = time.Duration(*opts.TimeoutSeconds) * time.Second - } - result = &v4beta1.SourceRepositoryGroupList{} - err = c.client.Get(). - Namespace(c.ns). - Resource("sourcerepositorygroups"). - VersionedParams(&opts, scheme.ParameterCodec). - Timeout(timeout). - Do(ctx). - Into(result) - return -} - -// Watch returns a watch.Interface that watches the requested sourceRepositoryGroups. -func (c *sourceRepositoryGroups) Watch(ctx context.Context, opts v1.ListOptions) (watch.Interface, error) { - var timeout time.Duration - if opts.TimeoutSeconds != nil { - timeout = time.Duration(*opts.TimeoutSeconds) * time.Second - } - opts.Watch = true - return c.client.Get(). - Namespace(c.ns). - Resource("sourcerepositorygroups"). - VersionedParams(&opts, scheme.ParameterCodec). - Timeout(timeout). - Watch(ctx) -} - -// Create takes the representation of a sourceRepositoryGroup and creates it. Returns the server's representation of the sourceRepositoryGroup, and an error, if there is any. -func (c *sourceRepositoryGroups) Create(ctx context.Context, sourceRepositoryGroup *v4beta1.SourceRepositoryGroup, opts v1.CreateOptions) (result *v4beta1.SourceRepositoryGroup, err error) { - result = &v4beta1.SourceRepositoryGroup{} - err = c.client.Post(). - Namespace(c.ns). - Resource("sourcerepositorygroups"). - VersionedParams(&opts, scheme.ParameterCodec). - Body(sourceRepositoryGroup). - Do(ctx). - Into(result) - return -} - -// Update takes the representation of a sourceRepositoryGroup and updates it. Returns the server's representation of the sourceRepositoryGroup, and an error, if there is any. -func (c *sourceRepositoryGroups) Update(ctx context.Context, sourceRepositoryGroup *v4beta1.SourceRepositoryGroup, opts v1.UpdateOptions) (result *v4beta1.SourceRepositoryGroup, err error) { - result = &v4beta1.SourceRepositoryGroup{} - err = c.client.Put(). - Namespace(c.ns). - Resource("sourcerepositorygroups"). - Name(sourceRepositoryGroup.Name). - VersionedParams(&opts, scheme.ParameterCodec). - Body(sourceRepositoryGroup). - Do(ctx). - Into(result) - return -} - -// Delete takes name of the sourceRepositoryGroup and deletes it. Returns an error if one occurs. -func (c *sourceRepositoryGroups) Delete(ctx context.Context, name string, opts v1.DeleteOptions) error { - return c.client.Delete(). - Namespace(c.ns). - Resource("sourcerepositorygroups"). - Name(name). - Body(&opts). - Do(ctx). - Error() -} - -// DeleteCollection deletes a collection of objects. -func (c *sourceRepositoryGroups) DeleteCollection(ctx context.Context, opts v1.DeleteOptions, listOpts v1.ListOptions) error { - var timeout time.Duration - if listOpts.TimeoutSeconds != nil { - timeout = time.Duration(*listOpts.TimeoutSeconds) * time.Second - } - return c.client.Delete(). - Namespace(c.ns). - Resource("sourcerepositorygroups"). - VersionedParams(&listOpts, scheme.ParameterCodec). - Timeout(timeout). - Body(&opts). - Do(ctx). - Error() -} - -// Patch applies the patch and returns the patched sourceRepositoryGroup. -func (c *sourceRepositoryGroups) Patch(ctx context.Context, name string, pt types.PatchType, data []byte, opts v1.PatchOptions, subresources ...string) (result *v4beta1.SourceRepositoryGroup, err error) { - result = &v4beta1.SourceRepositoryGroup{} - err = c.client.Patch(pt). - Namespace(c.ns). - Resource("sourcerepositorygroups"). - Name(name). - SubResource(subresources...). - VersionedParams(&opts, scheme.ParameterCodec). - Body(data). - Do(ctx). - Into(result) - return -} diff --git a/pkg/client/clientset/versioned/typed/jenkins.io/v4beta1/team.go b/pkg/client/clientset/versioned/typed/jenkins.io/v4beta1/team.go deleted file mode 100644 index 7fd77c6..0000000 --- a/pkg/client/clientset/versioned/typed/jenkins.io/v4beta1/team.go +++ /dev/null @@ -1,177 +0,0 @@ -/* -Copyright 2020 The Jenkins X 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 v4beta1 - -import ( - "context" - "time" - - v4beta1 "github.com/jenkins-x/jx-api/v4/pkg/apis/jenkins.io/v4beta1" - scheme "github.com/jenkins-x/jx-api/v4/pkg/client/clientset/versioned/scheme" - v1 "k8s.io/apimachinery/pkg/apis/meta/v1" - types "k8s.io/apimachinery/pkg/types" - watch "k8s.io/apimachinery/pkg/watch" - rest "k8s.io/client-go/rest" -) - -// TeamsGetter has a method to return a TeamInterface. -// A group's client should implement this interface. -type TeamsGetter interface { - Teams(namespace string) TeamInterface -} - -// TeamInterface has methods to work with Team resources. -type TeamInterface interface { - Create(ctx context.Context, team *v4beta1.Team, opts v1.CreateOptions) (*v4beta1.Team, error) - Update(ctx context.Context, team *v4beta1.Team, opts v1.UpdateOptions) (*v4beta1.Team, error) - Delete(ctx context.Context, name string, opts v1.DeleteOptions) error - DeleteCollection(ctx context.Context, opts v1.DeleteOptions, listOpts v1.ListOptions) error - Get(ctx context.Context, name string, opts v1.GetOptions) (*v4beta1.Team, error) - List(ctx context.Context, opts v1.ListOptions) (*v4beta1.TeamList, error) - Watch(ctx context.Context, opts v1.ListOptions) (watch.Interface, error) - Patch(ctx context.Context, name string, pt types.PatchType, data []byte, opts v1.PatchOptions, subresources ...string) (result *v4beta1.Team, err error) - TeamExpansion -} - -// teams implements TeamInterface -type teams struct { - client rest.Interface - ns string -} - -// newTeams returns a Teams -func newTeams(c *JenkinsV4beta1Client, namespace string) *teams { - return &teams{ - client: c.RESTClient(), - ns: namespace, - } -} - -// Get takes name of the team, and returns the corresponding team object, and an error if there is any. -func (c *teams) Get(ctx context.Context, name string, options v1.GetOptions) (result *v4beta1.Team, err error) { - result = &v4beta1.Team{} - err = c.client.Get(). - Namespace(c.ns). - Resource("teams"). - Name(name). - VersionedParams(&options, scheme.ParameterCodec). - Do(ctx). - Into(result) - return -} - -// List takes label and field selectors, and returns the list of Teams that match those selectors. -func (c *teams) List(ctx context.Context, opts v1.ListOptions) (result *v4beta1.TeamList, err error) { - var timeout time.Duration - if opts.TimeoutSeconds != nil { - timeout = time.Duration(*opts.TimeoutSeconds) * time.Second - } - result = &v4beta1.TeamList{} - err = c.client.Get(). - Namespace(c.ns). - Resource("teams"). - VersionedParams(&opts, scheme.ParameterCodec). - Timeout(timeout). - Do(ctx). - Into(result) - return -} - -// Watch returns a watch.Interface that watches the requested teams. -func (c *teams) Watch(ctx context.Context, opts v1.ListOptions) (watch.Interface, error) { - var timeout time.Duration - if opts.TimeoutSeconds != nil { - timeout = time.Duration(*opts.TimeoutSeconds) * time.Second - } - opts.Watch = true - return c.client.Get(). - Namespace(c.ns). - Resource("teams"). - VersionedParams(&opts, scheme.ParameterCodec). - Timeout(timeout). - Watch(ctx) -} - -// Create takes the representation of a team and creates it. Returns the server's representation of the team, and an error, if there is any. -func (c *teams) Create(ctx context.Context, team *v4beta1.Team, opts v1.CreateOptions) (result *v4beta1.Team, err error) { - result = &v4beta1.Team{} - err = c.client.Post(). - Namespace(c.ns). - Resource("teams"). - VersionedParams(&opts, scheme.ParameterCodec). - Body(team). - Do(ctx). - Into(result) - return -} - -// Update takes the representation of a team and updates it. Returns the server's representation of the team, and an error, if there is any. -func (c *teams) Update(ctx context.Context, team *v4beta1.Team, opts v1.UpdateOptions) (result *v4beta1.Team, err error) { - result = &v4beta1.Team{} - err = c.client.Put(). - Namespace(c.ns). - Resource("teams"). - Name(team.Name). - VersionedParams(&opts, scheme.ParameterCodec). - Body(team). - Do(ctx). - Into(result) - return -} - -// Delete takes name of the team and deletes it. Returns an error if one occurs. -func (c *teams) Delete(ctx context.Context, name string, opts v1.DeleteOptions) error { - return c.client.Delete(). - Namespace(c.ns). - Resource("teams"). - Name(name). - Body(&opts). - Do(ctx). - Error() -} - -// DeleteCollection deletes a collection of objects. -func (c *teams) DeleteCollection(ctx context.Context, opts v1.DeleteOptions, listOpts v1.ListOptions) error { - var timeout time.Duration - if listOpts.TimeoutSeconds != nil { - timeout = time.Duration(*listOpts.TimeoutSeconds) * time.Second - } - return c.client.Delete(). - Namespace(c.ns). - Resource("teams"). - VersionedParams(&listOpts, scheme.ParameterCodec). - Timeout(timeout). - Body(&opts). - Do(ctx). - Error() -} - -// Patch applies the patch and returns the patched team. -func (c *teams) Patch(ctx context.Context, name string, pt types.PatchType, data []byte, opts v1.PatchOptions, subresources ...string) (result *v4beta1.Team, err error) { - result = &v4beta1.Team{} - err = c.client.Patch(pt). - Namespace(c.ns). - Resource("teams"). - Name(name). - SubResource(subresources...). - VersionedParams(&opts, scheme.ParameterCodec). - Body(data). - Do(ctx). - Into(result) - return -} diff --git a/pkg/client/clientset/versioned/typed/jenkins.io/v4beta1/user.go b/pkg/client/clientset/versioned/typed/jenkins.io/v4beta1/user.go deleted file mode 100644 index 0a7f2d4..0000000 --- a/pkg/client/clientset/versioned/typed/jenkins.io/v4beta1/user.go +++ /dev/null @@ -1,177 +0,0 @@ -/* -Copyright 2020 The Jenkins X 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 v4beta1 - -import ( - "context" - "time" - - v4beta1 "github.com/jenkins-x/jx-api/v4/pkg/apis/jenkins.io/v4beta1" - scheme "github.com/jenkins-x/jx-api/v4/pkg/client/clientset/versioned/scheme" - v1 "k8s.io/apimachinery/pkg/apis/meta/v1" - types "k8s.io/apimachinery/pkg/types" - watch "k8s.io/apimachinery/pkg/watch" - rest "k8s.io/client-go/rest" -) - -// UsersGetter has a method to return a UserInterface. -// A group's client should implement this interface. -type UsersGetter interface { - Users(namespace string) UserInterface -} - -// UserInterface has methods to work with User resources. -type UserInterface interface { - Create(ctx context.Context, user *v4beta1.User, opts v1.CreateOptions) (*v4beta1.User, error) - Update(ctx context.Context, user *v4beta1.User, opts v1.UpdateOptions) (*v4beta1.User, error) - Delete(ctx context.Context, name string, opts v1.DeleteOptions) error - DeleteCollection(ctx context.Context, opts v1.DeleteOptions, listOpts v1.ListOptions) error - Get(ctx context.Context, name string, opts v1.GetOptions) (*v4beta1.User, error) - List(ctx context.Context, opts v1.ListOptions) (*v4beta1.UserList, error) - Watch(ctx context.Context, opts v1.ListOptions) (watch.Interface, error) - Patch(ctx context.Context, name string, pt types.PatchType, data []byte, opts v1.PatchOptions, subresources ...string) (result *v4beta1.User, err error) - UserExpansion -} - -// users implements UserInterface -type users struct { - client rest.Interface - ns string -} - -// newUsers returns a Users -func newUsers(c *JenkinsV4beta1Client, namespace string) *users { - return &users{ - client: c.RESTClient(), - ns: namespace, - } -} - -// Get takes name of the user, and returns the corresponding user object, and an error if there is any. -func (c *users) Get(ctx context.Context, name string, options v1.GetOptions) (result *v4beta1.User, err error) { - result = &v4beta1.User{} - err = c.client.Get(). - Namespace(c.ns). - Resource("users"). - Name(name). - VersionedParams(&options, scheme.ParameterCodec). - Do(ctx). - Into(result) - return -} - -// List takes label and field selectors, and returns the list of Users that match those selectors. -func (c *users) List(ctx context.Context, opts v1.ListOptions) (result *v4beta1.UserList, err error) { - var timeout time.Duration - if opts.TimeoutSeconds != nil { - timeout = time.Duration(*opts.TimeoutSeconds) * time.Second - } - result = &v4beta1.UserList{} - err = c.client.Get(). - Namespace(c.ns). - Resource("users"). - VersionedParams(&opts, scheme.ParameterCodec). - Timeout(timeout). - Do(ctx). - Into(result) - return -} - -// Watch returns a watch.Interface that watches the requested users. -func (c *users) Watch(ctx context.Context, opts v1.ListOptions) (watch.Interface, error) { - var timeout time.Duration - if opts.TimeoutSeconds != nil { - timeout = time.Duration(*opts.TimeoutSeconds) * time.Second - } - opts.Watch = true - return c.client.Get(). - Namespace(c.ns). - Resource("users"). - VersionedParams(&opts, scheme.ParameterCodec). - Timeout(timeout). - Watch(ctx) -} - -// Create takes the representation of a user and creates it. Returns the server's representation of the user, and an error, if there is any. -func (c *users) Create(ctx context.Context, user *v4beta1.User, opts v1.CreateOptions) (result *v4beta1.User, err error) { - result = &v4beta1.User{} - err = c.client.Post(). - Namespace(c.ns). - Resource("users"). - VersionedParams(&opts, scheme.ParameterCodec). - Body(user). - Do(ctx). - Into(result) - return -} - -// Update takes the representation of a user and updates it. Returns the server's representation of the user, and an error, if there is any. -func (c *users) Update(ctx context.Context, user *v4beta1.User, opts v1.UpdateOptions) (result *v4beta1.User, err error) { - result = &v4beta1.User{} - err = c.client.Put(). - Namespace(c.ns). - Resource("users"). - Name(user.Name). - VersionedParams(&opts, scheme.ParameterCodec). - Body(user). - Do(ctx). - Into(result) - return -} - -// Delete takes name of the user and deletes it. Returns an error if one occurs. -func (c *users) Delete(ctx context.Context, name string, opts v1.DeleteOptions) error { - return c.client.Delete(). - Namespace(c.ns). - Resource("users"). - Name(name). - Body(&opts). - Do(ctx). - Error() -} - -// DeleteCollection deletes a collection of objects. -func (c *users) DeleteCollection(ctx context.Context, opts v1.DeleteOptions, listOpts v1.ListOptions) error { - var timeout time.Duration - if listOpts.TimeoutSeconds != nil { - timeout = time.Duration(*listOpts.TimeoutSeconds) * time.Second - } - return c.client.Delete(). - Namespace(c.ns). - Resource("users"). - VersionedParams(&listOpts, scheme.ParameterCodec). - Timeout(timeout). - Body(&opts). - Do(ctx). - Error() -} - -// Patch applies the patch and returns the patched user. -func (c *users) Patch(ctx context.Context, name string, pt types.PatchType, data []byte, opts v1.PatchOptions, subresources ...string) (result *v4beta1.User, err error) { - result = &v4beta1.User{} - err = c.client.Patch(pt). - Namespace(c.ns). - Resource("users"). - Name(name). - SubResource(subresources...). - VersionedParams(&opts, scheme.ParameterCodec). - Body(data). - Do(ctx). - Into(result) - return -} diff --git a/pkg/client/informers/externalversions/jenkins.io/interface.go b/pkg/client/informers/externalversions/core/interface.go similarity index 96% rename from pkg/client/informers/externalversions/jenkins.io/interface.go rename to pkg/client/informers/externalversions/core/interface.go index 82ddf65..bced8aa 100644 --- a/pkg/client/informers/externalversions/jenkins.io/interface.go +++ b/pkg/client/informers/externalversions/core/interface.go @@ -15,11 +15,11 @@ limitations under the License. */ // Code generated by informer-gen. DO NOT EDIT. -package jenkins +package core import ( + v4beta1 "github.com/jenkins-x/jx-api/v4/pkg/client/informers/externalversions/core/v4beta1" internalinterfaces "github.com/jenkins-x/jx-api/v4/pkg/client/informers/externalversions/internalinterfaces" - v4beta1 "github.com/jenkins-x/jx-api/v4/pkg/client/informers/externalversions/jenkins.io/v4beta1" ) // Interface provides access to each of this group's versions. diff --git a/pkg/client/informers/externalversions/jenkins.io/v4beta1/environment.go b/pkg/client/informers/externalversions/core/v4beta1/environment.go similarity index 87% rename from pkg/client/informers/externalversions/jenkins.io/v4beta1/environment.go rename to pkg/client/informers/externalversions/core/v4beta1/environment.go index 8dc12e1..930e686 100644 --- a/pkg/client/informers/externalversions/jenkins.io/v4beta1/environment.go +++ b/pkg/client/informers/externalversions/core/v4beta1/environment.go @@ -21,10 +21,10 @@ import ( "context" time "time" - jenkinsiov4beta1 "github.com/jenkins-x/jx-api/v4/pkg/apis/jenkins.io/v4beta1" + corev4beta1 "github.com/jenkins-x/jx-api/v4/pkg/apis/core/v4beta1" versioned "github.com/jenkins-x/jx-api/v4/pkg/client/clientset/versioned" internalinterfaces "github.com/jenkins-x/jx-api/v4/pkg/client/informers/externalversions/internalinterfaces" - v4beta1 "github.com/jenkins-x/jx-api/v4/pkg/client/listers/jenkins.io/v4beta1" + v4beta1 "github.com/jenkins-x/jx-api/v4/pkg/client/listers/core/v4beta1" v1 "k8s.io/apimachinery/pkg/apis/meta/v1" runtime "k8s.io/apimachinery/pkg/runtime" watch "k8s.io/apimachinery/pkg/watch" @@ -61,16 +61,16 @@ func NewFilteredEnvironmentInformer(client versioned.Interface, namespace string if tweakListOptions != nil { tweakListOptions(&options) } - return client.JenkinsV4beta1().Environments(namespace).List(context.TODO(), options) + return client.CoreV4beta1().Environments(namespace).List(context.TODO(), options) }, WatchFunc: func(options v1.ListOptions) (watch.Interface, error) { if tweakListOptions != nil { tweakListOptions(&options) } - return client.JenkinsV4beta1().Environments(namespace).Watch(context.TODO(), options) + return client.CoreV4beta1().Environments(namespace).Watch(context.TODO(), options) }, }, - &jenkinsiov4beta1.Environment{}, + &corev4beta1.Environment{}, resyncPeriod, indexers, ) @@ -81,7 +81,7 @@ func (f *environmentInformer) defaultInformer(client versioned.Interface, resync } func (f *environmentInformer) Informer() cache.SharedIndexInformer { - return f.factory.InformerFor(&jenkinsiov4beta1.Environment{}, f.defaultInformer) + return f.factory.InformerFor(&corev4beta1.Environment{}, f.defaultInformer) } func (f *environmentInformer) Lister() v4beta1.EnvironmentLister { diff --git a/pkg/client/informers/externalversions/jenkins.io/v4beta1/interface.go b/pkg/client/informers/externalversions/core/v4beta1/interface.go similarity index 51% rename from pkg/client/informers/externalversions/jenkins.io/v4beta1/interface.go rename to pkg/client/informers/externalversions/core/v4beta1/interface.go index 2065ef3..1944748 100644 --- a/pkg/client/informers/externalversions/jenkins.io/v4beta1/interface.go +++ b/pkg/client/informers/externalversions/core/v4beta1/interface.go @@ -23,20 +23,8 @@ import ( // Interface provides access to all the informers in this group version. type Interface interface { - // Apps returns a AppInformer. - Apps() AppInformer - // BuildPacks returns a BuildPackInformer. - BuildPacks() BuildPackInformer - // CommitStatuses returns a CommitStatusInformer. - CommitStatuses() CommitStatusInformer // Environments returns a EnvironmentInformer. Environments() EnvironmentInformer - // EnvironmentRoleBindings returns a EnvironmentRoleBindingInformer. - EnvironmentRoleBindings() EnvironmentRoleBindingInformer - // Extensions returns a ExtensionInformer. - Extensions() ExtensionInformer - // GitServices returns a GitServiceInformer. - GitServices() GitServiceInformer // PipelineActivities returns a PipelineActivityInformer. PipelineActivities() PipelineActivityInformer // Plugins returns a PluginInformer. @@ -45,12 +33,6 @@ type Interface interface { Releases() ReleaseInformer // SourceRepositories returns a SourceRepositoryInformer. SourceRepositories() SourceRepositoryInformer - // SourceRepositoryGroups returns a SourceRepositoryGroupInformer. - SourceRepositoryGroups() SourceRepositoryGroupInformer - // Teams returns a TeamInformer. - Teams() TeamInformer - // Users returns a UserInformer. - Users() UserInformer } type version struct { @@ -64,41 +46,11 @@ func New(f internalinterfaces.SharedInformerFactory, namespace string, tweakList return &version{factory: f, namespace: namespace, tweakListOptions: tweakListOptions} } -// Apps returns a AppInformer. -func (v *version) Apps() AppInformer { - return &appInformer{factory: v.factory, namespace: v.namespace, tweakListOptions: v.tweakListOptions} -} - -// BuildPacks returns a BuildPackInformer. -func (v *version) BuildPacks() BuildPackInformer { - return &buildPackInformer{factory: v.factory, namespace: v.namespace, tweakListOptions: v.tweakListOptions} -} - -// CommitStatuses returns a CommitStatusInformer. -func (v *version) CommitStatuses() CommitStatusInformer { - return &commitStatusInformer{factory: v.factory, namespace: v.namespace, tweakListOptions: v.tweakListOptions} -} - // Environments returns a EnvironmentInformer. func (v *version) Environments() EnvironmentInformer { return &environmentInformer{factory: v.factory, namespace: v.namespace, tweakListOptions: v.tweakListOptions} } -// EnvironmentRoleBindings returns a EnvironmentRoleBindingInformer. -func (v *version) EnvironmentRoleBindings() EnvironmentRoleBindingInformer { - return &environmentRoleBindingInformer{factory: v.factory, namespace: v.namespace, tweakListOptions: v.tweakListOptions} -} - -// Extensions returns a ExtensionInformer. -func (v *version) Extensions() ExtensionInformer { - return &extensionInformer{factory: v.factory, namespace: v.namespace, tweakListOptions: v.tweakListOptions} -} - -// GitServices returns a GitServiceInformer. -func (v *version) GitServices() GitServiceInformer { - return &gitServiceInformer{factory: v.factory, namespace: v.namespace, tweakListOptions: v.tweakListOptions} -} - // PipelineActivities returns a PipelineActivityInformer. func (v *version) PipelineActivities() PipelineActivityInformer { return &pipelineActivityInformer{factory: v.factory, namespace: v.namespace, tweakListOptions: v.tweakListOptions} @@ -118,18 +70,3 @@ func (v *version) Releases() ReleaseInformer { func (v *version) SourceRepositories() SourceRepositoryInformer { return &sourceRepositoryInformer{factory: v.factory, namespace: v.namespace, tweakListOptions: v.tweakListOptions} } - -// SourceRepositoryGroups returns a SourceRepositoryGroupInformer. -func (v *version) SourceRepositoryGroups() SourceRepositoryGroupInformer { - return &sourceRepositoryGroupInformer{factory: v.factory, namespace: v.namespace, tweakListOptions: v.tweakListOptions} -} - -// Teams returns a TeamInformer. -func (v *version) Teams() TeamInformer { - return &teamInformer{factory: v.factory, namespace: v.namespace, tweakListOptions: v.tweakListOptions} -} - -// Users returns a UserInformer. -func (v *version) Users() UserInformer { - return &userInformer{factory: v.factory, namespace: v.namespace, tweakListOptions: v.tweakListOptions} -} diff --git a/pkg/client/informers/externalversions/jenkins.io/v4beta1/pipelineactivity.go b/pkg/client/informers/externalversions/core/v4beta1/pipelineactivity.go similarity index 87% rename from pkg/client/informers/externalversions/jenkins.io/v4beta1/pipelineactivity.go rename to pkg/client/informers/externalversions/core/v4beta1/pipelineactivity.go index 16e03bc..0570b9d 100644 --- a/pkg/client/informers/externalversions/jenkins.io/v4beta1/pipelineactivity.go +++ b/pkg/client/informers/externalversions/core/v4beta1/pipelineactivity.go @@ -21,10 +21,10 @@ import ( "context" time "time" - jenkinsiov4beta1 "github.com/jenkins-x/jx-api/v4/pkg/apis/jenkins.io/v4beta1" + corev4beta1 "github.com/jenkins-x/jx-api/v4/pkg/apis/core/v4beta1" versioned "github.com/jenkins-x/jx-api/v4/pkg/client/clientset/versioned" internalinterfaces "github.com/jenkins-x/jx-api/v4/pkg/client/informers/externalversions/internalinterfaces" - v4beta1 "github.com/jenkins-x/jx-api/v4/pkg/client/listers/jenkins.io/v4beta1" + v4beta1 "github.com/jenkins-x/jx-api/v4/pkg/client/listers/core/v4beta1" v1 "k8s.io/apimachinery/pkg/apis/meta/v1" runtime "k8s.io/apimachinery/pkg/runtime" watch "k8s.io/apimachinery/pkg/watch" @@ -61,16 +61,16 @@ func NewFilteredPipelineActivityInformer(client versioned.Interface, namespace s if tweakListOptions != nil { tweakListOptions(&options) } - return client.JenkinsV4beta1().PipelineActivities(namespace).List(context.TODO(), options) + return client.CoreV4beta1().PipelineActivities(namespace).List(context.TODO(), options) }, WatchFunc: func(options v1.ListOptions) (watch.Interface, error) { if tweakListOptions != nil { tweakListOptions(&options) } - return client.JenkinsV4beta1().PipelineActivities(namespace).Watch(context.TODO(), options) + return client.CoreV4beta1().PipelineActivities(namespace).Watch(context.TODO(), options) }, }, - &jenkinsiov4beta1.PipelineActivity{}, + &corev4beta1.PipelineActivity{}, resyncPeriod, indexers, ) @@ -81,7 +81,7 @@ func (f *pipelineActivityInformer) defaultInformer(client versioned.Interface, r } func (f *pipelineActivityInformer) Informer() cache.SharedIndexInformer { - return f.factory.InformerFor(&jenkinsiov4beta1.PipelineActivity{}, f.defaultInformer) + return f.factory.InformerFor(&corev4beta1.PipelineActivity{}, f.defaultInformer) } func (f *pipelineActivityInformer) Lister() v4beta1.PipelineActivityLister { diff --git a/pkg/client/informers/externalversions/jenkins.io/v4beta1/plugin.go b/pkg/client/informers/externalversions/core/v4beta1/plugin.go similarity index 87% rename from pkg/client/informers/externalversions/jenkins.io/v4beta1/plugin.go rename to pkg/client/informers/externalversions/core/v4beta1/plugin.go index 5629dd7..5e47cce 100644 --- a/pkg/client/informers/externalversions/jenkins.io/v4beta1/plugin.go +++ b/pkg/client/informers/externalversions/core/v4beta1/plugin.go @@ -21,10 +21,10 @@ import ( "context" time "time" - jenkinsiov4beta1 "github.com/jenkins-x/jx-api/v4/pkg/apis/jenkins.io/v4beta1" + corev4beta1 "github.com/jenkins-x/jx-api/v4/pkg/apis/core/v4beta1" versioned "github.com/jenkins-x/jx-api/v4/pkg/client/clientset/versioned" internalinterfaces "github.com/jenkins-x/jx-api/v4/pkg/client/informers/externalversions/internalinterfaces" - v4beta1 "github.com/jenkins-x/jx-api/v4/pkg/client/listers/jenkins.io/v4beta1" + v4beta1 "github.com/jenkins-x/jx-api/v4/pkg/client/listers/core/v4beta1" v1 "k8s.io/apimachinery/pkg/apis/meta/v1" runtime "k8s.io/apimachinery/pkg/runtime" watch "k8s.io/apimachinery/pkg/watch" @@ -61,16 +61,16 @@ func NewFilteredPluginInformer(client versioned.Interface, namespace string, res if tweakListOptions != nil { tweakListOptions(&options) } - return client.JenkinsV4beta1().Plugins(namespace).List(context.TODO(), options) + return client.CoreV4beta1().Plugins(namespace).List(context.TODO(), options) }, WatchFunc: func(options v1.ListOptions) (watch.Interface, error) { if tweakListOptions != nil { tweakListOptions(&options) } - return client.JenkinsV4beta1().Plugins(namespace).Watch(context.TODO(), options) + return client.CoreV4beta1().Plugins(namespace).Watch(context.TODO(), options) }, }, - &jenkinsiov4beta1.Plugin{}, + &corev4beta1.Plugin{}, resyncPeriod, indexers, ) @@ -81,7 +81,7 @@ func (f *pluginInformer) defaultInformer(client versioned.Interface, resyncPerio } func (f *pluginInformer) Informer() cache.SharedIndexInformer { - return f.factory.InformerFor(&jenkinsiov4beta1.Plugin{}, f.defaultInformer) + return f.factory.InformerFor(&corev4beta1.Plugin{}, f.defaultInformer) } func (f *pluginInformer) Lister() v4beta1.PluginLister { diff --git a/pkg/client/informers/externalversions/jenkins.io/v4beta1/release.go b/pkg/client/informers/externalversions/core/v4beta1/release.go similarity index 87% rename from pkg/client/informers/externalversions/jenkins.io/v4beta1/release.go rename to pkg/client/informers/externalversions/core/v4beta1/release.go index 6b40506..86a4808 100644 --- a/pkg/client/informers/externalversions/jenkins.io/v4beta1/release.go +++ b/pkg/client/informers/externalversions/core/v4beta1/release.go @@ -21,10 +21,10 @@ import ( "context" time "time" - jenkinsiov4beta1 "github.com/jenkins-x/jx-api/v4/pkg/apis/jenkins.io/v4beta1" + corev4beta1 "github.com/jenkins-x/jx-api/v4/pkg/apis/core/v4beta1" versioned "github.com/jenkins-x/jx-api/v4/pkg/client/clientset/versioned" internalinterfaces "github.com/jenkins-x/jx-api/v4/pkg/client/informers/externalversions/internalinterfaces" - v4beta1 "github.com/jenkins-x/jx-api/v4/pkg/client/listers/jenkins.io/v4beta1" + v4beta1 "github.com/jenkins-x/jx-api/v4/pkg/client/listers/core/v4beta1" v1 "k8s.io/apimachinery/pkg/apis/meta/v1" runtime "k8s.io/apimachinery/pkg/runtime" watch "k8s.io/apimachinery/pkg/watch" @@ -61,16 +61,16 @@ func NewFilteredReleaseInformer(client versioned.Interface, namespace string, re if tweakListOptions != nil { tweakListOptions(&options) } - return client.JenkinsV4beta1().Releases(namespace).List(context.TODO(), options) + return client.CoreV4beta1().Releases(namespace).List(context.TODO(), options) }, WatchFunc: func(options v1.ListOptions) (watch.Interface, error) { if tweakListOptions != nil { tweakListOptions(&options) } - return client.JenkinsV4beta1().Releases(namespace).Watch(context.TODO(), options) + return client.CoreV4beta1().Releases(namespace).Watch(context.TODO(), options) }, }, - &jenkinsiov4beta1.Release{}, + &corev4beta1.Release{}, resyncPeriod, indexers, ) @@ -81,7 +81,7 @@ func (f *releaseInformer) defaultInformer(client versioned.Interface, resyncPeri } func (f *releaseInformer) Informer() cache.SharedIndexInformer { - return f.factory.InformerFor(&jenkinsiov4beta1.Release{}, f.defaultInformer) + return f.factory.InformerFor(&corev4beta1.Release{}, f.defaultInformer) } func (f *releaseInformer) Lister() v4beta1.ReleaseLister { diff --git a/pkg/client/informers/externalversions/jenkins.io/v4beta1/sourcerepository.go b/pkg/client/informers/externalversions/core/v4beta1/sourcerepository.go similarity index 87% rename from pkg/client/informers/externalversions/jenkins.io/v4beta1/sourcerepository.go rename to pkg/client/informers/externalversions/core/v4beta1/sourcerepository.go index 7125617..436f80b 100644 --- a/pkg/client/informers/externalversions/jenkins.io/v4beta1/sourcerepository.go +++ b/pkg/client/informers/externalversions/core/v4beta1/sourcerepository.go @@ -21,10 +21,10 @@ import ( "context" time "time" - jenkinsiov4beta1 "github.com/jenkins-x/jx-api/v4/pkg/apis/jenkins.io/v4beta1" + corev4beta1 "github.com/jenkins-x/jx-api/v4/pkg/apis/core/v4beta1" versioned "github.com/jenkins-x/jx-api/v4/pkg/client/clientset/versioned" internalinterfaces "github.com/jenkins-x/jx-api/v4/pkg/client/informers/externalversions/internalinterfaces" - v4beta1 "github.com/jenkins-x/jx-api/v4/pkg/client/listers/jenkins.io/v4beta1" + v4beta1 "github.com/jenkins-x/jx-api/v4/pkg/client/listers/core/v4beta1" v1 "k8s.io/apimachinery/pkg/apis/meta/v1" runtime "k8s.io/apimachinery/pkg/runtime" watch "k8s.io/apimachinery/pkg/watch" @@ -61,16 +61,16 @@ func NewFilteredSourceRepositoryInformer(client versioned.Interface, namespace s if tweakListOptions != nil { tweakListOptions(&options) } - return client.JenkinsV4beta1().SourceRepositories(namespace).List(context.TODO(), options) + return client.CoreV4beta1().SourceRepositories(namespace).List(context.TODO(), options) }, WatchFunc: func(options v1.ListOptions) (watch.Interface, error) { if tweakListOptions != nil { tweakListOptions(&options) } - return client.JenkinsV4beta1().SourceRepositories(namespace).Watch(context.TODO(), options) + return client.CoreV4beta1().SourceRepositories(namespace).Watch(context.TODO(), options) }, }, - &jenkinsiov4beta1.SourceRepository{}, + &corev4beta1.SourceRepository{}, resyncPeriod, indexers, ) @@ -81,7 +81,7 @@ func (f *sourceRepositoryInformer) defaultInformer(client versioned.Interface, r } func (f *sourceRepositoryInformer) Informer() cache.SharedIndexInformer { - return f.factory.InformerFor(&jenkinsiov4beta1.SourceRepository{}, f.defaultInformer) + return f.factory.InformerFor(&corev4beta1.SourceRepository{}, f.defaultInformer) } func (f *sourceRepositoryInformer) Lister() v4beta1.SourceRepositoryLister { diff --git a/pkg/client/informers/externalversions/factory.go b/pkg/client/informers/externalversions/factory.go index 8a60fb5..3ad65f3 100644 --- a/pkg/client/informers/externalversions/factory.go +++ b/pkg/client/informers/externalversions/factory.go @@ -23,8 +23,8 @@ import ( time "time" versioned "github.com/jenkins-x/jx-api/v4/pkg/client/clientset/versioned" + core "github.com/jenkins-x/jx-api/v4/pkg/client/informers/externalversions/core" internalinterfaces "github.com/jenkins-x/jx-api/v4/pkg/client/informers/externalversions/internalinterfaces" - jenkinsio "github.com/jenkins-x/jx-api/v4/pkg/client/informers/externalversions/jenkins.io" v1 "k8s.io/apimachinery/pkg/apis/meta/v1" runtime "k8s.io/apimachinery/pkg/runtime" schema "k8s.io/apimachinery/pkg/runtime/schema" @@ -171,9 +171,9 @@ type SharedInformerFactory interface { ForResource(resource schema.GroupVersionResource) (GenericInformer, error) WaitForCacheSync(stopCh <-chan struct{}) map[reflect.Type]bool - Jenkins() jenkinsio.Interface + Core() core.Interface } -func (f *sharedInformerFactory) Jenkins() jenkinsio.Interface { - return jenkinsio.New(f, f.namespace, f.tweakListOptions) +func (f *sharedInformerFactory) Core() core.Interface { + return core.New(f, f.namespace, f.tweakListOptions) } diff --git a/pkg/client/informers/externalversions/generic.go b/pkg/client/informers/externalversions/generic.go index 2b5652d..6f69603 100644 --- a/pkg/client/informers/externalversions/generic.go +++ b/pkg/client/informers/externalversions/generic.go @@ -20,7 +20,7 @@ package externalversions import ( "fmt" - v4beta1 "github.com/jenkins-x/jx-api/v4/pkg/apis/jenkins.io/v4beta1" + v4beta1 "github.com/jenkins-x/jx-api/v4/pkg/apis/core/v4beta1" schema "k8s.io/apimachinery/pkg/runtime/schema" cache "k8s.io/client-go/tools/cache" ) @@ -51,35 +51,17 @@ func (f *genericInformer) Lister() cache.GenericLister { // TODO extend this to unknown resources with a client pool func (f *sharedInformerFactory) ForResource(resource schema.GroupVersionResource) (GenericInformer, error) { switch resource { - // Group=jenkins.io, Version=v4beta1 - case v4beta1.SchemeGroupVersion.WithResource("apps"): - return &genericInformer{resource: resource.GroupResource(), informer: f.Jenkins().V4beta1().Apps().Informer()}, nil - case v4beta1.SchemeGroupVersion.WithResource("buildpacks"): - return &genericInformer{resource: resource.GroupResource(), informer: f.Jenkins().V4beta1().BuildPacks().Informer()}, nil - case v4beta1.SchemeGroupVersion.WithResource("commitstatuses"): - return &genericInformer{resource: resource.GroupResource(), informer: f.Jenkins().V4beta1().CommitStatuses().Informer()}, nil + // Group=core.jenkins-x.io, Version=v4beta1 case v4beta1.SchemeGroupVersion.WithResource("environments"): - return &genericInformer{resource: resource.GroupResource(), informer: f.Jenkins().V4beta1().Environments().Informer()}, nil - case v4beta1.SchemeGroupVersion.WithResource("environmentrolebindings"): - return &genericInformer{resource: resource.GroupResource(), informer: f.Jenkins().V4beta1().EnvironmentRoleBindings().Informer()}, nil - case v4beta1.SchemeGroupVersion.WithResource("extensions"): - return &genericInformer{resource: resource.GroupResource(), informer: f.Jenkins().V4beta1().Extensions().Informer()}, nil - case v4beta1.SchemeGroupVersion.WithResource("gitservices"): - return &genericInformer{resource: resource.GroupResource(), informer: f.Jenkins().V4beta1().GitServices().Informer()}, nil + return &genericInformer{resource: resource.GroupResource(), informer: f.Core().V4beta1().Environments().Informer()}, nil case v4beta1.SchemeGroupVersion.WithResource("pipelineactivities"): - return &genericInformer{resource: resource.GroupResource(), informer: f.Jenkins().V4beta1().PipelineActivities().Informer()}, nil + return &genericInformer{resource: resource.GroupResource(), informer: f.Core().V4beta1().PipelineActivities().Informer()}, nil case v4beta1.SchemeGroupVersion.WithResource("plugins"): - return &genericInformer{resource: resource.GroupResource(), informer: f.Jenkins().V4beta1().Plugins().Informer()}, nil + return &genericInformer{resource: resource.GroupResource(), informer: f.Core().V4beta1().Plugins().Informer()}, nil case v4beta1.SchemeGroupVersion.WithResource("releases"): - return &genericInformer{resource: resource.GroupResource(), informer: f.Jenkins().V4beta1().Releases().Informer()}, nil + return &genericInformer{resource: resource.GroupResource(), informer: f.Core().V4beta1().Releases().Informer()}, nil case v4beta1.SchemeGroupVersion.WithResource("sourcerepositories"): - return &genericInformer{resource: resource.GroupResource(), informer: f.Jenkins().V4beta1().SourceRepositories().Informer()}, nil - case v4beta1.SchemeGroupVersion.WithResource("sourcerepositorygroups"): - return &genericInformer{resource: resource.GroupResource(), informer: f.Jenkins().V4beta1().SourceRepositoryGroups().Informer()}, nil - case v4beta1.SchemeGroupVersion.WithResource("teams"): - return &genericInformer{resource: resource.GroupResource(), informer: f.Jenkins().V4beta1().Teams().Informer()}, nil - case v4beta1.SchemeGroupVersion.WithResource("users"): - return &genericInformer{resource: resource.GroupResource(), informer: f.Jenkins().V4beta1().Users().Informer()}, nil + return &genericInformer{resource: resource.GroupResource(), informer: f.Core().V4beta1().SourceRepositories().Informer()}, nil } diff --git a/pkg/client/informers/externalversions/jenkins.io/v4beta1/app.go b/pkg/client/informers/externalversions/jenkins.io/v4beta1/app.go deleted file mode 100644 index 0365c10..0000000 --- a/pkg/client/informers/externalversions/jenkins.io/v4beta1/app.go +++ /dev/null @@ -1,89 +0,0 @@ -/* -Copyright 2020 The Jenkins X Authors. - -Licensed under the Apache License, Version 2.0 (the "License"); -you may not use this file except in compliance with the License. -You may obtain a copy of the License at - - http://www.apache.org/licenses/LICENSE-2.0 - -Unless required by applicable law or agreed to in writing, software -distributed under the License is distributed on an "AS IS" BASIS, -WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -See the License for the specific language governing permissions and -limitations under the License. -*/ -// Code generated by informer-gen. DO NOT EDIT. - -package v4beta1 - -import ( - "context" - time "time" - - jenkinsiov4beta1 "github.com/jenkins-x/jx-api/v4/pkg/apis/jenkins.io/v4beta1" - versioned "github.com/jenkins-x/jx-api/v4/pkg/client/clientset/versioned" - internalinterfaces "github.com/jenkins-x/jx-api/v4/pkg/client/informers/externalversions/internalinterfaces" - v4beta1 "github.com/jenkins-x/jx-api/v4/pkg/client/listers/jenkins.io/v4beta1" - v1 "k8s.io/apimachinery/pkg/apis/meta/v1" - runtime "k8s.io/apimachinery/pkg/runtime" - watch "k8s.io/apimachinery/pkg/watch" - cache "k8s.io/client-go/tools/cache" -) - -// AppInformer provides access to a shared informer and lister for -// Apps. -type AppInformer interface { - Informer() cache.SharedIndexInformer - Lister() v4beta1.AppLister -} - -type appInformer struct { - factory internalinterfaces.SharedInformerFactory - tweakListOptions internalinterfaces.TweakListOptionsFunc - namespace string -} - -// NewAppInformer constructs a new informer for App type. -// Always prefer using an informer factory to get a shared informer instead of getting an independent -// one. This reduces memory footprint and number of connections to the server. -func NewAppInformer(client versioned.Interface, namespace string, resyncPeriod time.Duration, indexers cache.Indexers) cache.SharedIndexInformer { - return NewFilteredAppInformer(client, namespace, resyncPeriod, indexers, nil) -} - -// NewFilteredAppInformer constructs a new informer for App type. -// Always prefer using an informer factory to get a shared informer instead of getting an independent -// one. This reduces memory footprint and number of connections to the server. -func NewFilteredAppInformer(client versioned.Interface, namespace string, resyncPeriod time.Duration, indexers cache.Indexers, tweakListOptions internalinterfaces.TweakListOptionsFunc) cache.SharedIndexInformer { - return cache.NewSharedIndexInformer( - &cache.ListWatch{ - ListFunc: func(options v1.ListOptions) (runtime.Object, error) { - if tweakListOptions != nil { - tweakListOptions(&options) - } - return client.JenkinsV4beta1().Apps(namespace).List(context.TODO(), options) - }, - WatchFunc: func(options v1.ListOptions) (watch.Interface, error) { - if tweakListOptions != nil { - tweakListOptions(&options) - } - return client.JenkinsV4beta1().Apps(namespace).Watch(context.TODO(), options) - }, - }, - &jenkinsiov4beta1.App{}, - resyncPeriod, - indexers, - ) -} - -func (f *appInformer) defaultInformer(client versioned.Interface, resyncPeriod time.Duration) cache.SharedIndexInformer { - return NewFilteredAppInformer(client, f.namespace, resyncPeriod, cache.Indexers{cache.NamespaceIndex: cache.MetaNamespaceIndexFunc}, f.tweakListOptions) -} - -func (f *appInformer) Informer() cache.SharedIndexInformer { - return f.factory.InformerFor(&jenkinsiov4beta1.App{}, f.defaultInformer) -} - -func (f *appInformer) Lister() v4beta1.AppLister { - return v4beta1.NewAppLister(f.Informer().GetIndexer()) -} diff --git a/pkg/client/informers/externalversions/jenkins.io/v4beta1/buildpack.go b/pkg/client/informers/externalversions/jenkins.io/v4beta1/buildpack.go deleted file mode 100644 index a5c417a..0000000 --- a/pkg/client/informers/externalversions/jenkins.io/v4beta1/buildpack.go +++ /dev/null @@ -1,89 +0,0 @@ -/* -Copyright 2020 The Jenkins X Authors. - -Licensed under the Apache License, Version 2.0 (the "License"); -you may not use this file except in compliance with the License. -You may obtain a copy of the License at - - http://www.apache.org/licenses/LICENSE-2.0 - -Unless required by applicable law or agreed to in writing, software -distributed under the License is distributed on an "AS IS" BASIS, -WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -See the License for the specific language governing permissions and -limitations under the License. -*/ -// Code generated by informer-gen. DO NOT EDIT. - -package v4beta1 - -import ( - "context" - time "time" - - jenkinsiov4beta1 "github.com/jenkins-x/jx-api/v4/pkg/apis/jenkins.io/v4beta1" - versioned "github.com/jenkins-x/jx-api/v4/pkg/client/clientset/versioned" - internalinterfaces "github.com/jenkins-x/jx-api/v4/pkg/client/informers/externalversions/internalinterfaces" - v4beta1 "github.com/jenkins-x/jx-api/v4/pkg/client/listers/jenkins.io/v4beta1" - v1 "k8s.io/apimachinery/pkg/apis/meta/v1" - runtime "k8s.io/apimachinery/pkg/runtime" - watch "k8s.io/apimachinery/pkg/watch" - cache "k8s.io/client-go/tools/cache" -) - -// BuildPackInformer provides access to a shared informer and lister for -// BuildPacks. -type BuildPackInformer interface { - Informer() cache.SharedIndexInformer - Lister() v4beta1.BuildPackLister -} - -type buildPackInformer struct { - factory internalinterfaces.SharedInformerFactory - tweakListOptions internalinterfaces.TweakListOptionsFunc - namespace string -} - -// NewBuildPackInformer constructs a new informer for BuildPack type. -// Always prefer using an informer factory to get a shared informer instead of getting an independent -// one. This reduces memory footprint and number of connections to the server. -func NewBuildPackInformer(client versioned.Interface, namespace string, resyncPeriod time.Duration, indexers cache.Indexers) cache.SharedIndexInformer { - return NewFilteredBuildPackInformer(client, namespace, resyncPeriod, indexers, nil) -} - -// NewFilteredBuildPackInformer constructs a new informer for BuildPack type. -// Always prefer using an informer factory to get a shared informer instead of getting an independent -// one. This reduces memory footprint and number of connections to the server. -func NewFilteredBuildPackInformer(client versioned.Interface, namespace string, resyncPeriod time.Duration, indexers cache.Indexers, tweakListOptions internalinterfaces.TweakListOptionsFunc) cache.SharedIndexInformer { - return cache.NewSharedIndexInformer( - &cache.ListWatch{ - ListFunc: func(options v1.ListOptions) (runtime.Object, error) { - if tweakListOptions != nil { - tweakListOptions(&options) - } - return client.JenkinsV4beta1().BuildPacks(namespace).List(context.TODO(), options) - }, - WatchFunc: func(options v1.ListOptions) (watch.Interface, error) { - if tweakListOptions != nil { - tweakListOptions(&options) - } - return client.JenkinsV4beta1().BuildPacks(namespace).Watch(context.TODO(), options) - }, - }, - &jenkinsiov4beta1.BuildPack{}, - resyncPeriod, - indexers, - ) -} - -func (f *buildPackInformer) defaultInformer(client versioned.Interface, resyncPeriod time.Duration) cache.SharedIndexInformer { - return NewFilteredBuildPackInformer(client, f.namespace, resyncPeriod, cache.Indexers{cache.NamespaceIndex: cache.MetaNamespaceIndexFunc}, f.tweakListOptions) -} - -func (f *buildPackInformer) Informer() cache.SharedIndexInformer { - return f.factory.InformerFor(&jenkinsiov4beta1.BuildPack{}, f.defaultInformer) -} - -func (f *buildPackInformer) Lister() v4beta1.BuildPackLister { - return v4beta1.NewBuildPackLister(f.Informer().GetIndexer()) -} diff --git a/pkg/client/informers/externalversions/jenkins.io/v4beta1/commitstatus.go b/pkg/client/informers/externalversions/jenkins.io/v4beta1/commitstatus.go deleted file mode 100644 index b75ba01..0000000 --- a/pkg/client/informers/externalversions/jenkins.io/v4beta1/commitstatus.go +++ /dev/null @@ -1,89 +0,0 @@ -/* -Copyright 2020 The Jenkins X Authors. - -Licensed under the Apache License, Version 2.0 (the "License"); -you may not use this file except in compliance with the License. -You may obtain a copy of the License at - - http://www.apache.org/licenses/LICENSE-2.0 - -Unless required by applicable law or agreed to in writing, software -distributed under the License is distributed on an "AS IS" BASIS, -WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -See the License for the specific language governing permissions and -limitations under the License. -*/ -// Code generated by informer-gen. DO NOT EDIT. - -package v4beta1 - -import ( - "context" - time "time" - - jenkinsiov4beta1 "github.com/jenkins-x/jx-api/v4/pkg/apis/jenkins.io/v4beta1" - versioned "github.com/jenkins-x/jx-api/v4/pkg/client/clientset/versioned" - internalinterfaces "github.com/jenkins-x/jx-api/v4/pkg/client/informers/externalversions/internalinterfaces" - v4beta1 "github.com/jenkins-x/jx-api/v4/pkg/client/listers/jenkins.io/v4beta1" - v1 "k8s.io/apimachinery/pkg/apis/meta/v1" - runtime "k8s.io/apimachinery/pkg/runtime" - watch "k8s.io/apimachinery/pkg/watch" - cache "k8s.io/client-go/tools/cache" -) - -// CommitStatusInformer provides access to a shared informer and lister for -// CommitStatuses. -type CommitStatusInformer interface { - Informer() cache.SharedIndexInformer - Lister() v4beta1.CommitStatusLister -} - -type commitStatusInformer struct { - factory internalinterfaces.SharedInformerFactory - tweakListOptions internalinterfaces.TweakListOptionsFunc - namespace string -} - -// NewCommitStatusInformer constructs a new informer for CommitStatus type. -// Always prefer using an informer factory to get a shared informer instead of getting an independent -// one. This reduces memory footprint and number of connections to the server. -func NewCommitStatusInformer(client versioned.Interface, namespace string, resyncPeriod time.Duration, indexers cache.Indexers) cache.SharedIndexInformer { - return NewFilteredCommitStatusInformer(client, namespace, resyncPeriod, indexers, nil) -} - -// NewFilteredCommitStatusInformer constructs a new informer for CommitStatus type. -// Always prefer using an informer factory to get a shared informer instead of getting an independent -// one. This reduces memory footprint and number of connections to the server. -func NewFilteredCommitStatusInformer(client versioned.Interface, namespace string, resyncPeriod time.Duration, indexers cache.Indexers, tweakListOptions internalinterfaces.TweakListOptionsFunc) cache.SharedIndexInformer { - return cache.NewSharedIndexInformer( - &cache.ListWatch{ - ListFunc: func(options v1.ListOptions) (runtime.Object, error) { - if tweakListOptions != nil { - tweakListOptions(&options) - } - return client.JenkinsV4beta1().CommitStatuses(namespace).List(context.TODO(), options) - }, - WatchFunc: func(options v1.ListOptions) (watch.Interface, error) { - if tweakListOptions != nil { - tweakListOptions(&options) - } - return client.JenkinsV4beta1().CommitStatuses(namespace).Watch(context.TODO(), options) - }, - }, - &jenkinsiov4beta1.CommitStatus{}, - resyncPeriod, - indexers, - ) -} - -func (f *commitStatusInformer) defaultInformer(client versioned.Interface, resyncPeriod time.Duration) cache.SharedIndexInformer { - return NewFilteredCommitStatusInformer(client, f.namespace, resyncPeriod, cache.Indexers{cache.NamespaceIndex: cache.MetaNamespaceIndexFunc}, f.tweakListOptions) -} - -func (f *commitStatusInformer) Informer() cache.SharedIndexInformer { - return f.factory.InformerFor(&jenkinsiov4beta1.CommitStatus{}, f.defaultInformer) -} - -func (f *commitStatusInformer) Lister() v4beta1.CommitStatusLister { - return v4beta1.NewCommitStatusLister(f.Informer().GetIndexer()) -} diff --git a/pkg/client/informers/externalversions/jenkins.io/v4beta1/environmentrolebinding.go b/pkg/client/informers/externalversions/jenkins.io/v4beta1/environmentrolebinding.go deleted file mode 100644 index af455d4..0000000 --- a/pkg/client/informers/externalversions/jenkins.io/v4beta1/environmentrolebinding.go +++ /dev/null @@ -1,89 +0,0 @@ -/* -Copyright 2020 The Jenkins X Authors. - -Licensed under the Apache License, Version 2.0 (the "License"); -you may not use this file except in compliance with the License. -You may obtain a copy of the License at - - http://www.apache.org/licenses/LICENSE-2.0 - -Unless required by applicable law or agreed to in writing, software -distributed under the License is distributed on an "AS IS" BASIS, -WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -See the License for the specific language governing permissions and -limitations under the License. -*/ -// Code generated by informer-gen. DO NOT EDIT. - -package v4beta1 - -import ( - "context" - time "time" - - jenkinsiov4beta1 "github.com/jenkins-x/jx-api/v4/pkg/apis/jenkins.io/v4beta1" - versioned "github.com/jenkins-x/jx-api/v4/pkg/client/clientset/versioned" - internalinterfaces "github.com/jenkins-x/jx-api/v4/pkg/client/informers/externalversions/internalinterfaces" - v4beta1 "github.com/jenkins-x/jx-api/v4/pkg/client/listers/jenkins.io/v4beta1" - v1 "k8s.io/apimachinery/pkg/apis/meta/v1" - runtime "k8s.io/apimachinery/pkg/runtime" - watch "k8s.io/apimachinery/pkg/watch" - cache "k8s.io/client-go/tools/cache" -) - -// EnvironmentRoleBindingInformer provides access to a shared informer and lister for -// EnvironmentRoleBindings. -type EnvironmentRoleBindingInformer interface { - Informer() cache.SharedIndexInformer - Lister() v4beta1.EnvironmentRoleBindingLister -} - -type environmentRoleBindingInformer struct { - factory internalinterfaces.SharedInformerFactory - tweakListOptions internalinterfaces.TweakListOptionsFunc - namespace string -} - -// NewEnvironmentRoleBindingInformer constructs a new informer for EnvironmentRoleBinding type. -// Always prefer using an informer factory to get a shared informer instead of getting an independent -// one. This reduces memory footprint and number of connections to the server. -func NewEnvironmentRoleBindingInformer(client versioned.Interface, namespace string, resyncPeriod time.Duration, indexers cache.Indexers) cache.SharedIndexInformer { - return NewFilteredEnvironmentRoleBindingInformer(client, namespace, resyncPeriod, indexers, nil) -} - -// NewFilteredEnvironmentRoleBindingInformer constructs a new informer for EnvironmentRoleBinding type. -// Always prefer using an informer factory to get a shared informer instead of getting an independent -// one. This reduces memory footprint and number of connections to the server. -func NewFilteredEnvironmentRoleBindingInformer(client versioned.Interface, namespace string, resyncPeriod time.Duration, indexers cache.Indexers, tweakListOptions internalinterfaces.TweakListOptionsFunc) cache.SharedIndexInformer { - return cache.NewSharedIndexInformer( - &cache.ListWatch{ - ListFunc: func(options v1.ListOptions) (runtime.Object, error) { - if tweakListOptions != nil { - tweakListOptions(&options) - } - return client.JenkinsV4beta1().EnvironmentRoleBindings(namespace).List(context.TODO(), options) - }, - WatchFunc: func(options v1.ListOptions) (watch.Interface, error) { - if tweakListOptions != nil { - tweakListOptions(&options) - } - return client.JenkinsV4beta1().EnvironmentRoleBindings(namespace).Watch(context.TODO(), options) - }, - }, - &jenkinsiov4beta1.EnvironmentRoleBinding{}, - resyncPeriod, - indexers, - ) -} - -func (f *environmentRoleBindingInformer) defaultInformer(client versioned.Interface, resyncPeriod time.Duration) cache.SharedIndexInformer { - return NewFilteredEnvironmentRoleBindingInformer(client, f.namespace, resyncPeriod, cache.Indexers{cache.NamespaceIndex: cache.MetaNamespaceIndexFunc}, f.tweakListOptions) -} - -func (f *environmentRoleBindingInformer) Informer() cache.SharedIndexInformer { - return f.factory.InformerFor(&jenkinsiov4beta1.EnvironmentRoleBinding{}, f.defaultInformer) -} - -func (f *environmentRoleBindingInformer) Lister() v4beta1.EnvironmentRoleBindingLister { - return v4beta1.NewEnvironmentRoleBindingLister(f.Informer().GetIndexer()) -} diff --git a/pkg/client/informers/externalversions/jenkins.io/v4beta1/extension.go b/pkg/client/informers/externalversions/jenkins.io/v4beta1/extension.go deleted file mode 100644 index cb1dedc..0000000 --- a/pkg/client/informers/externalversions/jenkins.io/v4beta1/extension.go +++ /dev/null @@ -1,89 +0,0 @@ -/* -Copyright 2020 The Jenkins X Authors. - -Licensed under the Apache License, Version 2.0 (the "License"); -you may not use this file except in compliance with the License. -You may obtain a copy of the License at - - http://www.apache.org/licenses/LICENSE-2.0 - -Unless required by applicable law or agreed to in writing, software -distributed under the License is distributed on an "AS IS" BASIS, -WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -See the License for the specific language governing permissions and -limitations under the License. -*/ -// Code generated by informer-gen. DO NOT EDIT. - -package v4beta1 - -import ( - "context" - time "time" - - jenkinsiov4beta1 "github.com/jenkins-x/jx-api/v4/pkg/apis/jenkins.io/v4beta1" - versioned "github.com/jenkins-x/jx-api/v4/pkg/client/clientset/versioned" - internalinterfaces "github.com/jenkins-x/jx-api/v4/pkg/client/informers/externalversions/internalinterfaces" - v4beta1 "github.com/jenkins-x/jx-api/v4/pkg/client/listers/jenkins.io/v4beta1" - v1 "k8s.io/apimachinery/pkg/apis/meta/v1" - runtime "k8s.io/apimachinery/pkg/runtime" - watch "k8s.io/apimachinery/pkg/watch" - cache "k8s.io/client-go/tools/cache" -) - -// ExtensionInformer provides access to a shared informer and lister for -// Extensions. -type ExtensionInformer interface { - Informer() cache.SharedIndexInformer - Lister() v4beta1.ExtensionLister -} - -type extensionInformer struct { - factory internalinterfaces.SharedInformerFactory - tweakListOptions internalinterfaces.TweakListOptionsFunc - namespace string -} - -// NewExtensionInformer constructs a new informer for Extension type. -// Always prefer using an informer factory to get a shared informer instead of getting an independent -// one. This reduces memory footprint and number of connections to the server. -func NewExtensionInformer(client versioned.Interface, namespace string, resyncPeriod time.Duration, indexers cache.Indexers) cache.SharedIndexInformer { - return NewFilteredExtensionInformer(client, namespace, resyncPeriod, indexers, nil) -} - -// NewFilteredExtensionInformer constructs a new informer for Extension type. -// Always prefer using an informer factory to get a shared informer instead of getting an independent -// one. This reduces memory footprint and number of connections to the server. -func NewFilteredExtensionInformer(client versioned.Interface, namespace string, resyncPeriod time.Duration, indexers cache.Indexers, tweakListOptions internalinterfaces.TweakListOptionsFunc) cache.SharedIndexInformer { - return cache.NewSharedIndexInformer( - &cache.ListWatch{ - ListFunc: func(options v1.ListOptions) (runtime.Object, error) { - if tweakListOptions != nil { - tweakListOptions(&options) - } - return client.JenkinsV4beta1().Extensions(namespace).List(context.TODO(), options) - }, - WatchFunc: func(options v1.ListOptions) (watch.Interface, error) { - if tweakListOptions != nil { - tweakListOptions(&options) - } - return client.JenkinsV4beta1().Extensions(namespace).Watch(context.TODO(), options) - }, - }, - &jenkinsiov4beta1.Extension{}, - resyncPeriod, - indexers, - ) -} - -func (f *extensionInformer) defaultInformer(client versioned.Interface, resyncPeriod time.Duration) cache.SharedIndexInformer { - return NewFilteredExtensionInformer(client, f.namespace, resyncPeriod, cache.Indexers{cache.NamespaceIndex: cache.MetaNamespaceIndexFunc}, f.tweakListOptions) -} - -func (f *extensionInformer) Informer() cache.SharedIndexInformer { - return f.factory.InformerFor(&jenkinsiov4beta1.Extension{}, f.defaultInformer) -} - -func (f *extensionInformer) Lister() v4beta1.ExtensionLister { - return v4beta1.NewExtensionLister(f.Informer().GetIndexer()) -} diff --git a/pkg/client/informers/externalversions/jenkins.io/v4beta1/gitservice.go b/pkg/client/informers/externalversions/jenkins.io/v4beta1/gitservice.go deleted file mode 100644 index c4962e8..0000000 --- a/pkg/client/informers/externalversions/jenkins.io/v4beta1/gitservice.go +++ /dev/null @@ -1,89 +0,0 @@ -/* -Copyright 2020 The Jenkins X Authors. - -Licensed under the Apache License, Version 2.0 (the "License"); -you may not use this file except in compliance with the License. -You may obtain a copy of the License at - - http://www.apache.org/licenses/LICENSE-2.0 - -Unless required by applicable law or agreed to in writing, software -distributed under the License is distributed on an "AS IS" BASIS, -WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -See the License for the specific language governing permissions and -limitations under the License. -*/ -// Code generated by informer-gen. DO NOT EDIT. - -package v4beta1 - -import ( - "context" - time "time" - - jenkinsiov4beta1 "github.com/jenkins-x/jx-api/v4/pkg/apis/jenkins.io/v4beta1" - versioned "github.com/jenkins-x/jx-api/v4/pkg/client/clientset/versioned" - internalinterfaces "github.com/jenkins-x/jx-api/v4/pkg/client/informers/externalversions/internalinterfaces" - v4beta1 "github.com/jenkins-x/jx-api/v4/pkg/client/listers/jenkins.io/v4beta1" - v1 "k8s.io/apimachinery/pkg/apis/meta/v1" - runtime "k8s.io/apimachinery/pkg/runtime" - watch "k8s.io/apimachinery/pkg/watch" - cache "k8s.io/client-go/tools/cache" -) - -// GitServiceInformer provides access to a shared informer and lister for -// GitServices. -type GitServiceInformer interface { - Informer() cache.SharedIndexInformer - Lister() v4beta1.GitServiceLister -} - -type gitServiceInformer struct { - factory internalinterfaces.SharedInformerFactory - tweakListOptions internalinterfaces.TweakListOptionsFunc - namespace string -} - -// NewGitServiceInformer constructs a new informer for GitService type. -// Always prefer using an informer factory to get a shared informer instead of getting an independent -// one. This reduces memory footprint and number of connections to the server. -func NewGitServiceInformer(client versioned.Interface, namespace string, resyncPeriod time.Duration, indexers cache.Indexers) cache.SharedIndexInformer { - return NewFilteredGitServiceInformer(client, namespace, resyncPeriod, indexers, nil) -} - -// NewFilteredGitServiceInformer constructs a new informer for GitService type. -// Always prefer using an informer factory to get a shared informer instead of getting an independent -// one. This reduces memory footprint and number of connections to the server. -func NewFilteredGitServiceInformer(client versioned.Interface, namespace string, resyncPeriod time.Duration, indexers cache.Indexers, tweakListOptions internalinterfaces.TweakListOptionsFunc) cache.SharedIndexInformer { - return cache.NewSharedIndexInformer( - &cache.ListWatch{ - ListFunc: func(options v1.ListOptions) (runtime.Object, error) { - if tweakListOptions != nil { - tweakListOptions(&options) - } - return client.JenkinsV4beta1().GitServices(namespace).List(context.TODO(), options) - }, - WatchFunc: func(options v1.ListOptions) (watch.Interface, error) { - if tweakListOptions != nil { - tweakListOptions(&options) - } - return client.JenkinsV4beta1().GitServices(namespace).Watch(context.TODO(), options) - }, - }, - &jenkinsiov4beta1.GitService{}, - resyncPeriod, - indexers, - ) -} - -func (f *gitServiceInformer) defaultInformer(client versioned.Interface, resyncPeriod time.Duration) cache.SharedIndexInformer { - return NewFilteredGitServiceInformer(client, f.namespace, resyncPeriod, cache.Indexers{cache.NamespaceIndex: cache.MetaNamespaceIndexFunc}, f.tweakListOptions) -} - -func (f *gitServiceInformer) Informer() cache.SharedIndexInformer { - return f.factory.InformerFor(&jenkinsiov4beta1.GitService{}, f.defaultInformer) -} - -func (f *gitServiceInformer) Lister() v4beta1.GitServiceLister { - return v4beta1.NewGitServiceLister(f.Informer().GetIndexer()) -} diff --git a/pkg/client/informers/externalversions/jenkins.io/v4beta1/sourcerepositorygroup.go b/pkg/client/informers/externalversions/jenkins.io/v4beta1/sourcerepositorygroup.go deleted file mode 100644 index 6ea147b..0000000 --- a/pkg/client/informers/externalversions/jenkins.io/v4beta1/sourcerepositorygroup.go +++ /dev/null @@ -1,89 +0,0 @@ -/* -Copyright 2020 The Jenkins X Authors. - -Licensed under the Apache License, Version 2.0 (the "License"); -you may not use this file except in compliance with the License. -You may obtain a copy of the License at - - http://www.apache.org/licenses/LICENSE-2.0 - -Unless required by applicable law or agreed to in writing, software -distributed under the License is distributed on an "AS IS" BASIS, -WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -See the License for the specific language governing permissions and -limitations under the License. -*/ -// Code generated by informer-gen. DO NOT EDIT. - -package v4beta1 - -import ( - "context" - time "time" - - jenkinsiov4beta1 "github.com/jenkins-x/jx-api/v4/pkg/apis/jenkins.io/v4beta1" - versioned "github.com/jenkins-x/jx-api/v4/pkg/client/clientset/versioned" - internalinterfaces "github.com/jenkins-x/jx-api/v4/pkg/client/informers/externalversions/internalinterfaces" - v4beta1 "github.com/jenkins-x/jx-api/v4/pkg/client/listers/jenkins.io/v4beta1" - v1 "k8s.io/apimachinery/pkg/apis/meta/v1" - runtime "k8s.io/apimachinery/pkg/runtime" - watch "k8s.io/apimachinery/pkg/watch" - cache "k8s.io/client-go/tools/cache" -) - -// SourceRepositoryGroupInformer provides access to a shared informer and lister for -// SourceRepositoryGroups. -type SourceRepositoryGroupInformer interface { - Informer() cache.SharedIndexInformer - Lister() v4beta1.SourceRepositoryGroupLister -} - -type sourceRepositoryGroupInformer struct { - factory internalinterfaces.SharedInformerFactory - tweakListOptions internalinterfaces.TweakListOptionsFunc - namespace string -} - -// NewSourceRepositoryGroupInformer constructs a new informer for SourceRepositoryGroup type. -// Always prefer using an informer factory to get a shared informer instead of getting an independent -// one. This reduces memory footprint and number of connections to the server. -func NewSourceRepositoryGroupInformer(client versioned.Interface, namespace string, resyncPeriod time.Duration, indexers cache.Indexers) cache.SharedIndexInformer { - return NewFilteredSourceRepositoryGroupInformer(client, namespace, resyncPeriod, indexers, nil) -} - -// NewFilteredSourceRepositoryGroupInformer constructs a new informer for SourceRepositoryGroup type. -// Always prefer using an informer factory to get a shared informer instead of getting an independent -// one. This reduces memory footprint and number of connections to the server. -func NewFilteredSourceRepositoryGroupInformer(client versioned.Interface, namespace string, resyncPeriod time.Duration, indexers cache.Indexers, tweakListOptions internalinterfaces.TweakListOptionsFunc) cache.SharedIndexInformer { - return cache.NewSharedIndexInformer( - &cache.ListWatch{ - ListFunc: func(options v1.ListOptions) (runtime.Object, error) { - if tweakListOptions != nil { - tweakListOptions(&options) - } - return client.JenkinsV4beta1().SourceRepositoryGroups(namespace).List(context.TODO(), options) - }, - WatchFunc: func(options v1.ListOptions) (watch.Interface, error) { - if tweakListOptions != nil { - tweakListOptions(&options) - } - return client.JenkinsV4beta1().SourceRepositoryGroups(namespace).Watch(context.TODO(), options) - }, - }, - &jenkinsiov4beta1.SourceRepositoryGroup{}, - resyncPeriod, - indexers, - ) -} - -func (f *sourceRepositoryGroupInformer) defaultInformer(client versioned.Interface, resyncPeriod time.Duration) cache.SharedIndexInformer { - return NewFilteredSourceRepositoryGroupInformer(client, f.namespace, resyncPeriod, cache.Indexers{cache.NamespaceIndex: cache.MetaNamespaceIndexFunc}, f.tweakListOptions) -} - -func (f *sourceRepositoryGroupInformer) Informer() cache.SharedIndexInformer { - return f.factory.InformerFor(&jenkinsiov4beta1.SourceRepositoryGroup{}, f.defaultInformer) -} - -func (f *sourceRepositoryGroupInformer) Lister() v4beta1.SourceRepositoryGroupLister { - return v4beta1.NewSourceRepositoryGroupLister(f.Informer().GetIndexer()) -} diff --git a/pkg/client/informers/externalversions/jenkins.io/v4beta1/team.go b/pkg/client/informers/externalversions/jenkins.io/v4beta1/team.go deleted file mode 100644 index 4fdb030..0000000 --- a/pkg/client/informers/externalversions/jenkins.io/v4beta1/team.go +++ /dev/null @@ -1,89 +0,0 @@ -/* -Copyright 2020 The Jenkins X Authors. - -Licensed under the Apache License, Version 2.0 (the "License"); -you may not use this file except in compliance with the License. -You may obtain a copy of the License at - - http://www.apache.org/licenses/LICENSE-2.0 - -Unless required by applicable law or agreed to in writing, software -distributed under the License is distributed on an "AS IS" BASIS, -WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -See the License for the specific language governing permissions and -limitations under the License. -*/ -// Code generated by informer-gen. DO NOT EDIT. - -package v4beta1 - -import ( - "context" - time "time" - - jenkinsiov4beta1 "github.com/jenkins-x/jx-api/v4/pkg/apis/jenkins.io/v4beta1" - versioned "github.com/jenkins-x/jx-api/v4/pkg/client/clientset/versioned" - internalinterfaces "github.com/jenkins-x/jx-api/v4/pkg/client/informers/externalversions/internalinterfaces" - v4beta1 "github.com/jenkins-x/jx-api/v4/pkg/client/listers/jenkins.io/v4beta1" - v1 "k8s.io/apimachinery/pkg/apis/meta/v1" - runtime "k8s.io/apimachinery/pkg/runtime" - watch "k8s.io/apimachinery/pkg/watch" - cache "k8s.io/client-go/tools/cache" -) - -// TeamInformer provides access to a shared informer and lister for -// Teams. -type TeamInformer interface { - Informer() cache.SharedIndexInformer - Lister() v4beta1.TeamLister -} - -type teamInformer struct { - factory internalinterfaces.SharedInformerFactory - tweakListOptions internalinterfaces.TweakListOptionsFunc - namespace string -} - -// NewTeamInformer constructs a new informer for Team type. -// Always prefer using an informer factory to get a shared informer instead of getting an independent -// one. This reduces memory footprint and number of connections to the server. -func NewTeamInformer(client versioned.Interface, namespace string, resyncPeriod time.Duration, indexers cache.Indexers) cache.SharedIndexInformer { - return NewFilteredTeamInformer(client, namespace, resyncPeriod, indexers, nil) -} - -// NewFilteredTeamInformer constructs a new informer for Team type. -// Always prefer using an informer factory to get a shared informer instead of getting an independent -// one. This reduces memory footprint and number of connections to the server. -func NewFilteredTeamInformer(client versioned.Interface, namespace string, resyncPeriod time.Duration, indexers cache.Indexers, tweakListOptions internalinterfaces.TweakListOptionsFunc) cache.SharedIndexInformer { - return cache.NewSharedIndexInformer( - &cache.ListWatch{ - ListFunc: func(options v1.ListOptions) (runtime.Object, error) { - if tweakListOptions != nil { - tweakListOptions(&options) - } - return client.JenkinsV4beta1().Teams(namespace).List(context.TODO(), options) - }, - WatchFunc: func(options v1.ListOptions) (watch.Interface, error) { - if tweakListOptions != nil { - tweakListOptions(&options) - } - return client.JenkinsV4beta1().Teams(namespace).Watch(context.TODO(), options) - }, - }, - &jenkinsiov4beta1.Team{}, - resyncPeriod, - indexers, - ) -} - -func (f *teamInformer) defaultInformer(client versioned.Interface, resyncPeriod time.Duration) cache.SharedIndexInformer { - return NewFilteredTeamInformer(client, f.namespace, resyncPeriod, cache.Indexers{cache.NamespaceIndex: cache.MetaNamespaceIndexFunc}, f.tweakListOptions) -} - -func (f *teamInformer) Informer() cache.SharedIndexInformer { - return f.factory.InformerFor(&jenkinsiov4beta1.Team{}, f.defaultInformer) -} - -func (f *teamInformer) Lister() v4beta1.TeamLister { - return v4beta1.NewTeamLister(f.Informer().GetIndexer()) -} diff --git a/pkg/client/informers/externalversions/jenkins.io/v4beta1/user.go b/pkg/client/informers/externalversions/jenkins.io/v4beta1/user.go deleted file mode 100644 index 8c52e44..0000000 --- a/pkg/client/informers/externalversions/jenkins.io/v4beta1/user.go +++ /dev/null @@ -1,89 +0,0 @@ -/* -Copyright 2020 The Jenkins X Authors. - -Licensed under the Apache License, Version 2.0 (the "License"); -you may not use this file except in compliance with the License. -You may obtain a copy of the License at - - http://www.apache.org/licenses/LICENSE-2.0 - -Unless required by applicable law or agreed to in writing, software -distributed under the License is distributed on an "AS IS" BASIS, -WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -See the License for the specific language governing permissions and -limitations under the License. -*/ -// Code generated by informer-gen. DO NOT EDIT. - -package v4beta1 - -import ( - "context" - time "time" - - jenkinsiov4beta1 "github.com/jenkins-x/jx-api/v4/pkg/apis/jenkins.io/v4beta1" - versioned "github.com/jenkins-x/jx-api/v4/pkg/client/clientset/versioned" - internalinterfaces "github.com/jenkins-x/jx-api/v4/pkg/client/informers/externalversions/internalinterfaces" - v4beta1 "github.com/jenkins-x/jx-api/v4/pkg/client/listers/jenkins.io/v4beta1" - v1 "k8s.io/apimachinery/pkg/apis/meta/v1" - runtime "k8s.io/apimachinery/pkg/runtime" - watch "k8s.io/apimachinery/pkg/watch" - cache "k8s.io/client-go/tools/cache" -) - -// UserInformer provides access to a shared informer and lister for -// Users. -type UserInformer interface { - Informer() cache.SharedIndexInformer - Lister() v4beta1.UserLister -} - -type userInformer struct { - factory internalinterfaces.SharedInformerFactory - tweakListOptions internalinterfaces.TweakListOptionsFunc - namespace string -} - -// NewUserInformer constructs a new informer for User type. -// Always prefer using an informer factory to get a shared informer instead of getting an independent -// one. This reduces memory footprint and number of connections to the server. -func NewUserInformer(client versioned.Interface, namespace string, resyncPeriod time.Duration, indexers cache.Indexers) cache.SharedIndexInformer { - return NewFilteredUserInformer(client, namespace, resyncPeriod, indexers, nil) -} - -// NewFilteredUserInformer constructs a new informer for User type. -// Always prefer using an informer factory to get a shared informer instead of getting an independent -// one. This reduces memory footprint and number of connections to the server. -func NewFilteredUserInformer(client versioned.Interface, namespace string, resyncPeriod time.Duration, indexers cache.Indexers, tweakListOptions internalinterfaces.TweakListOptionsFunc) cache.SharedIndexInformer { - return cache.NewSharedIndexInformer( - &cache.ListWatch{ - ListFunc: func(options v1.ListOptions) (runtime.Object, error) { - if tweakListOptions != nil { - tweakListOptions(&options) - } - return client.JenkinsV4beta1().Users(namespace).List(context.TODO(), options) - }, - WatchFunc: func(options v1.ListOptions) (watch.Interface, error) { - if tweakListOptions != nil { - tweakListOptions(&options) - } - return client.JenkinsV4beta1().Users(namespace).Watch(context.TODO(), options) - }, - }, - &jenkinsiov4beta1.User{}, - resyncPeriod, - indexers, - ) -} - -func (f *userInformer) defaultInformer(client versioned.Interface, resyncPeriod time.Duration) cache.SharedIndexInformer { - return NewFilteredUserInformer(client, f.namespace, resyncPeriod, cache.Indexers{cache.NamespaceIndex: cache.MetaNamespaceIndexFunc}, f.tweakListOptions) -} - -func (f *userInformer) Informer() cache.SharedIndexInformer { - return f.factory.InformerFor(&jenkinsiov4beta1.User{}, f.defaultInformer) -} - -func (f *userInformer) Lister() v4beta1.UserLister { - return v4beta1.NewUserLister(f.Informer().GetIndexer()) -} diff --git a/pkg/client/listers/jenkins.io/v4beta1/environment.go b/pkg/client/listers/core/v4beta1/environment.go similarity index 98% rename from pkg/client/listers/jenkins.io/v4beta1/environment.go rename to pkg/client/listers/core/v4beta1/environment.go index 3625b80..a1cf64e 100644 --- a/pkg/client/listers/jenkins.io/v4beta1/environment.go +++ b/pkg/client/listers/core/v4beta1/environment.go @@ -18,7 +18,7 @@ limitations under the License. package v4beta1 import ( - v4beta1 "github.com/jenkins-x/jx-api/v4/pkg/apis/jenkins.io/v4beta1" + v4beta1 "github.com/jenkins-x/jx-api/v4/pkg/apis/core/v4beta1" "k8s.io/apimachinery/pkg/api/errors" "k8s.io/apimachinery/pkg/labels" "k8s.io/client-go/tools/cache" diff --git a/pkg/client/listers/core/v4beta1/expansion_generated.go b/pkg/client/listers/core/v4beta1/expansion_generated.go new file mode 100644 index 0000000..8c1dd05 --- /dev/null +++ b/pkg/client/listers/core/v4beta1/expansion_generated.go @@ -0,0 +1,58 @@ +/* +Copyright 2020 The Jenkins X 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 lister-gen. DO NOT EDIT. + +package v4beta1 + +// EnvironmentListerExpansion allows custom methods to be added to +// EnvironmentLister. +type EnvironmentListerExpansion interface{} + +// EnvironmentNamespaceListerExpansion allows custom methods to be added to +// EnvironmentNamespaceLister. +type EnvironmentNamespaceListerExpansion interface{} + +// PipelineActivityListerExpansion allows custom methods to be added to +// PipelineActivityLister. +type PipelineActivityListerExpansion interface{} + +// PipelineActivityNamespaceListerExpansion allows custom methods to be added to +// PipelineActivityNamespaceLister. +type PipelineActivityNamespaceListerExpansion interface{} + +// PluginListerExpansion allows custom methods to be added to +// PluginLister. +type PluginListerExpansion interface{} + +// PluginNamespaceListerExpansion allows custom methods to be added to +// PluginNamespaceLister. +type PluginNamespaceListerExpansion interface{} + +// ReleaseListerExpansion allows custom methods to be added to +// ReleaseLister. +type ReleaseListerExpansion interface{} + +// ReleaseNamespaceListerExpansion allows custom methods to be added to +// ReleaseNamespaceLister. +type ReleaseNamespaceListerExpansion interface{} + +// SourceRepositoryListerExpansion allows custom methods to be added to +// SourceRepositoryLister. +type SourceRepositoryListerExpansion interface{} + +// SourceRepositoryNamespaceListerExpansion allows custom methods to be added to +// SourceRepositoryNamespaceLister. +type SourceRepositoryNamespaceListerExpansion interface{} diff --git a/pkg/client/listers/jenkins.io/v4beta1/pipelineactivity.go b/pkg/client/listers/core/v4beta1/pipelineactivity.go similarity index 98% rename from pkg/client/listers/jenkins.io/v4beta1/pipelineactivity.go rename to pkg/client/listers/core/v4beta1/pipelineactivity.go index a531ccd..693c9ec 100644 --- a/pkg/client/listers/jenkins.io/v4beta1/pipelineactivity.go +++ b/pkg/client/listers/core/v4beta1/pipelineactivity.go @@ -18,7 +18,7 @@ limitations under the License. package v4beta1 import ( - v4beta1 "github.com/jenkins-x/jx-api/v4/pkg/apis/jenkins.io/v4beta1" + v4beta1 "github.com/jenkins-x/jx-api/v4/pkg/apis/core/v4beta1" "k8s.io/apimachinery/pkg/api/errors" "k8s.io/apimachinery/pkg/labels" "k8s.io/client-go/tools/cache" diff --git a/pkg/client/listers/jenkins.io/v4beta1/plugin.go b/pkg/client/listers/core/v4beta1/plugin.go similarity index 97% rename from pkg/client/listers/jenkins.io/v4beta1/plugin.go rename to pkg/client/listers/core/v4beta1/plugin.go index 0f6769f..c18a712 100644 --- a/pkg/client/listers/jenkins.io/v4beta1/plugin.go +++ b/pkg/client/listers/core/v4beta1/plugin.go @@ -18,7 +18,7 @@ limitations under the License. package v4beta1 import ( - v4beta1 "github.com/jenkins-x/jx-api/v4/pkg/apis/jenkins.io/v4beta1" + v4beta1 "github.com/jenkins-x/jx-api/v4/pkg/apis/core/v4beta1" "k8s.io/apimachinery/pkg/api/errors" "k8s.io/apimachinery/pkg/labels" "k8s.io/client-go/tools/cache" diff --git a/pkg/client/listers/jenkins.io/v4beta1/release.go b/pkg/client/listers/core/v4beta1/release.go similarity index 97% rename from pkg/client/listers/jenkins.io/v4beta1/release.go rename to pkg/client/listers/core/v4beta1/release.go index 6154c59..37d8c50 100644 --- a/pkg/client/listers/jenkins.io/v4beta1/release.go +++ b/pkg/client/listers/core/v4beta1/release.go @@ -18,7 +18,7 @@ limitations under the License. package v4beta1 import ( - v4beta1 "github.com/jenkins-x/jx-api/v4/pkg/apis/jenkins.io/v4beta1" + v4beta1 "github.com/jenkins-x/jx-api/v4/pkg/apis/core/v4beta1" "k8s.io/apimachinery/pkg/api/errors" "k8s.io/apimachinery/pkg/labels" "k8s.io/client-go/tools/cache" diff --git a/pkg/client/listers/jenkins.io/v4beta1/sourcerepository.go b/pkg/client/listers/core/v4beta1/sourcerepository.go similarity index 98% rename from pkg/client/listers/jenkins.io/v4beta1/sourcerepository.go rename to pkg/client/listers/core/v4beta1/sourcerepository.go index 3045c04..f759931 100644 --- a/pkg/client/listers/jenkins.io/v4beta1/sourcerepository.go +++ b/pkg/client/listers/core/v4beta1/sourcerepository.go @@ -18,7 +18,7 @@ limitations under the License. package v4beta1 import ( - v4beta1 "github.com/jenkins-x/jx-api/v4/pkg/apis/jenkins.io/v4beta1" + v4beta1 "github.com/jenkins-x/jx-api/v4/pkg/apis/core/v4beta1" "k8s.io/apimachinery/pkg/api/errors" "k8s.io/apimachinery/pkg/labels" "k8s.io/client-go/tools/cache" diff --git a/pkg/client/listers/jenkins.io/v4beta1/app.go b/pkg/client/listers/jenkins.io/v4beta1/app.go deleted file mode 100644 index 1dce696..0000000 --- a/pkg/client/listers/jenkins.io/v4beta1/app.go +++ /dev/null @@ -1,98 +0,0 @@ -/* -Copyright 2020 The Jenkins X 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 lister-gen. DO NOT EDIT. - -package v4beta1 - -import ( - v4beta1 "github.com/jenkins-x/jx-api/v4/pkg/apis/jenkins.io/v4beta1" - "k8s.io/apimachinery/pkg/api/errors" - "k8s.io/apimachinery/pkg/labels" - "k8s.io/client-go/tools/cache" -) - -// AppLister helps list Apps. -// All objects returned here must be treated as read-only. -type AppLister interface { - // List lists all Apps in the indexer. - // Objects returned here must be treated as read-only. - List(selector labels.Selector) (ret []*v4beta1.App, err error) - // Apps returns an object that can list and get Apps. - Apps(namespace string) AppNamespaceLister - AppListerExpansion -} - -// appLister implements the AppLister interface. -type appLister struct { - indexer cache.Indexer -} - -// NewAppLister returns a new AppLister. -func NewAppLister(indexer cache.Indexer) AppLister { - return &appLister{indexer: indexer} -} - -// List lists all Apps in the indexer. -func (s *appLister) List(selector labels.Selector) (ret []*v4beta1.App, err error) { - err = cache.ListAll(s.indexer, selector, func(m interface{}) { - ret = append(ret, m.(*v4beta1.App)) - }) - return ret, err -} - -// Apps returns an object that can list and get Apps. -func (s *appLister) Apps(namespace string) AppNamespaceLister { - return appNamespaceLister{indexer: s.indexer, namespace: namespace} -} - -// AppNamespaceLister helps list and get Apps. -// All objects returned here must be treated as read-only. -type AppNamespaceLister interface { - // List lists all Apps in the indexer for a given namespace. - // Objects returned here must be treated as read-only. - List(selector labels.Selector) (ret []*v4beta1.App, err error) - // Get retrieves the App from the indexer for a given namespace and name. - // Objects returned here must be treated as read-only. - Get(name string) (*v4beta1.App, error) - AppNamespaceListerExpansion -} - -// appNamespaceLister implements the AppNamespaceLister -// interface. -type appNamespaceLister struct { - indexer cache.Indexer - namespace string -} - -// List lists all Apps in the indexer for a given namespace. -func (s appNamespaceLister) List(selector labels.Selector) (ret []*v4beta1.App, err error) { - err = cache.ListAllByNamespace(s.indexer, s.namespace, selector, func(m interface{}) { - ret = append(ret, m.(*v4beta1.App)) - }) - return ret, err -} - -// Get retrieves the App from the indexer for a given namespace and name. -func (s appNamespaceLister) Get(name string) (*v4beta1.App, error) { - obj, exists, err := s.indexer.GetByKey(s.namespace + "/" + name) - if err != nil { - return nil, err - } - if !exists { - return nil, errors.NewNotFound(v4beta1.Resource("app"), name) - } - return obj.(*v4beta1.App), nil -} diff --git a/pkg/client/listers/jenkins.io/v4beta1/buildpack.go b/pkg/client/listers/jenkins.io/v4beta1/buildpack.go deleted file mode 100644 index 2d7d8dd..0000000 --- a/pkg/client/listers/jenkins.io/v4beta1/buildpack.go +++ /dev/null @@ -1,98 +0,0 @@ -/* -Copyright 2020 The Jenkins X 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 lister-gen. DO NOT EDIT. - -package v4beta1 - -import ( - v4beta1 "github.com/jenkins-x/jx-api/v4/pkg/apis/jenkins.io/v4beta1" - "k8s.io/apimachinery/pkg/api/errors" - "k8s.io/apimachinery/pkg/labels" - "k8s.io/client-go/tools/cache" -) - -// BuildPackLister helps list BuildPacks. -// All objects returned here must be treated as read-only. -type BuildPackLister interface { - // List lists all BuildPacks in the indexer. - // Objects returned here must be treated as read-only. - List(selector labels.Selector) (ret []*v4beta1.BuildPack, err error) - // BuildPacks returns an object that can list and get BuildPacks. - BuildPacks(namespace string) BuildPackNamespaceLister - BuildPackListerExpansion -} - -// buildPackLister implements the BuildPackLister interface. -type buildPackLister struct { - indexer cache.Indexer -} - -// NewBuildPackLister returns a new BuildPackLister. -func NewBuildPackLister(indexer cache.Indexer) BuildPackLister { - return &buildPackLister{indexer: indexer} -} - -// List lists all BuildPacks in the indexer. -func (s *buildPackLister) List(selector labels.Selector) (ret []*v4beta1.BuildPack, err error) { - err = cache.ListAll(s.indexer, selector, func(m interface{}) { - ret = append(ret, m.(*v4beta1.BuildPack)) - }) - return ret, err -} - -// BuildPacks returns an object that can list and get BuildPacks. -func (s *buildPackLister) BuildPacks(namespace string) BuildPackNamespaceLister { - return buildPackNamespaceLister{indexer: s.indexer, namespace: namespace} -} - -// BuildPackNamespaceLister helps list and get BuildPacks. -// All objects returned here must be treated as read-only. -type BuildPackNamespaceLister interface { - // List lists all BuildPacks in the indexer for a given namespace. - // Objects returned here must be treated as read-only. - List(selector labels.Selector) (ret []*v4beta1.BuildPack, err error) - // Get retrieves the BuildPack from the indexer for a given namespace and name. - // Objects returned here must be treated as read-only. - Get(name string) (*v4beta1.BuildPack, error) - BuildPackNamespaceListerExpansion -} - -// buildPackNamespaceLister implements the BuildPackNamespaceLister -// interface. -type buildPackNamespaceLister struct { - indexer cache.Indexer - namespace string -} - -// List lists all BuildPacks in the indexer for a given namespace. -func (s buildPackNamespaceLister) List(selector labels.Selector) (ret []*v4beta1.BuildPack, err error) { - err = cache.ListAllByNamespace(s.indexer, s.namespace, selector, func(m interface{}) { - ret = append(ret, m.(*v4beta1.BuildPack)) - }) - return ret, err -} - -// Get retrieves the BuildPack from the indexer for a given namespace and name. -func (s buildPackNamespaceLister) Get(name string) (*v4beta1.BuildPack, error) { - obj, exists, err := s.indexer.GetByKey(s.namespace + "/" + name) - if err != nil { - return nil, err - } - if !exists { - return nil, errors.NewNotFound(v4beta1.Resource("buildpack"), name) - } - return obj.(*v4beta1.BuildPack), nil -} diff --git a/pkg/client/listers/jenkins.io/v4beta1/commitstatus.go b/pkg/client/listers/jenkins.io/v4beta1/commitstatus.go deleted file mode 100644 index ebd3b04..0000000 --- a/pkg/client/listers/jenkins.io/v4beta1/commitstatus.go +++ /dev/null @@ -1,98 +0,0 @@ -/* -Copyright 2020 The Jenkins X 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 lister-gen. DO NOT EDIT. - -package v4beta1 - -import ( - v4beta1 "github.com/jenkins-x/jx-api/v4/pkg/apis/jenkins.io/v4beta1" - "k8s.io/apimachinery/pkg/api/errors" - "k8s.io/apimachinery/pkg/labels" - "k8s.io/client-go/tools/cache" -) - -// CommitStatusLister helps list CommitStatuses. -// All objects returned here must be treated as read-only. -type CommitStatusLister interface { - // List lists all CommitStatuses in the indexer. - // Objects returned here must be treated as read-only. - List(selector labels.Selector) (ret []*v4beta1.CommitStatus, err error) - // CommitStatuses returns an object that can list and get CommitStatuses. - CommitStatuses(namespace string) CommitStatusNamespaceLister - CommitStatusListerExpansion -} - -// commitStatusLister implements the CommitStatusLister interface. -type commitStatusLister struct { - indexer cache.Indexer -} - -// NewCommitStatusLister returns a new CommitStatusLister. -func NewCommitStatusLister(indexer cache.Indexer) CommitStatusLister { - return &commitStatusLister{indexer: indexer} -} - -// List lists all CommitStatuses in the indexer. -func (s *commitStatusLister) List(selector labels.Selector) (ret []*v4beta1.CommitStatus, err error) { - err = cache.ListAll(s.indexer, selector, func(m interface{}) { - ret = append(ret, m.(*v4beta1.CommitStatus)) - }) - return ret, err -} - -// CommitStatuses returns an object that can list and get CommitStatuses. -func (s *commitStatusLister) CommitStatuses(namespace string) CommitStatusNamespaceLister { - return commitStatusNamespaceLister{indexer: s.indexer, namespace: namespace} -} - -// CommitStatusNamespaceLister helps list and get CommitStatuses. -// All objects returned here must be treated as read-only. -type CommitStatusNamespaceLister interface { - // List lists all CommitStatuses in the indexer for a given namespace. - // Objects returned here must be treated as read-only. - List(selector labels.Selector) (ret []*v4beta1.CommitStatus, err error) - // Get retrieves the CommitStatus from the indexer for a given namespace and name. - // Objects returned here must be treated as read-only. - Get(name string) (*v4beta1.CommitStatus, error) - CommitStatusNamespaceListerExpansion -} - -// commitStatusNamespaceLister implements the CommitStatusNamespaceLister -// interface. -type commitStatusNamespaceLister struct { - indexer cache.Indexer - namespace string -} - -// List lists all CommitStatuses in the indexer for a given namespace. -func (s commitStatusNamespaceLister) List(selector labels.Selector) (ret []*v4beta1.CommitStatus, err error) { - err = cache.ListAllByNamespace(s.indexer, s.namespace, selector, func(m interface{}) { - ret = append(ret, m.(*v4beta1.CommitStatus)) - }) - return ret, err -} - -// Get retrieves the CommitStatus from the indexer for a given namespace and name. -func (s commitStatusNamespaceLister) Get(name string) (*v4beta1.CommitStatus, error) { - obj, exists, err := s.indexer.GetByKey(s.namespace + "/" + name) - if err != nil { - return nil, err - } - if !exists { - return nil, errors.NewNotFound(v4beta1.Resource("commitstatus"), name) - } - return obj.(*v4beta1.CommitStatus), nil -} diff --git a/pkg/client/listers/jenkins.io/v4beta1/environmentrolebinding.go b/pkg/client/listers/jenkins.io/v4beta1/environmentrolebinding.go deleted file mode 100644 index 9ec65bf..0000000 --- a/pkg/client/listers/jenkins.io/v4beta1/environmentrolebinding.go +++ /dev/null @@ -1,98 +0,0 @@ -/* -Copyright 2020 The Jenkins X 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 lister-gen. DO NOT EDIT. - -package v4beta1 - -import ( - v4beta1 "github.com/jenkins-x/jx-api/v4/pkg/apis/jenkins.io/v4beta1" - "k8s.io/apimachinery/pkg/api/errors" - "k8s.io/apimachinery/pkg/labels" - "k8s.io/client-go/tools/cache" -) - -// EnvironmentRoleBindingLister helps list EnvironmentRoleBindings. -// All objects returned here must be treated as read-only. -type EnvironmentRoleBindingLister interface { - // List lists all EnvironmentRoleBindings in the indexer. - // Objects returned here must be treated as read-only. - List(selector labels.Selector) (ret []*v4beta1.EnvironmentRoleBinding, err error) - // EnvironmentRoleBindings returns an object that can list and get EnvironmentRoleBindings. - EnvironmentRoleBindings(namespace string) EnvironmentRoleBindingNamespaceLister - EnvironmentRoleBindingListerExpansion -} - -// environmentRoleBindingLister implements the EnvironmentRoleBindingLister interface. -type environmentRoleBindingLister struct { - indexer cache.Indexer -} - -// NewEnvironmentRoleBindingLister returns a new EnvironmentRoleBindingLister. -func NewEnvironmentRoleBindingLister(indexer cache.Indexer) EnvironmentRoleBindingLister { - return &environmentRoleBindingLister{indexer: indexer} -} - -// List lists all EnvironmentRoleBindings in the indexer. -func (s *environmentRoleBindingLister) List(selector labels.Selector) (ret []*v4beta1.EnvironmentRoleBinding, err error) { - err = cache.ListAll(s.indexer, selector, func(m interface{}) { - ret = append(ret, m.(*v4beta1.EnvironmentRoleBinding)) - }) - return ret, err -} - -// EnvironmentRoleBindings returns an object that can list and get EnvironmentRoleBindings. -func (s *environmentRoleBindingLister) EnvironmentRoleBindings(namespace string) EnvironmentRoleBindingNamespaceLister { - return environmentRoleBindingNamespaceLister{indexer: s.indexer, namespace: namespace} -} - -// EnvironmentRoleBindingNamespaceLister helps list and get EnvironmentRoleBindings. -// All objects returned here must be treated as read-only. -type EnvironmentRoleBindingNamespaceLister interface { - // List lists all EnvironmentRoleBindings in the indexer for a given namespace. - // Objects returned here must be treated as read-only. - List(selector labels.Selector) (ret []*v4beta1.EnvironmentRoleBinding, err error) - // Get retrieves the EnvironmentRoleBinding from the indexer for a given namespace and name. - // Objects returned here must be treated as read-only. - Get(name string) (*v4beta1.EnvironmentRoleBinding, error) - EnvironmentRoleBindingNamespaceListerExpansion -} - -// environmentRoleBindingNamespaceLister implements the EnvironmentRoleBindingNamespaceLister -// interface. -type environmentRoleBindingNamespaceLister struct { - indexer cache.Indexer - namespace string -} - -// List lists all EnvironmentRoleBindings in the indexer for a given namespace. -func (s environmentRoleBindingNamespaceLister) List(selector labels.Selector) (ret []*v4beta1.EnvironmentRoleBinding, err error) { - err = cache.ListAllByNamespace(s.indexer, s.namespace, selector, func(m interface{}) { - ret = append(ret, m.(*v4beta1.EnvironmentRoleBinding)) - }) - return ret, err -} - -// Get retrieves the EnvironmentRoleBinding from the indexer for a given namespace and name. -func (s environmentRoleBindingNamespaceLister) Get(name string) (*v4beta1.EnvironmentRoleBinding, error) { - obj, exists, err := s.indexer.GetByKey(s.namespace + "/" + name) - if err != nil { - return nil, err - } - if !exists { - return nil, errors.NewNotFound(v4beta1.Resource("environmentrolebinding"), name) - } - return obj.(*v4beta1.EnvironmentRoleBinding), nil -} diff --git a/pkg/client/listers/jenkins.io/v4beta1/expansion_generated.go b/pkg/client/listers/jenkins.io/v4beta1/expansion_generated.go deleted file mode 100644 index 796bce4..0000000 --- a/pkg/client/listers/jenkins.io/v4beta1/expansion_generated.go +++ /dev/null @@ -1,130 +0,0 @@ -/* -Copyright 2020 The Jenkins X 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 lister-gen. DO NOT EDIT. - -package v4beta1 - -// AppListerExpansion allows custom methods to be added to -// AppLister. -type AppListerExpansion interface{} - -// AppNamespaceListerExpansion allows custom methods to be added to -// AppNamespaceLister. -type AppNamespaceListerExpansion interface{} - -// BuildPackListerExpansion allows custom methods to be added to -// BuildPackLister. -type BuildPackListerExpansion interface{} - -// BuildPackNamespaceListerExpansion allows custom methods to be added to -// BuildPackNamespaceLister. -type BuildPackNamespaceListerExpansion interface{} - -// CommitStatusListerExpansion allows custom methods to be added to -// CommitStatusLister. -type CommitStatusListerExpansion interface{} - -// CommitStatusNamespaceListerExpansion allows custom methods to be added to -// CommitStatusNamespaceLister. -type CommitStatusNamespaceListerExpansion interface{} - -// EnvironmentListerExpansion allows custom methods to be added to -// EnvironmentLister. -type EnvironmentListerExpansion interface{} - -// EnvironmentNamespaceListerExpansion allows custom methods to be added to -// EnvironmentNamespaceLister. -type EnvironmentNamespaceListerExpansion interface{} - -// EnvironmentRoleBindingListerExpansion allows custom methods to be added to -// EnvironmentRoleBindingLister. -type EnvironmentRoleBindingListerExpansion interface{} - -// EnvironmentRoleBindingNamespaceListerExpansion allows custom methods to be added to -// EnvironmentRoleBindingNamespaceLister. -type EnvironmentRoleBindingNamespaceListerExpansion interface{} - -// ExtensionListerExpansion allows custom methods to be added to -// ExtensionLister. -type ExtensionListerExpansion interface{} - -// ExtensionNamespaceListerExpansion allows custom methods to be added to -// ExtensionNamespaceLister. -type ExtensionNamespaceListerExpansion interface{} - -// GitServiceListerExpansion allows custom methods to be added to -// GitServiceLister. -type GitServiceListerExpansion interface{} - -// GitServiceNamespaceListerExpansion allows custom methods to be added to -// GitServiceNamespaceLister. -type GitServiceNamespaceListerExpansion interface{} - -// PipelineActivityListerExpansion allows custom methods to be added to -// PipelineActivityLister. -type PipelineActivityListerExpansion interface{} - -// PipelineActivityNamespaceListerExpansion allows custom methods to be added to -// PipelineActivityNamespaceLister. -type PipelineActivityNamespaceListerExpansion interface{} - -// PluginListerExpansion allows custom methods to be added to -// PluginLister. -type PluginListerExpansion interface{} - -// PluginNamespaceListerExpansion allows custom methods to be added to -// PluginNamespaceLister. -type PluginNamespaceListerExpansion interface{} - -// ReleaseListerExpansion allows custom methods to be added to -// ReleaseLister. -type ReleaseListerExpansion interface{} - -// ReleaseNamespaceListerExpansion allows custom methods to be added to -// ReleaseNamespaceLister. -type ReleaseNamespaceListerExpansion interface{} - -// SourceRepositoryListerExpansion allows custom methods to be added to -// SourceRepositoryLister. -type SourceRepositoryListerExpansion interface{} - -// SourceRepositoryNamespaceListerExpansion allows custom methods to be added to -// SourceRepositoryNamespaceLister. -type SourceRepositoryNamespaceListerExpansion interface{} - -// SourceRepositoryGroupListerExpansion allows custom methods to be added to -// SourceRepositoryGroupLister. -type SourceRepositoryGroupListerExpansion interface{} - -// SourceRepositoryGroupNamespaceListerExpansion allows custom methods to be added to -// SourceRepositoryGroupNamespaceLister. -type SourceRepositoryGroupNamespaceListerExpansion interface{} - -// TeamListerExpansion allows custom methods to be added to -// TeamLister. -type TeamListerExpansion interface{} - -// TeamNamespaceListerExpansion allows custom methods to be added to -// TeamNamespaceLister. -type TeamNamespaceListerExpansion interface{} - -// UserListerExpansion allows custom methods to be added to -// UserLister. -type UserListerExpansion interface{} - -// UserNamespaceListerExpansion allows custom methods to be added to -// UserNamespaceLister. -type UserNamespaceListerExpansion interface{} diff --git a/pkg/client/listers/jenkins.io/v4beta1/extension.go b/pkg/client/listers/jenkins.io/v4beta1/extension.go deleted file mode 100644 index afaf803..0000000 --- a/pkg/client/listers/jenkins.io/v4beta1/extension.go +++ /dev/null @@ -1,98 +0,0 @@ -/* -Copyright 2020 The Jenkins X 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 lister-gen. DO NOT EDIT. - -package v4beta1 - -import ( - v4beta1 "github.com/jenkins-x/jx-api/v4/pkg/apis/jenkins.io/v4beta1" - "k8s.io/apimachinery/pkg/api/errors" - "k8s.io/apimachinery/pkg/labels" - "k8s.io/client-go/tools/cache" -) - -// ExtensionLister helps list Extensions. -// All objects returned here must be treated as read-only. -type ExtensionLister interface { - // List lists all Extensions in the indexer. - // Objects returned here must be treated as read-only. - List(selector labels.Selector) (ret []*v4beta1.Extension, err error) - // Extensions returns an object that can list and get Extensions. - Extensions(namespace string) ExtensionNamespaceLister - ExtensionListerExpansion -} - -// extensionLister implements the ExtensionLister interface. -type extensionLister struct { - indexer cache.Indexer -} - -// NewExtensionLister returns a new ExtensionLister. -func NewExtensionLister(indexer cache.Indexer) ExtensionLister { - return &extensionLister{indexer: indexer} -} - -// List lists all Extensions in the indexer. -func (s *extensionLister) List(selector labels.Selector) (ret []*v4beta1.Extension, err error) { - err = cache.ListAll(s.indexer, selector, func(m interface{}) { - ret = append(ret, m.(*v4beta1.Extension)) - }) - return ret, err -} - -// Extensions returns an object that can list and get Extensions. -func (s *extensionLister) Extensions(namespace string) ExtensionNamespaceLister { - return extensionNamespaceLister{indexer: s.indexer, namespace: namespace} -} - -// ExtensionNamespaceLister helps list and get Extensions. -// All objects returned here must be treated as read-only. -type ExtensionNamespaceLister interface { - // List lists all Extensions in the indexer for a given namespace. - // Objects returned here must be treated as read-only. - List(selector labels.Selector) (ret []*v4beta1.Extension, err error) - // Get retrieves the Extension from the indexer for a given namespace and name. - // Objects returned here must be treated as read-only. - Get(name string) (*v4beta1.Extension, error) - ExtensionNamespaceListerExpansion -} - -// extensionNamespaceLister implements the ExtensionNamespaceLister -// interface. -type extensionNamespaceLister struct { - indexer cache.Indexer - namespace string -} - -// List lists all Extensions in the indexer for a given namespace. -func (s extensionNamespaceLister) List(selector labels.Selector) (ret []*v4beta1.Extension, err error) { - err = cache.ListAllByNamespace(s.indexer, s.namespace, selector, func(m interface{}) { - ret = append(ret, m.(*v4beta1.Extension)) - }) - return ret, err -} - -// Get retrieves the Extension from the indexer for a given namespace and name. -func (s extensionNamespaceLister) Get(name string) (*v4beta1.Extension, error) { - obj, exists, err := s.indexer.GetByKey(s.namespace + "/" + name) - if err != nil { - return nil, err - } - if !exists { - return nil, errors.NewNotFound(v4beta1.Resource("extension"), name) - } - return obj.(*v4beta1.Extension), nil -} diff --git a/pkg/client/listers/jenkins.io/v4beta1/gitservice.go b/pkg/client/listers/jenkins.io/v4beta1/gitservice.go deleted file mode 100644 index bab354b..0000000 --- a/pkg/client/listers/jenkins.io/v4beta1/gitservice.go +++ /dev/null @@ -1,98 +0,0 @@ -/* -Copyright 2020 The Jenkins X 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 lister-gen. DO NOT EDIT. - -package v4beta1 - -import ( - v4beta1 "github.com/jenkins-x/jx-api/v4/pkg/apis/jenkins.io/v4beta1" - "k8s.io/apimachinery/pkg/api/errors" - "k8s.io/apimachinery/pkg/labels" - "k8s.io/client-go/tools/cache" -) - -// GitServiceLister helps list GitServices. -// All objects returned here must be treated as read-only. -type GitServiceLister interface { - // List lists all GitServices in the indexer. - // Objects returned here must be treated as read-only. - List(selector labels.Selector) (ret []*v4beta1.GitService, err error) - // GitServices returns an object that can list and get GitServices. - GitServices(namespace string) GitServiceNamespaceLister - GitServiceListerExpansion -} - -// gitServiceLister implements the GitServiceLister interface. -type gitServiceLister struct { - indexer cache.Indexer -} - -// NewGitServiceLister returns a new GitServiceLister. -func NewGitServiceLister(indexer cache.Indexer) GitServiceLister { - return &gitServiceLister{indexer: indexer} -} - -// List lists all GitServices in the indexer. -func (s *gitServiceLister) List(selector labels.Selector) (ret []*v4beta1.GitService, err error) { - err = cache.ListAll(s.indexer, selector, func(m interface{}) { - ret = append(ret, m.(*v4beta1.GitService)) - }) - return ret, err -} - -// GitServices returns an object that can list and get GitServices. -func (s *gitServiceLister) GitServices(namespace string) GitServiceNamespaceLister { - return gitServiceNamespaceLister{indexer: s.indexer, namespace: namespace} -} - -// GitServiceNamespaceLister helps list and get GitServices. -// All objects returned here must be treated as read-only. -type GitServiceNamespaceLister interface { - // List lists all GitServices in the indexer for a given namespace. - // Objects returned here must be treated as read-only. - List(selector labels.Selector) (ret []*v4beta1.GitService, err error) - // Get retrieves the GitService from the indexer for a given namespace and name. - // Objects returned here must be treated as read-only. - Get(name string) (*v4beta1.GitService, error) - GitServiceNamespaceListerExpansion -} - -// gitServiceNamespaceLister implements the GitServiceNamespaceLister -// interface. -type gitServiceNamespaceLister struct { - indexer cache.Indexer - namespace string -} - -// List lists all GitServices in the indexer for a given namespace. -func (s gitServiceNamespaceLister) List(selector labels.Selector) (ret []*v4beta1.GitService, err error) { - err = cache.ListAllByNamespace(s.indexer, s.namespace, selector, func(m interface{}) { - ret = append(ret, m.(*v4beta1.GitService)) - }) - return ret, err -} - -// Get retrieves the GitService from the indexer for a given namespace and name. -func (s gitServiceNamespaceLister) Get(name string) (*v4beta1.GitService, error) { - obj, exists, err := s.indexer.GetByKey(s.namespace + "/" + name) - if err != nil { - return nil, err - } - if !exists { - return nil, errors.NewNotFound(v4beta1.Resource("gitservice"), name) - } - return obj.(*v4beta1.GitService), nil -} diff --git a/pkg/client/listers/jenkins.io/v4beta1/sourcerepositorygroup.go b/pkg/client/listers/jenkins.io/v4beta1/sourcerepositorygroup.go deleted file mode 100644 index 5deb76f..0000000 --- a/pkg/client/listers/jenkins.io/v4beta1/sourcerepositorygroup.go +++ /dev/null @@ -1,98 +0,0 @@ -/* -Copyright 2020 The Jenkins X 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 lister-gen. DO NOT EDIT. - -package v4beta1 - -import ( - v4beta1 "github.com/jenkins-x/jx-api/v4/pkg/apis/jenkins.io/v4beta1" - "k8s.io/apimachinery/pkg/api/errors" - "k8s.io/apimachinery/pkg/labels" - "k8s.io/client-go/tools/cache" -) - -// SourceRepositoryGroupLister helps list SourceRepositoryGroups. -// All objects returned here must be treated as read-only. -type SourceRepositoryGroupLister interface { - // List lists all SourceRepositoryGroups in the indexer. - // Objects returned here must be treated as read-only. - List(selector labels.Selector) (ret []*v4beta1.SourceRepositoryGroup, err error) - // SourceRepositoryGroups returns an object that can list and get SourceRepositoryGroups. - SourceRepositoryGroups(namespace string) SourceRepositoryGroupNamespaceLister - SourceRepositoryGroupListerExpansion -} - -// sourceRepositoryGroupLister implements the SourceRepositoryGroupLister interface. -type sourceRepositoryGroupLister struct { - indexer cache.Indexer -} - -// NewSourceRepositoryGroupLister returns a new SourceRepositoryGroupLister. -func NewSourceRepositoryGroupLister(indexer cache.Indexer) SourceRepositoryGroupLister { - return &sourceRepositoryGroupLister{indexer: indexer} -} - -// List lists all SourceRepositoryGroups in the indexer. -func (s *sourceRepositoryGroupLister) List(selector labels.Selector) (ret []*v4beta1.SourceRepositoryGroup, err error) { - err = cache.ListAll(s.indexer, selector, func(m interface{}) { - ret = append(ret, m.(*v4beta1.SourceRepositoryGroup)) - }) - return ret, err -} - -// SourceRepositoryGroups returns an object that can list and get SourceRepositoryGroups. -func (s *sourceRepositoryGroupLister) SourceRepositoryGroups(namespace string) SourceRepositoryGroupNamespaceLister { - return sourceRepositoryGroupNamespaceLister{indexer: s.indexer, namespace: namespace} -} - -// SourceRepositoryGroupNamespaceLister helps list and get SourceRepositoryGroups. -// All objects returned here must be treated as read-only. -type SourceRepositoryGroupNamespaceLister interface { - // List lists all SourceRepositoryGroups in the indexer for a given namespace. - // Objects returned here must be treated as read-only. - List(selector labels.Selector) (ret []*v4beta1.SourceRepositoryGroup, err error) - // Get retrieves the SourceRepositoryGroup from the indexer for a given namespace and name. - // Objects returned here must be treated as read-only. - Get(name string) (*v4beta1.SourceRepositoryGroup, error) - SourceRepositoryGroupNamespaceListerExpansion -} - -// sourceRepositoryGroupNamespaceLister implements the SourceRepositoryGroupNamespaceLister -// interface. -type sourceRepositoryGroupNamespaceLister struct { - indexer cache.Indexer - namespace string -} - -// List lists all SourceRepositoryGroups in the indexer for a given namespace. -func (s sourceRepositoryGroupNamespaceLister) List(selector labels.Selector) (ret []*v4beta1.SourceRepositoryGroup, err error) { - err = cache.ListAllByNamespace(s.indexer, s.namespace, selector, func(m interface{}) { - ret = append(ret, m.(*v4beta1.SourceRepositoryGroup)) - }) - return ret, err -} - -// Get retrieves the SourceRepositoryGroup from the indexer for a given namespace and name. -func (s sourceRepositoryGroupNamespaceLister) Get(name string) (*v4beta1.SourceRepositoryGroup, error) { - obj, exists, err := s.indexer.GetByKey(s.namespace + "/" + name) - if err != nil { - return nil, err - } - if !exists { - return nil, errors.NewNotFound(v4beta1.Resource("sourcerepositorygroup"), name) - } - return obj.(*v4beta1.SourceRepositoryGroup), nil -} diff --git a/pkg/client/listers/jenkins.io/v4beta1/team.go b/pkg/client/listers/jenkins.io/v4beta1/team.go deleted file mode 100644 index d309030..0000000 --- a/pkg/client/listers/jenkins.io/v4beta1/team.go +++ /dev/null @@ -1,98 +0,0 @@ -/* -Copyright 2020 The Jenkins X 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 lister-gen. DO NOT EDIT. - -package v4beta1 - -import ( - v4beta1 "github.com/jenkins-x/jx-api/v4/pkg/apis/jenkins.io/v4beta1" - "k8s.io/apimachinery/pkg/api/errors" - "k8s.io/apimachinery/pkg/labels" - "k8s.io/client-go/tools/cache" -) - -// TeamLister helps list Teams. -// All objects returned here must be treated as read-only. -type TeamLister interface { - // List lists all Teams in the indexer. - // Objects returned here must be treated as read-only. - List(selector labels.Selector) (ret []*v4beta1.Team, err error) - // Teams returns an object that can list and get Teams. - Teams(namespace string) TeamNamespaceLister - TeamListerExpansion -} - -// teamLister implements the TeamLister interface. -type teamLister struct { - indexer cache.Indexer -} - -// NewTeamLister returns a new TeamLister. -func NewTeamLister(indexer cache.Indexer) TeamLister { - return &teamLister{indexer: indexer} -} - -// List lists all Teams in the indexer. -func (s *teamLister) List(selector labels.Selector) (ret []*v4beta1.Team, err error) { - err = cache.ListAll(s.indexer, selector, func(m interface{}) { - ret = append(ret, m.(*v4beta1.Team)) - }) - return ret, err -} - -// Teams returns an object that can list and get Teams. -func (s *teamLister) Teams(namespace string) TeamNamespaceLister { - return teamNamespaceLister{indexer: s.indexer, namespace: namespace} -} - -// TeamNamespaceLister helps list and get Teams. -// All objects returned here must be treated as read-only. -type TeamNamespaceLister interface { - // List lists all Teams in the indexer for a given namespace. - // Objects returned here must be treated as read-only. - List(selector labels.Selector) (ret []*v4beta1.Team, err error) - // Get retrieves the Team from the indexer for a given namespace and name. - // Objects returned here must be treated as read-only. - Get(name string) (*v4beta1.Team, error) - TeamNamespaceListerExpansion -} - -// teamNamespaceLister implements the TeamNamespaceLister -// interface. -type teamNamespaceLister struct { - indexer cache.Indexer - namespace string -} - -// List lists all Teams in the indexer for a given namespace. -func (s teamNamespaceLister) List(selector labels.Selector) (ret []*v4beta1.Team, err error) { - err = cache.ListAllByNamespace(s.indexer, s.namespace, selector, func(m interface{}) { - ret = append(ret, m.(*v4beta1.Team)) - }) - return ret, err -} - -// Get retrieves the Team from the indexer for a given namespace and name. -func (s teamNamespaceLister) Get(name string) (*v4beta1.Team, error) { - obj, exists, err := s.indexer.GetByKey(s.namespace + "/" + name) - if err != nil { - return nil, err - } - if !exists { - return nil, errors.NewNotFound(v4beta1.Resource("team"), name) - } - return obj.(*v4beta1.Team), nil -} diff --git a/pkg/client/listers/jenkins.io/v4beta1/user.go b/pkg/client/listers/jenkins.io/v4beta1/user.go deleted file mode 100644 index 5bc9b5e..0000000 --- a/pkg/client/listers/jenkins.io/v4beta1/user.go +++ /dev/null @@ -1,98 +0,0 @@ -/* -Copyright 2020 The Jenkins X 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 lister-gen. DO NOT EDIT. - -package v4beta1 - -import ( - v4beta1 "github.com/jenkins-x/jx-api/v4/pkg/apis/jenkins.io/v4beta1" - "k8s.io/apimachinery/pkg/api/errors" - "k8s.io/apimachinery/pkg/labels" - "k8s.io/client-go/tools/cache" -) - -// UserLister helps list Users. -// All objects returned here must be treated as read-only. -type UserLister interface { - // List lists all Users in the indexer. - // Objects returned here must be treated as read-only. - List(selector labels.Selector) (ret []*v4beta1.User, err error) - // Users returns an object that can list and get Users. - Users(namespace string) UserNamespaceLister - UserListerExpansion -} - -// userLister implements the UserLister interface. -type userLister struct { - indexer cache.Indexer -} - -// NewUserLister returns a new UserLister. -func NewUserLister(indexer cache.Indexer) UserLister { - return &userLister{indexer: indexer} -} - -// List lists all Users in the indexer. -func (s *userLister) List(selector labels.Selector) (ret []*v4beta1.User, err error) { - err = cache.ListAll(s.indexer, selector, func(m interface{}) { - ret = append(ret, m.(*v4beta1.User)) - }) - return ret, err -} - -// Users returns an object that can list and get Users. -func (s *userLister) Users(namespace string) UserNamespaceLister { - return userNamespaceLister{indexer: s.indexer, namespace: namespace} -} - -// UserNamespaceLister helps list and get Users. -// All objects returned here must be treated as read-only. -type UserNamespaceLister interface { - // List lists all Users in the indexer for a given namespace. - // Objects returned here must be treated as read-only. - List(selector labels.Selector) (ret []*v4beta1.User, err error) - // Get retrieves the User from the indexer for a given namespace and name. - // Objects returned here must be treated as read-only. - Get(name string) (*v4beta1.User, error) - UserNamespaceListerExpansion -} - -// userNamespaceLister implements the UserNamespaceLister -// interface. -type userNamespaceLister struct { - indexer cache.Indexer - namespace string -} - -// List lists all Users in the indexer for a given namespace. -func (s userNamespaceLister) List(selector labels.Selector) (ret []*v4beta1.User, err error) { - err = cache.ListAllByNamespace(s.indexer, s.namespace, selector, func(m interface{}) { - ret = append(ret, m.(*v4beta1.User)) - }) - return ret, err -} - -// Get retrieves the User from the indexer for a given namespace and name. -func (s userNamespaceLister) Get(name string) (*v4beta1.User, error) { - obj, exists, err := s.indexer.GetByKey(s.namespace + "/" + name) - if err != nil { - return nil, err - } - if !exists { - return nil, errors.NewNotFound(v4beta1.Resource("user"), name) - } - return obj.(*v4beta1.User), nil -}