Unverified Commit 4dd9dfd2 authored by Sander van Harmelen's avatar Sander van Harmelen Committed by GitHub

Merge pull request #560 from matejvelikonja/master

Split PlatformKubernetesOptions to add and edit struct
parents 05a308d7 abfb109f
...@@ -115,14 +115,14 @@ func (s *ProjectClustersService) GetCluster(pid interface{}, cluster int, option ...@@ -115,14 +115,14 @@ func (s *ProjectClustersService) GetCluster(pid interface{}, cluster int, option
// GitLab API docs: // GitLab API docs:
// https://docs.gitlab.com/ee/api/project_clusters.html#add-existing-cluster-to-project // https://docs.gitlab.com/ee/api/project_clusters.html#add-existing-cluster-to-project
type AddClusterOptions struct { type AddClusterOptions struct {
Name *string `url:"name,omitempty" json:"name,omitempty"` Name *string `url:"name,omitempty" json:"name,omitempty"`
Enabled *bool `url:"enabled,omitempty" json:"enabled,omitempty"` Enabled *bool `url:"enabled,omitempty" json:"enabled,omitempty"`
EnvironmentScope *string `url:"environment_scope,omitempty" json:"environment_scope,omitempty"` EnvironmentScope *string `url:"environment_scope,omitempty" json:"environment_scope,omitempty"`
PlatformKubernetes *PlatformKubernetesOptions `url:"platform_kubernetes_attributes,omitempty" json:"platform_kubernetes_attributes,omitempty"` PlatformKubernetes *AddPlatformKubernetesOptions `url:"platform_kubernetes_attributes,omitempty" json:"platform_kubernetes_attributes,omitempty"`
} }
// PlatformKubernetesOptions represents the available PlatformKubernetes options. // AddPlatformKubernetesOptions represents the available PlatformKubernetes options for adding.
type PlatformKubernetesOptions struct { type AddPlatformKubernetesOptions struct {
APIURL *string `url:"api_url,omitempty" json:"api_url,omitempty"` APIURL *string `url:"api_url,omitempty" json:"api_url,omitempty"`
Token *string `url:"token,omitempty" json:"token,omitempty"` Token *string `url:"token,omitempty" json:"token,omitempty"`
CaCert *string `url:"ca_cert,omitempty" json:"ca_cert,omitempty"` CaCert *string `url:"ca_cert,omitempty" json:"ca_cert,omitempty"`
...@@ -160,9 +160,17 @@ func (s *ProjectClustersService) AddCluster(pid interface{}, opt *AddClusterOpti ...@@ -160,9 +160,17 @@ func (s *ProjectClustersService) AddCluster(pid interface{}, opt *AddClusterOpti
// GitLab API docs: // GitLab API docs:
// https://docs.gitlab.com/ee/api/project_clusters.html#edit-project-cluster // https://docs.gitlab.com/ee/api/project_clusters.html#edit-project-cluster
type EditClusterOptions struct { type EditClusterOptions struct {
Name *string `url:"name,omitempty" json:"name,omitempty"` Name *string `url:"name,omitempty" json:"name,omitempty"`
EnvironmentScope *string `url:"environment_scope,omitempty" json:"environment_scope,omitempty"` EnvironmentScope *string `url:"environment_scope,omitempty" json:"environment_scope,omitempty"`
PlatformKubernetes *PlatformKubernetesOptions `url:"platform_kubernetes_attributes,omitempty" json:"platform_kubernetes_attributes,omitempty"` PlatformKubernetes *EditPlatformKubernetesOptions `url:"platform_kubernetes_attributes,omitempty" json:"platform_kubernetes_attributes,omitempty"`
}
// EditPlatformKubernetesOptions represents the available PlatformKubernetes options for editing.
type EditPlatformKubernetesOptions struct {
APIURL *string `url:"api_url,omitempty" json:"api_url,omitempty"`
Token *string `url:"token,omitempty" json:"token,omitempty"`
CaCert *string `url:"ca_cert,omitempty" json:"ca_cert,omitempty"`
Namespace *string `url:"namespace,omitempty" json:"namespace,omitempty"`
} }
// EditCluster updates an existing project cluster. // EditCluster updates an existing project cluster.
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment