Skip to content

Commit

Permalink
chore: improve app destination docstrings (argoproj#14836)
Browse files Browse the repository at this point in the history
Signed-off-by: Michael Crenshaw <350466+crenshaw-dev@users.noreply.github.com>
Signed-off-by: jmilic1 <70441727+jmilic1@users.noreply.github.com>
  • Loading branch information
crenshaw-dev authored and jmilic1 committed Nov 13, 2023
1 parent 657daf1 commit c7b952c
Show file tree
Hide file tree
Showing 10 changed files with 77 additions and 52 deletions.
8 changes: 4 additions & 4 deletions assets/swagger.json
Original file line number Diff line number Diff line change
Expand Up @@ -5852,16 +5852,16 @@
"title": "ApplicationDestination holds information about the application's destination",
"properties": {
"name": {
"type": "string",
"title": "Name is an alternate way of specifying the target cluster by its symbolic name"
"description": "Name is an alternate way of specifying the target cluster by its symbolic name. This must be set if Server is not set.",
"type": "string"
},
"namespace": {
"type": "string",
"title": "Namespace specifies the target namespace for the application's resources.\nThe namespace will only be set for namespace-scoped resources that have not set a value for .metadata.namespace"
},
"server": {
"type": "string",
"title": "Server specifies the URL of the target cluster and must be set to the Kubernetes control plane API"
"description": "Server specifies the URL of the target cluster's Kubernetes control plane API. This must be set if Name is not set.",
"type": "string"
}
}
},
Expand Down
24 changes: 15 additions & 9 deletions manifests/core-install.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -787,16 +787,18 @@ spec:
properties:
name:
description: Name is an alternate way of specifying the target
cluster by its symbolic name
cluster by its symbolic name. This must be set if Server is
not set.
type: string
namespace:
description: Namespace specifies the target namespace for the
application's resources. The namespace will only be set for
namespace-scoped resources that have not set a value for .metadata.namespace
type: string
server:
description: Server specifies the URL of the target cluster and
must be set to the Kubernetes control plane API
description: Server specifies the URL of the target cluster's
Kubernetes control plane API. This must be set if Name is not
set.
type: string
type: object
ignoreDifferences:
Expand Down Expand Up @@ -3794,7 +3796,8 @@ spec:
properties:
name:
description: Name is an alternate way of specifying the
target cluster by its symbolic name
target cluster by its symbolic name. This must be set
if Server is not set.
type: string
namespace:
description: Namespace specifies the target namespace
Expand All @@ -3803,8 +3806,9 @@ spec:
not set a value for .metadata.namespace
type: string
server:
description: Server specifies the URL of the target cluster
and must be set to the Kubernetes control plane API
description: Server specifies the URL of the target cluster's
Kubernetes control plane API. This must be set if Name
is not set.
type: string
type: object
ignoreDifferences:
Expand Down Expand Up @@ -18155,16 +18159,18 @@ spec:
properties:
name:
description: Name is an alternate way of specifying the target
cluster by its symbolic name
cluster by its symbolic name. This must be set if Server is
not set.
type: string
namespace:
description: Namespace specifies the target namespace for the
application's resources. The namespace will only be set for
namespace-scoped resources that have not set a value for .metadata.namespace
type: string
server:
description: Server specifies the URL of the target cluster
and must be set to the Kubernetes control plane API
description: Server specifies the URL of the target cluster's
Kubernetes control plane API. This must be set if Name is
not set.
type: string
type: object
type: array
Expand Down
16 changes: 10 additions & 6 deletions manifests/crds/application-crd.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -786,16 +786,18 @@ spec:
properties:
name:
description: Name is an alternate way of specifying the target
cluster by its symbolic name
cluster by its symbolic name. This must be set if Server is
not set.
type: string
namespace:
description: Namespace specifies the target namespace for the
application's resources. The namespace will only be set for
namespace-scoped resources that have not set a value for .metadata.namespace
type: string
server:
description: Server specifies the URL of the target cluster and
must be set to the Kubernetes control plane API
description: Server specifies the URL of the target cluster's
Kubernetes control plane API. This must be set if Name is not
set.
type: string
type: object
ignoreDifferences:
Expand Down Expand Up @@ -3793,7 +3795,8 @@ spec:
properties:
name:
description: Name is an alternate way of specifying the
target cluster by its symbolic name
target cluster by its symbolic name. This must be set
if Server is not set.
type: string
namespace:
description: Namespace specifies the target namespace
Expand All @@ -3802,8 +3805,9 @@ spec:
not set a value for .metadata.namespace
type: string
server:
description: Server specifies the URL of the target cluster
and must be set to the Kubernetes control plane API
description: Server specifies the URL of the target cluster's
Kubernetes control plane API. This must be set if Name
is not set.
type: string
type: object
ignoreDifferences:
Expand Down
8 changes: 5 additions & 3 deletions manifests/crds/appproject-crd.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -88,16 +88,18 @@ spec:
properties:
name:
description: Name is an alternate way of specifying the target
cluster by its symbolic name
cluster by its symbolic name. This must be set if Server is
not set.
type: string
namespace:
description: Namespace specifies the target namespace for the
application's resources. The namespace will only be set for
namespace-scoped resources that have not set a value for .metadata.namespace
type: string
server:
description: Server specifies the URL of the target cluster
and must be set to the Kubernetes control plane API
description: Server specifies the URL of the target cluster's
Kubernetes control plane API. This must be set if Name is
not set.
type: string
type: object
type: array
Expand Down
24 changes: 15 additions & 9 deletions manifests/ha/install.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -787,16 +787,18 @@ spec:
properties:
name:
description: Name is an alternate way of specifying the target
cluster by its symbolic name
cluster by its symbolic name. This must be set if Server is
not set.
type: string
namespace:
description: Namespace specifies the target namespace for the
application's resources. The namespace will only be set for
namespace-scoped resources that have not set a value for .metadata.namespace
type: string
server:
description: Server specifies the URL of the target cluster and
must be set to the Kubernetes control plane API
description: Server specifies the URL of the target cluster's
Kubernetes control plane API. This must be set if Name is not
set.
type: string
type: object
ignoreDifferences:
Expand Down Expand Up @@ -3794,7 +3796,8 @@ spec:
properties:
name:
description: Name is an alternate way of specifying the
target cluster by its symbolic name
target cluster by its symbolic name. This must be set
if Server is not set.
type: string
namespace:
description: Namespace specifies the target namespace
Expand All @@ -3803,8 +3806,9 @@ spec:
not set a value for .metadata.namespace
type: string
server:
description: Server specifies the URL of the target cluster
and must be set to the Kubernetes control plane API
description: Server specifies the URL of the target cluster's
Kubernetes control plane API. This must be set if Name
is not set.
type: string
type: object
ignoreDifferences:
Expand Down Expand Up @@ -18155,16 +18159,18 @@ spec:
properties:
name:
description: Name is an alternate way of specifying the target
cluster by its symbolic name
cluster by its symbolic name. This must be set if Server is
not set.
type: string
namespace:
description: Namespace specifies the target namespace for the
application's resources. The namespace will only be set for
namespace-scoped resources that have not set a value for .metadata.namespace
type: string
server:
description: Server specifies the URL of the target cluster
and must be set to the Kubernetes control plane API
description: Server specifies the URL of the target cluster's
Kubernetes control plane API. This must be set if Name is
not set.
type: string
type: object
type: array
Expand Down
24 changes: 15 additions & 9 deletions manifests/install.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -787,16 +787,18 @@ spec:
properties:
name:
description: Name is an alternate way of specifying the target
cluster by its symbolic name
cluster by its symbolic name. This must be set if Server is
not set.
type: string
namespace:
description: Namespace specifies the target namespace for the
application's resources. The namespace will only be set for
namespace-scoped resources that have not set a value for .metadata.namespace
type: string
server:
description: Server specifies the URL of the target cluster and
must be set to the Kubernetes control plane API
description: Server specifies the URL of the target cluster's
Kubernetes control plane API. This must be set if Name is not
set.
type: string
type: object
ignoreDifferences:
Expand Down Expand Up @@ -3794,7 +3796,8 @@ spec:
properties:
name:
description: Name is an alternate way of specifying the
target cluster by its symbolic name
target cluster by its symbolic name. This must be set
if Server is not set.
type: string
namespace:
description: Namespace specifies the target namespace
Expand All @@ -3803,8 +3806,9 @@ spec:
not set a value for .metadata.namespace
type: string
server:
description: Server specifies the URL of the target cluster
and must be set to the Kubernetes control plane API
description: Server specifies the URL of the target cluster's
Kubernetes control plane API. This must be set if Name
is not set.
type: string
type: object
ignoreDifferences:
Expand Down Expand Up @@ -18155,16 +18159,18 @@ spec:
properties:
name:
description: Name is an alternate way of specifying the target
cluster by its symbolic name
cluster by its symbolic name. This must be set if Server is
not set.
type: string
namespace:
description: Namespace specifies the target namespace for the
application's resources. The namespace will only be set for
namespace-scoped resources that have not set a value for .metadata.namespace
type: string
server:
description: Server specifies the URL of the target cluster
and must be set to the Kubernetes control plane API
description: Server specifies the URL of the target cluster's
Kubernetes control plane API. This must be set if Name is
not set.
type: string
type: object
type: array
Expand Down
4 changes: 2 additions & 2 deletions pkg/apis/application/v1alpha1/generated.proto

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

4 changes: 2 additions & 2 deletions pkg/apis/application/v1alpha1/openapi_generated.go

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

4 changes: 2 additions & 2 deletions pkg/apis/application/v1alpha1/types.go
Original file line number Diff line number Diff line change
Expand Up @@ -860,12 +860,12 @@ func (c *ApplicationSourcePlugin) RemoveEnvEntry(key string) error {

// ApplicationDestination holds information about the application's destination
type ApplicationDestination struct {
// Server specifies the URL of the target cluster and must be set to the Kubernetes control plane API
// Server specifies the URL of the target cluster's Kubernetes control plane API. This must be set if Name is not set.
Server string `json:"server,omitempty" protobuf:"bytes,1,opt,name=server"`
// Namespace specifies the target namespace for the application's resources.
// The namespace will only be set for namespace-scoped resources that have not set a value for .metadata.namespace
Namespace string `json:"namespace,omitempty" protobuf:"bytes,2,opt,name=namespace"`
// Name is an alternate way of specifying the target cluster by its symbolic name
// Name is an alternate way of specifying the target cluster by its symbolic name. This must be set if Server is not set.
Name string `json:"name,omitempty" protobuf:"bytes,3,opt,name=name"`

// nolint:govet
Expand Down
13 changes: 7 additions & 6 deletions server/extension/extension.go
Original file line number Diff line number Diff line change
Expand Up @@ -12,16 +12,17 @@ import (
"strings"
"time"

v1alpha1 "github.com/argoproj/argo-cd/v2/pkg/apis/application/v1alpha1"
"github.com/gorilla/mux"
log "github.com/sirupsen/logrus"
"sigs.k8s.io/yaml"

"github.com/argoproj/argo-cd/v2/pkg/apis/application/v1alpha1"
applisters "github.com/argoproj/argo-cd/v2/pkg/client/listers/application/v1alpha1"
"github.com/argoproj/argo-cd/v2/server/rbacpolicy"
"github.com/argoproj/argo-cd/v2/util/argo"
"github.com/argoproj/argo-cd/v2/util/db"
"github.com/argoproj/argo-cd/v2/util/security"
"github.com/argoproj/argo-cd/v2/util/settings"
"github.com/gorilla/mux"
log "github.com/sirupsen/logrus"
"sigs.k8s.io/yaml"
)

const (
Expand Down Expand Up @@ -140,10 +141,10 @@ type ServiceConfig struct {
}

type ClusterConfig struct {
// Server specifies the URL of the target cluster and must be set to the Kubernetes control plane API
// Server specifies the URL of the target cluster's Kubernetes control plane API. This must be set if Name is not set.
Server string `json:"server"`

// Name is an alternate way of specifying the target cluster by its symbolic name
// Name is an alternate way of specifying the target cluster by its symbolic name. This must be set if Server is not set.
Name string `json:"name"`
}

Expand Down

0 comments on commit c7b952c

Please sign in to comment.