diff --git a/go.mod b/go.mod index 0f99378..dff41fb 100644 --- a/go.mod +++ b/go.mod @@ -3,9 +3,9 @@ module github.com/devsy-org/api go 1.25.0 require ( - github.com/devsy-org/admin-apis v1.2.0 - github.com/devsy-org/agentapi v1.0.0 - github.com/devsy-org/apiserver v1.2.0 + github.com/devsy-org/admin-apis v1.0.0 + github.com/devsy-org/agentapi v1.0.1 + github.com/devsy-org/apiserver v1.0.0 github.com/ghodss/yaml v1.0.0 google.golang.org/grpc v1.78.0 google.golang.org/protobuf v1.36.11 diff --git a/go.sum b/go.sum index 7cc67b4..26bc09e 100644 --- a/go.sum +++ b/go.sum @@ -23,12 +23,12 @@ github.com/davecgh/go-spew v1.1.0/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSs github.com/davecgh/go-spew v1.1.1/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSsI+c5H38= github.com/davecgh/go-spew v1.1.2-0.20180830191138-d8f796af33cc h1:U9qPSI2PIWSS1VwoXQT9A3Wy9MM3WgvqSxFWenqJduM= github.com/davecgh/go-spew v1.1.2-0.20180830191138-d8f796af33cc/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSsI+c5H38= -github.com/devsy-org/admin-apis v1.2.0 h1:zfOltpdDxoO0FAe15NFb1NRNkmcdfn3QUY3hQ/aEZV4= -github.com/devsy-org/admin-apis v1.2.0/go.mod h1:N2PrbYDtigY4By1yE1c6gfsWE5bIb6zwY9rUGK/9RWI= -github.com/devsy-org/agentapi v1.0.0 h1:CGO6v6JHTywgN0De4m5+BmRn1T07TqmNkEKCkXRb9qs= -github.com/devsy-org/agentapi v1.0.0/go.mod h1:5MB8LyV7zYP/Wn7vN7FeogaZeod2aiu7GuJtEOh9XuA= -github.com/devsy-org/apiserver v1.2.0 h1:orLQQG+6s7noI4DfBYTC7bSstqIh8QZaYF8OyX02L8M= -github.com/devsy-org/apiserver v1.2.0/go.mod h1:2jKuqy8XdH/g4bIjmkj3efQgshN/NjMzm17SkvvSR88= +github.com/devsy-org/admin-apis v1.0.0 h1:PXEIyhecYMBxXF1Si6Q35m4aMmzybQ6WffeParRfjEw= +github.com/devsy-org/admin-apis v1.0.0/go.mod h1:N2PrbYDtigY4By1yE1c6gfsWE5bIb6zwY9rUGK/9RWI= +github.com/devsy-org/agentapi v1.0.1 h1:qdSs162AWvtGwsXrYcM0hJqQ79M0t/HTrZ+/KFeTxCs= +github.com/devsy-org/agentapi v1.0.1/go.mod h1:VmUPw3OdIJ27ONFInfUrHliTyokhQtGmoiGWtmBzDrU= +github.com/devsy-org/apiserver v1.0.0 h1:HBOwk6DeZKQzuDzUTnQ03YkOewYiBfE9r7qn/AcyRU4= +github.com/devsy-org/apiserver v1.0.0/go.mod h1:2jKuqy8XdH/g4bIjmkj3efQgshN/NjMzm17SkvvSR88= github.com/dustin/go-humanize v1.0.1 h1:GzkhY7T5VNhEkwH0PVJgjz+fX1rhBrR7pRT3mDkpeCY= github.com/dustin/go-humanize v1.0.1/go.mod h1:Mu1zIs6XwVuF/gI1OepvI0qD18qycQx+mFykh5fBlto= github.com/emicklei/go-restful/v3 v3.13.0 h1:C4Bl2xDndpU6nJ4bc1jXd+uTmYPVUwkD6bFY/oTyCes= diff --git a/pkg/apis/management/v1/app_types.go b/pkg/apis/management/v1/app_types.go index 705b5ac..a150003 100644 --- a/pkg/apis/management/v1/app_types.go +++ b/pkg/apis/management/v1/app_types.go @@ -7,7 +7,7 @@ import ( // +genclient // +genclient:nonNamespaced -// +genclient:method=GetCredentials,verb=get,subresource=credentials,result=github.com/devsy-org/api/pkg/apis/management/v1.AppCredentials +// +genclient:method=GetCredentials,verb=get,subresource=credentials,result=github.com/devsy-org/api/pkg/apis/management/v1.AppCredentials //nolint:lll // +k8s:deepcopy-gen:interfaces=k8s.io/apimachinery/pkg/runtime.Object // App holds the information diff --git a/pkg/apis/management/v1/cluster_types.go b/pkg/apis/management/v1/cluster_types.go index cb39dc5..2165a74 100644 --- a/pkg/apis/management/v1/cluster_types.go +++ b/pkg/apis/management/v1/cluster_types.go @@ -8,10 +8,10 @@ import ( // +genclient // +genclient:nonNamespaced -// +genclient:method=ListAccess,verb=get,subresource=memberaccess,result=github.com/devsy-org/api/pkg/apis/management/v1.ClusterMemberAccess -// +genclient:method=ListMembers,verb=get,subresource=members,result=github.com/devsy-org/api/pkg/apis/management/v1.ClusterMembers -// +genclient:method=GetAgentConfig,verb=get,subresource=agentconfig,result=github.com/devsy-org/api/pkg/apis/management/v1.ClusterAgentConfig -// +genclient:method=GetAccessKey,verb=get,subresource=accesskey,result=github.com/devsy-org/api/pkg/apis/management/v1.ClusterAccessKey +// +genclient:method=ListAccess,verb=get,subresource=memberaccess,result=github.com/devsy-org/api/pkg/apis/management/v1.ClusterMemberAccess //nolint:lll +// +genclient:method=ListMembers,verb=get,subresource=members,result=github.com/devsy-org/api/pkg/apis/management/v1.ClusterMembers //nolint:lll +// +genclient:method=GetAgentConfig,verb=get,subresource=agentconfig,result=github.com/devsy-org/api/pkg/apis/management/v1.ClusterAgentConfig //nolint:lll +// +genclient:method=GetAccessKey,verb=get,subresource=accesskey,result=github.com/devsy-org/api/pkg/apis/management/v1.ClusterAccessKey //nolint:lll // +k8s:deepcopy-gen:interfaces=k8s.io/apimachinery/pkg/runtime.Object // Cluster holds the cluster information diff --git a/pkg/apis/management/v1/devpodworkspaceinstance_types.go b/pkg/apis/management/v1/devpodworkspaceinstance_types.go index 1b0e2fd..c3d694a 100644 --- a/pkg/apis/management/v1/devpodworkspaceinstance_types.go +++ b/pkg/apis/management/v1/devpodworkspaceinstance_types.go @@ -9,10 +9,10 @@ import ( // +genclient // +genclient:noStatus -// +genclient:method=Up,verb=create,subresource=up,input=github.com/devsy-org/api/pkg/apis/management/v1.DevPodWorkspaceInstanceUp,result=github.com/devsy-org/api/pkg/apis/management/v1.DevPodWorkspaceInstanceUp -// +genclient:method=Stop,verb=create,subresource=stop,input=github.com/devsy-org/api/pkg/apis/management/v1.DevPodWorkspaceInstanceStop,result=github.com/devsy-org/api/pkg/apis/management/v1.DevPodWorkspaceInstanceStop -// +genclient:method=Troubleshoot,verb=get,subresource=troubleshoot,result=github.com/devsy-org/api/pkg/apis/management/v1.DevPodWorkspaceInstanceTroubleshoot -// +genclient:method=Cancel,verb=create,subresource=cancel,input=github.com/devsy-org/api/pkg/apis/management/v1.DevPodWorkspaceInstanceCancel,result=github.com/devsy-org/api/pkg/apis/management/v1.DevPodWorkspaceInstanceCancel +// +genclient:method=Up,verb=create,subresource=up,input=github.com/devsy-org/api/pkg/apis/management/v1.DevPodWorkspaceInstanceUp,result=github.com/devsy-org/api/pkg/apis/management/v1.DevPodWorkspaceInstanceUp //nolint:lll +// +genclient:method=Stop,verb=create,subresource=stop,input=github.com/devsy-org/api/pkg/apis/management/v1.DevPodWorkspaceInstanceStop,result=github.com/devsy-org/api/pkg/apis/management/v1.DevPodWorkspaceInstanceStop //nolint:lll +// +genclient:method=Troubleshoot,verb=get,subresource=troubleshoot,result=github.com/devsy-org/api/pkg/apis/management/v1.DevPodWorkspaceInstanceTroubleshoot //nolint:lll +// +genclient:method=Cancel,verb=create,subresource=cancel,input=github.com/devsy-org/api/pkg/apis/management/v1.DevPodWorkspaceInstanceCancel,result=github.com/devsy-org/api/pkg/apis/management/v1.DevPodWorkspaceInstanceCancel //nolint:lll // +k8s:deepcopy-gen:interfaces=k8s.io/apimachinery/pkg/runtime.Object // DevPodWorkspaceInstance holds the DevPodWorkspaceInstance information diff --git a/pkg/apis/management/v1/license_types.go b/pkg/apis/management/v1/license_types.go index 1c3b5a7..c65575d 100644 --- a/pkg/apis/management/v1/license_types.go +++ b/pkg/apis/management/v1/license_types.go @@ -7,7 +7,7 @@ import ( // +genclient // +genclient:nonNamespaced -// +genclient:method=LicenseRequest,verb=create,subresource=request,input=github.com/devsy-org/api/pkg/apis/management/v1.LicenseRequest,result=github.com/devsy-org/api/pkg/apis/management/v1.LicenseRequest +// +genclient:method=LicenseRequest,verb=create,subresource=request,input=github.com/devsy-org/api/pkg/apis/management/v1.LicenseRequest,result=github.com/devsy-org/api/pkg/apis/management/v1.LicenseRequest //nolint:lll // +k8s:deepcopy-gen:interfaces=k8s.io/apimachinery/pkg/runtime.Object // License holds the license information diff --git a/pkg/apis/management/v1/project_types.go b/pkg/apis/management/v1/project_types.go index 48df755..138642a 100644 --- a/pkg/apis/management/v1/project_types.go +++ b/pkg/apis/management/v1/project_types.go @@ -7,12 +7,12 @@ import ( // +genclient // +genclient:nonNamespaced -// +genclient:method=ListMembers,verb=get,subresource=members,result=github.com/devsy-org/api/pkg/apis/management/v1.ProjectMembers -// +genclient:method=ListTemplates,verb=get,subresource=templates,result=github.com/devsy-org/api/pkg/apis/management/v1.ProjectTemplates -// +genclient:method=ListClusters,verb=get,subresource=clusters,result=github.com/devsy-org/api/pkg/apis/management/v1.ProjectClusters -// +genclient:method=MigrateVirtualClusterInstance,verb=create,subresource=migratevirtualclusterinstance,input=github.com/devsy-org/api/pkg/apis/management/v1.ProjectMigrateVirtualClusterInstance,result=github.com/devsy-org/api/pkg/apis/management/v1.ProjectMigrateVirtualClusterInstance -// +genclient:method=ImportSpace,verb=create,subresource=importspace,input=github.com/devsy-org/api/pkg/apis/management/v1.ProjectImportSpace,result=github.com/devsy-org/api/pkg/apis/management/v1.ProjectImportSpace -// +genclient:method=MigrateSpaceInstance,verb=create,subresource=migratespaceinstance,input=github.com/devsy-org/api/pkg/apis/management/v1.ProjectMigrateSpaceInstance,result=github.com/devsy-org/api/pkg/apis/management/v1.ProjectMigrateSpaceInstance +// +genclient:method=ListMembers,verb=get,subresource=members,result=github.com/devsy-org/api/pkg/apis/management/v1.ProjectMembers //nolint:lll +// +genclient:method=ListTemplates,verb=get,subresource=templates,result=github.com/devsy-org/api/pkg/apis/management/v1.ProjectTemplates //nolint:lll +// +genclient:method=ListClusters,verb=get,subresource=clusters,result=github.com/devsy-org/api/pkg/apis/management/v1.ProjectClusters //nolint:lll +// +genclient:method=MigrateVirtualClusterInstance,verb=create,subresource=migratevirtualclusterinstance,input=github.com/devsy-org/api/pkg/apis/management/v1.ProjectMigrateVirtualClusterInstance,result=github.com/devsy-org/api/pkg/apis/management/v1.ProjectMigrateVirtualClusterInstance //nolint:lll +// +genclient:method=ImportSpace,verb=create,subresource=importspace,input=github.com/devsy-org/api/pkg/apis/management/v1.ProjectImportSpace,result=github.com/devsy-org/api/pkg/apis/management/v1.ProjectImportSpace //nolint:lll +// +genclient:method=MigrateSpaceInstance,verb=create,subresource=migratespaceinstance,input=github.com/devsy-org/api/pkg/apis/management/v1.ProjectMigrateSpaceInstance,result=github.com/devsy-org/api/pkg/apis/management/v1.ProjectMigrateSpaceInstance //nolint:lll // +k8s:deepcopy-gen:interfaces=k8s.io/apimachinery/pkg/runtime.Object // Project holds the Project information diff --git a/pkg/apis/management/v1/team_types.go b/pkg/apis/management/v1/team_types.go index 71d4666..66ec895 100644 --- a/pkg/apis/management/v1/team_types.go +++ b/pkg/apis/management/v1/team_types.go @@ -7,8 +7,8 @@ import ( // +genclient // +genclient:nonNamespaced -// +genclient:method=ListClusters,verb=get,subresource=clusters,result=github.com/devsy-org/api/pkg/apis/management/v1.TeamClusters -// +genclient:method=ListAccessKeys,verb=get,subresource=accesskeys,result=github.com/devsy-org/api/pkg/apis/management/v1.TeamAccessKeys +// +genclient:method=ListClusters,verb=get,subresource=clusters,result=github.com/devsy-org/api/pkg/apis/management/v1.TeamClusters //nolint:lll +// +genclient:method=ListAccessKeys,verb=get,subresource=accesskeys,result=github.com/devsy-org/api/pkg/apis/management/v1.TeamAccessKeys //nolint:lll // +k8s:deepcopy-gen:interfaces=k8s.io/apimachinery/pkg/runtime.Object // Team holds the team information diff --git a/pkg/apis/management/v1/user_types.go b/pkg/apis/management/v1/user_types.go index 080694d..f8569e1 100644 --- a/pkg/apis/management/v1/user_types.go +++ b/pkg/apis/management/v1/user_types.go @@ -7,10 +7,10 @@ import ( // +genclient // +genclient:nonNamespaced -// +genclient:method=GetProfile,verb=get,subresource=profile,result=github.com/devsy-org/api/pkg/apis/management/v1.UserProfile -// +genclient:method=UpdateProfile,verb=create,subresource=profile,input=github.com/devsy-org/api/pkg/apis/management/v1.UserProfile,result=github.com/devsy-org/api/pkg/apis/management/v1.UserProfile -// +genclient:method=ListClusters,verb=get,subresource=clusters,result=github.com/devsy-org/api/pkg/apis/management/v1.UserClusters -// +genclient:method=ListAccessKeys,verb=get,subresource=accesskeys,result=github.com/devsy-org/api/pkg/apis/management/v1.UserAccessKeys +// +genclient:method=GetProfile,verb=get,subresource=profile,result=github.com/devsy-org/api/pkg/apis/management/v1.UserProfile //nolint:lll +// +genclient:method=UpdateProfile,verb=create,subresource=profile,input=github.com/devsy-org/api/pkg/apis/management/v1.UserProfile,result=github.com/devsy-org/api/pkg/apis/management/v1.UserProfile //nolint:lll +// +genclient:method=ListClusters,verb=get,subresource=clusters,result=github.com/devsy-org/api/pkg/apis/management/v1.UserClusters //nolint:lll +// +genclient:method=ListAccessKeys,verb=get,subresource=accesskeys,result=github.com/devsy-org/api/pkg/apis/management/v1.UserAccessKeys //nolint:lll // +k8s:deepcopy-gen:interfaces=k8s.io/apimachinery/pkg/runtime.Object // User holds the user information diff --git a/pkg/apis/management/v1/virtualclusterinstance_types.go b/pkg/apis/management/v1/virtualclusterinstance_types.go index a59897f..efa9fc1 100644 --- a/pkg/apis/management/v1/virtualclusterinstance_types.go +++ b/pkg/apis/management/v1/virtualclusterinstance_types.go @@ -9,11 +9,11 @@ import ( // +genclient // +genclient:noStatus -// +genclient:method=GetKubeConfig,verb=create,subresource=kubeconfig,input=github.com/devsy-org/api/pkg/apis/management/v1.VirtualClusterInstanceKubeConfig,result=github.com/devsy-org/api/pkg/apis/management/v1.VirtualClusterInstanceKubeConfig -// +genclient:method=GetAccessKey,verb=get,subresource=accesskey,result=github.com/devsy-org/api/pkg/apis/management/v1.VirtualClusterAccessKey -// +genclient:method=GetExternalDatabase,verb=create,subresource=externaldatabase,input=github.com/devsy-org/api/pkg/apis/management/v1.VirtualClusterExternalDatabase,result=github.com/devsy-org/api/pkg/apis/management/v1.VirtualClusterExternalDatabase -// +genclient:method=GetNodeAccessKey,verb=create,subresource=nodeaccesskey,input=github.com/devsy-org/api/pkg/apis/management/v1.VirtualClusterNodeAccessKey,result=github.com/devsy-org/api/pkg/apis/management/v1.VirtualClusterNodeAccessKey -// +genclient:method=GetStandaloneETCDPeers,verb=create,subresource=standalone,input=github.com/devsy-org/api/pkg/apis/management/v1.VirtualClusterStandalone,result=github.com/devsy-org/api/pkg/apis/management/v1.VirtualClusterStandalone +// +genclient:method=GetKubeConfig,verb=create,subresource=kubeconfig,input=github.com/devsy-org/api/pkg/apis/management/v1.VirtualClusterInstanceKubeConfig,result=github.com/devsy-org/api/pkg/apis/management/v1.VirtualClusterInstanceKubeConfig //nolint:lll +// +genclient:method=GetAccessKey,verb=get,subresource=accesskey,result=github.com/devsy-org/api/pkg/apis/management/v1.VirtualClusterAccessKey //nolint:lll +// +genclient:method=GetExternalDatabase,verb=create,subresource=externaldatabase,input=github.com/devsy-org/api/pkg/apis/management/v1.VirtualClusterExternalDatabase,result=github.com/devsy-org/api/pkg/apis/management/v1.VirtualClusterExternalDatabase //nolint:lll +// +genclient:method=GetNodeAccessKey,verb=create,subresource=nodeaccesskey,input=github.com/devsy-org/api/pkg/apis/management/v1.VirtualClusterNodeAccessKey,result=github.com/devsy-org/api/pkg/apis/management/v1.VirtualClusterNodeAccessKey //nolint:lll +// +genclient:method=GetStandaloneETCDPeers,verb=create,subresource=standalone,input=github.com/devsy-org/api/pkg/apis/management/v1.VirtualClusterStandalone,result=github.com/devsy-org/api/pkg/apis/management/v1.VirtualClusterStandalone //nolint:lll // +k8s:deepcopy-gen:interfaces=k8s.io/apimachinery/pkg/runtime.Object // VirtualClusterInstance holds the VirtualClusterInstance information diff --git a/pkg/devpod/cloneoptions.go b/pkg/devpod/cloneoptions.go deleted file mode 100644 index 078aa3c..0000000 --- a/pkg/devpod/cloneoptions.go +++ /dev/null @@ -1,24 +0,0 @@ -package devpod - -type CloneOptions struct { - // Repository is the repository to clone - Repository string `json:"repository,omitempty"` - - // Branch is the branch to use - Branch string `json:"branch,omitempty"` - - // Commit is the commit SHA to checkout - Commit string `json:"commit,omitempty"` - - // PRReference is the pull request reference to checkout - PRReference string `json:"prReference,omitempty"` - - // SubPath is the subpath in the repo to use - SubPath string `json:"subPath,omitempty"` - - // CredentialsHelper is the credentials helper to use for the clone - CredentialsHelper string `json:"credentialsHelper,omitempty"` - - // ExtraEnv is the extra environment variables to use for the clone - ExtraEnv []string `json:"extraEnv,omitempty"` -} diff --git a/pkg/devpod/platformoptions.go b/pkg/devpod/platformoptions.go deleted file mode 100644 index 390f225..0000000 --- a/pkg/devpod/platformoptions.go +++ /dev/null @@ -1,82 +0,0 @@ -package devpod - -import ( - storagev1 "github.com/devsy-org/api/pkg/apis/storage/v1" -) - -type PlatformOptions struct { - // Enabled is true if platform mode is enabled. Be careful with this option as this is only enabled - // when executed on the platform side and not if a platform workspace is used locally. - Enabled bool `json:"enabled,omitempty"` - - // DevPodWorkspaceInstance information - InstanceName string `json:"instanceName,omitempty"` - InstanceProject string `json:"instanceProject,omitempty"` - InstanceNamespace string `json:"instanceNamespace,omitempty"` - - // connection options - // AccessKey is used by the workspace daemon to authenticate itself - AccessKey string `json:"accessKey,omitempty"` - // UserAccessKey can be used as the workspace owner - UserAccessKey string `json:"userAccessKey,omitempty"` - WorkspaceHost string `json:"workspaceHost,omitempty"` - PlatformHost string `json:"platformHost,omitempty"` - RunnerSocket string `json:"runnerSocket,omitempty"` - - // environment template options - EnvironmentTemplate string `json:"environmentTemplate,omitempty"` - EnvironmentTemplateVersion string `json:"environmentTemplateVersion,omitempty"` - GitCloneStrategy storagev1.GitCloneStrategy `json:"gitCloneStrategy,omitempty"` - GitSkipLFS bool `json:"gitSkipLFS,omitempty"` - - // Kubernetes holds configuration for workspaces that need information about their kubernetes environment, i.e. - // the ones running in virtual clusters or spaces - Kubernetes *Kubernetes `json:"kubernetes,omitempty"` - - // user credentials are the credentials for the user - UserCredentials PlatformWorkspaceCredentials `json:"userCredentials,omitempty"` - ProjectCredentials PlatformWorkspaceCredentials `json:"projectCredentials,omitempty"` - - // Remote builds - Build *PlatformBuildOptions `json:"build,omitempty"` -} - -type PlatformWorkspaceCredentials struct { - GitUser string `json:"gitUser,omitempty"` - GitEmail string `json:"gitEmail,omitempty"` - GitHttp []PlatformGitHttpCredentials `json:"gitHttp,omitempty"` - GitSsh []PlatformGitSshCredentials `json:"gitSsh,omitempty"` -} - -type PlatformGitHttpCredentials struct { - Host string `json:"host,omitempty"` - User string `json:"user,omitempty"` - Password string `json:"password,omitempty"` - Path string `json:"path,omitempty"` -} - -type PlatformGitSshCredentials struct { - Key string `json:"key,omitempty"` -} - -type PlatformDockerCredentials struct { - Host string `json:"host,omitempty"` - User string `json:"user,omitempty"` - Password string `json:"password,omitempty"` -} - -type PlatformBuildOptions struct { - Repository string `json:"repository,omitempty"` - RemoteAddress string `json:"remoteAddress,omitempty"` - - // mTLS - CertCA string `json:"certCa,omitempty"` - CertKey string `json:"certKey,omitempty"` - Cert string `json:"cert,omitempty"` -} - -type Kubernetes struct { - SpaceName string `json:"spaceName,omitempty"` - VirtualClusterName string `json:"virtualClusterName,omitempty"` - Namespace string `json:"namespace,omitempty"` -} diff --git a/pkg/devpod/runner.pb.go b/pkg/devpod/runner.pb.go deleted file mode 100644 index 51e2a1b..0000000 --- a/pkg/devpod/runner.pb.go +++ /dev/null @@ -1,214 +0,0 @@ -// protoc -I . runner.proto --go_out=. --go_opt=paths=source_relative --go-grpc_out=. --go-grpc_opt=paths=source_relative - -// Code generated by protoc-gen-go. DO NOT EDIT. -// versions: -// protoc-gen-go v1.28.1 -// protoc v5.29.1 -// source: runner.proto - -package devpod - -import ( - protoreflect "google.golang.org/protobuf/reflect/protoreflect" - protoimpl "google.golang.org/protobuf/runtime/protoimpl" - reflect "reflect" - sync "sync" -) - -const ( - // Verify that this generated code is sufficiently up-to-date. - _ = protoimpl.EnforceVersion(20 - protoimpl.MinVersion) - // Verify that runtime/protoimpl is sufficiently up-to-date. - _ = protoimpl.EnforceVersion(protoimpl.MaxVersion - 20) -) - -type CloneRequest struct { - state protoimpl.MessageState - sizeCache protoimpl.SizeCache - unknownFields protoimpl.UnknownFields - - TargetPath string `protobuf:"bytes,1,opt,name=targetPath,proto3" json:"targetPath,omitempty"` - Options string `protobuf:"bytes,2,opt,name=options,proto3" json:"options,omitempty"` -} - -func (x *CloneRequest) Reset() { - *x = CloneRequest{} - if protoimpl.UnsafeEnabled { - mi := &file_runner_proto_msgTypes[0] - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - ms.StoreMessageInfo(mi) - } -} - -func (x *CloneRequest) String() string { - return protoimpl.X.MessageStringOf(x) -} - -func (*CloneRequest) ProtoMessage() {} - -func (x *CloneRequest) ProtoReflect() protoreflect.Message { - mi := &file_runner_proto_msgTypes[0] - if protoimpl.UnsafeEnabled && x != nil { - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - if ms.LoadMessageInfo() == nil { - ms.StoreMessageInfo(mi) - } - return ms - } - return mi.MessageOf(x) -} - -// Deprecated: Use CloneRequest.ProtoReflect.Descriptor instead. -func (*CloneRequest) Descriptor() ([]byte, []int) { - return file_runner_proto_rawDescGZIP(), []int{0} -} - -func (x *CloneRequest) GetTargetPath() string { - if x != nil { - return x.TargetPath - } - return "" -} - -func (x *CloneRequest) GetOptions() string { - if x != nil { - return x.Options - } - return "" -} - -type CloneResponse struct { - state protoimpl.MessageState - sizeCache protoimpl.SizeCache - unknownFields protoimpl.UnknownFields -} - -func (x *CloneResponse) Reset() { - *x = CloneResponse{} - if protoimpl.UnsafeEnabled { - mi := &file_runner_proto_msgTypes[1] - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - ms.StoreMessageInfo(mi) - } -} - -func (x *CloneResponse) String() string { - return protoimpl.X.MessageStringOf(x) -} - -func (*CloneResponse) ProtoMessage() {} - -func (x *CloneResponse) ProtoReflect() protoreflect.Message { - mi := &file_runner_proto_msgTypes[1] - if protoimpl.UnsafeEnabled && x != nil { - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - if ms.LoadMessageInfo() == nil { - ms.StoreMessageInfo(mi) - } - return ms - } - return mi.MessageOf(x) -} - -// Deprecated: Use CloneResponse.ProtoReflect.Descriptor instead. -func (*CloneResponse) Descriptor() ([]byte, []int) { - return file_runner_proto_rawDescGZIP(), []int{1} -} - -var File_runner_proto protoreflect.FileDescriptor - -var file_runner_proto_rawDesc = []byte{ - 0x0a, 0x0c, 0x72, 0x75, 0x6e, 0x6e, 0x65, 0x72, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x12, 0x06, - 0x64, 0x65, 0x76, 0x70, 0x6f, 0x64, 0x22, 0x48, 0x0a, 0x0c, 0x43, 0x6c, 0x6f, 0x6e, 0x65, 0x52, - 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x12, 0x1e, 0x0a, 0x0a, 0x74, 0x61, 0x72, 0x67, 0x65, 0x74, - 0x50, 0x61, 0x74, 0x68, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x0a, 0x74, 0x61, 0x72, 0x67, - 0x65, 0x74, 0x50, 0x61, 0x74, 0x68, 0x12, 0x18, 0x0a, 0x07, 0x6f, 0x70, 0x74, 0x69, 0x6f, 0x6e, - 0x73, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x52, 0x07, 0x6f, 0x70, 0x74, 0x69, 0x6f, 0x6e, 0x73, - 0x22, 0x0f, 0x0a, 0x0d, 0x43, 0x6c, 0x6f, 0x6e, 0x65, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, - 0x65, 0x32, 0x40, 0x0a, 0x06, 0x52, 0x75, 0x6e, 0x6e, 0x65, 0x72, 0x12, 0x36, 0x0a, 0x05, 0x43, - 0x6c, 0x6f, 0x6e, 0x65, 0x12, 0x14, 0x2e, 0x64, 0x65, 0x76, 0x70, 0x6f, 0x64, 0x2e, 0x43, 0x6c, - 0x6f, 0x6e, 0x65, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x15, 0x2e, 0x64, 0x65, 0x76, - 0x70, 0x6f, 0x64, 0x2e, 0x43, 0x6c, 0x6f, 0x6e, 0x65, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, - 0x65, 0x22, 0x00, 0x42, 0x26, 0x5a, 0x24, 0x67, 0x69, 0x74, 0x68, 0x75, 0x62, 0x2e, 0x63, 0x6f, - 0x6d, 0x2f, 0x6c, 0x6f, 0x66, 0x74, 0x2d, 0x73, 0x68, 0x2f, 0x61, 0x70, 0x69, 0x2f, 0x76, 0x34, - 0x2f, 0x70, 0x6b, 0x67, 0x2f, 0x64, 0x65, 0x76, 0x70, 0x6f, 0x64, 0x62, 0x06, 0x70, 0x72, 0x6f, - 0x74, 0x6f, 0x33, -} - -var ( - file_runner_proto_rawDescOnce sync.Once - file_runner_proto_rawDescData = file_runner_proto_rawDesc -) - -func file_runner_proto_rawDescGZIP() []byte { - file_runner_proto_rawDescOnce.Do(func() { - file_runner_proto_rawDescData = protoimpl.X.CompressGZIP(file_runner_proto_rawDescData) - }) - return file_runner_proto_rawDescData -} - -var file_runner_proto_msgTypes = make([]protoimpl.MessageInfo, 2) -var file_runner_proto_goTypes = []interface{}{ - (*CloneRequest)(nil), // 0: devpod.CloneRequest - (*CloneResponse)(nil), // 1: devpod.CloneResponse -} -var file_runner_proto_depIdxs = []int32{ - 0, // 0: devpod.Runner.Clone:input_type -> devpod.CloneRequest - 1, // 1: devpod.Runner.Clone:output_type -> devpod.CloneResponse - 1, // [1:2] is the sub-list for method output_type - 0, // [0:1] is the sub-list for method input_type - 0, // [0:0] is the sub-list for extension type_name - 0, // [0:0] is the sub-list for extension extendee - 0, // [0:0] is the sub-list for field type_name -} - -func init() { file_runner_proto_init() } -func file_runner_proto_init() { - if File_runner_proto != nil { - return - } - if !protoimpl.UnsafeEnabled { - file_runner_proto_msgTypes[0].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*CloneRequest); i { - case 0: - return &v.state - case 1: - return &v.sizeCache - case 2: - return &v.unknownFields - default: - return nil - } - } - file_runner_proto_msgTypes[1].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*CloneResponse); i { - case 0: - return &v.state - case 1: - return &v.sizeCache - case 2: - return &v.unknownFields - default: - return nil - } - } - } - type x struct{} - out := protoimpl.TypeBuilder{ - File: protoimpl.DescBuilder{ - GoPackagePath: reflect.TypeOf(x{}).PkgPath(), - RawDescriptor: file_runner_proto_rawDesc, - NumEnums: 0, - NumMessages: 2, - NumExtensions: 0, - NumServices: 1, - }, - GoTypes: file_runner_proto_goTypes, - DependencyIndexes: file_runner_proto_depIdxs, - MessageInfos: file_runner_proto_msgTypes, - }.Build() - File_runner_proto = out.File - file_runner_proto_rawDesc = nil - file_runner_proto_goTypes = nil - file_runner_proto_depIdxs = nil -} diff --git a/pkg/devpod/runner.proto b/pkg/devpod/runner.proto deleted file mode 100644 index 903e12b..0000000 --- a/pkg/devpod/runner.proto +++ /dev/null @@ -1,17 +0,0 @@ -// protoc -I . runner.proto --go_out=. --go_opt=paths=source_relative --go-grpc_out=. --go-grpc_opt=paths=source_relative -syntax = "proto3"; - -option go_package = "github.com/devsy-org/api/pkg/devpod"; - -package devpod; - -service Runner { - rpc Clone(CloneRequest) returns (CloneResponse) {} -} - -message CloneRequest { - string targetPath = 1; - string options = 2; -} - -message CloneResponse {} diff --git a/pkg/devpod/runner_grpc.pb.go b/pkg/devpod/runner_grpc.pb.go deleted file mode 100644 index dac7f0d..0000000 --- a/pkg/devpod/runner_grpc.pb.go +++ /dev/null @@ -1,105 +0,0 @@ -// Code generated by protoc-gen-go-grpc. DO NOT EDIT. -// versions: -// - protoc-gen-go-grpc v1.2.0 -// - protoc v5.29.1 -// source: runner.proto - -package devpod - -import ( - context "context" - grpc "google.golang.org/grpc" - codes "google.golang.org/grpc/codes" - status "google.golang.org/grpc/status" -) - -// This is a compile-time assertion to ensure that this generated file -// is compatible with the grpc package it is being compiled against. -// Requires gRPC-Go v1.32.0 or later. -const _ = grpc.SupportPackageIsVersion7 - -// RunnerClient is the client API for Runner service. -// -// For semantics around ctx use and closing/ending streaming RPCs, please refer to https://pkg.go.dev/google.golang.org/grpc/?tab=doc#ClientConn.NewStream. -type RunnerClient interface { - Clone(ctx context.Context, in *CloneRequest, opts ...grpc.CallOption) (*CloneResponse, error) -} - -type runnerClient struct { - cc grpc.ClientConnInterface -} - -func NewRunnerClient(cc grpc.ClientConnInterface) RunnerClient { - return &runnerClient{cc} -} - -func (c *runnerClient) Clone(ctx context.Context, in *CloneRequest, opts ...grpc.CallOption) (*CloneResponse, error) { - out := new(CloneResponse) - err := c.cc.Invoke(ctx, "/devpod.Runner/Clone", in, out, opts...) - if err != nil { - return nil, err - } - return out, nil -} - -// RunnerServer is the server API for Runner service. -// All implementations must embed UnimplementedRunnerServer -// for forward compatibility -type RunnerServer interface { - Clone(context.Context, *CloneRequest) (*CloneResponse, error) - mustEmbedUnimplementedRunnerServer() -} - -// UnimplementedRunnerServer must be embedded to have forward compatible implementations. -type UnimplementedRunnerServer struct { -} - -func (UnimplementedRunnerServer) Clone(context.Context, *CloneRequest) (*CloneResponse, error) { - return nil, status.Errorf(codes.Unimplemented, "method Clone not implemented") -} -func (UnimplementedRunnerServer) mustEmbedUnimplementedRunnerServer() {} - -// UnsafeRunnerServer may be embedded to opt out of forward compatibility for this service. -// Use of this interface is not recommended, as added methods to RunnerServer will -// result in compilation errors. -type UnsafeRunnerServer interface { - mustEmbedUnimplementedRunnerServer() -} - -func RegisterRunnerServer(s grpc.ServiceRegistrar, srv RunnerServer) { - s.RegisterService(&Runner_ServiceDesc, srv) -} - -func _Runner_Clone_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { - in := new(CloneRequest) - if err := dec(in); err != nil { - return nil, err - } - if interceptor == nil { - return srv.(RunnerServer).Clone(ctx, in) - } - info := &grpc.UnaryServerInfo{ - Server: srv, - FullMethod: "/devpod.Runner/Clone", - } - handler := func(ctx context.Context, req interface{}) (interface{}, error) { - return srv.(RunnerServer).Clone(ctx, req.(*CloneRequest)) - } - return interceptor(ctx, in, info, handler) -} - -// Runner_ServiceDesc is the grpc.ServiceDesc for Runner service. -// It's only intended for direct use with grpc.RegisterService, -// and not to be introspected or modified (even as a copy) -var Runner_ServiceDesc = grpc.ServiceDesc{ - ServiceName: "devpod.Runner", - HandlerType: (*RunnerServer)(nil), - Methods: []grpc.MethodDesc{ - { - MethodName: "Clone", - Handler: _Runner_Clone_Handler, - }, - }, - Streams: []grpc.StreamDesc{}, - Metadata: "runner.proto", -} diff --git a/pkg/product/name.go b/pkg/product/name.go index 140bc6b..023296d 100644 --- a/pkg/product/name.go +++ b/pkg/product/name.go @@ -17,11 +17,12 @@ var ( func loadProductVar() { productEnv := os.Getenv("PRODUCT") - if productEnv == string(licenseapi.DevsyPro) { + switch { + case productEnv == string(licenseapi.DevsyPro): productName = string(licenseapi.DevsyPro) - } else if productEnv == string(licenseapi.DevsyOrg) { + case productEnv == string(licenseapi.DevsyOrg): productName = string(licenseapi.DevsyOrg) - } else if productEnv != "" { + case productEnv != "": klog.TODO(). Error(fmt.Errorf("unrecognized product %s", productEnv), "error parsing product", "product", productEnv) } @@ -32,7 +33,7 @@ func Name() licenseapi.ProductName { return licenseapi.ProductName(productName) } -// DisplayName returns the display name of the product +// DisplayName returns the display name of the product. func DisplayName() string { switch Name() { case licenseapi.DevsyPro: