Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 4 additions & 4 deletions cmd/argocd/commands/app.go
Original file line number Diff line number Diff line change
Expand Up @@ -262,8 +262,8 @@ func NewApplicationSetCommand(clientOpts *argocdclient.ClientOptions) *cobra.Com
}
setParameterOverrides(app, appOpts.parameters)
_, err = appIf.UpdateSpec(context.Background(), &application.ApplicationSpecRequest{
AppName: &app.Name,
Spec: app.Spec,
Name: &app.Name,
Spec: app.Spec,
})
errors.CheckError(err)
},
Expand Down Expand Up @@ -330,8 +330,8 @@ func NewApplicationUnsetCommand(clientOpts *argocdclient.ClientOptions) *cobra.C
return
}
_, err = appIf.UpdateSpec(context.Background(), &application.ApplicationSpecRequest{
AppName: &app.Name,
Spec: app.Spec,
Name: &app.Name,
Spec: app.Spec,
})
errors.CheckError(err)
},
Expand Down
28 changes: 14 additions & 14 deletions server/application/application.go
Original file line number Diff line number Diff line change
Expand Up @@ -98,8 +98,8 @@ func (s *Server) Create(ctx context.Context, q *ApplicationCreateRequest) (*appv
}

// GetManifests returns application manifests
func (s *Server) GetManifests(ctx context.Context, q *ManifestQuery) (*repository.ManifestResponse, error) {
app, err := s.appclientset.ArgoprojV1alpha1().Applications(s.ns).Get(*q.AppName, metav1.GetOptions{})
func (s *Server) GetManifests(ctx context.Context, q *ApplicationManifestQuery) (*repository.ManifestResponse, error) {
app, err := s.appclientset.ArgoprojV1alpha1().Applications(s.ns).Get(*q.Name, metav1.GetOptions{})
if err != nil {
return nil, err
}
Expand All @@ -119,8 +119,8 @@ func (s *Server) GetManifests(ctx context.Context, q *ManifestQuery) (*repositor
}

revision := app.Spec.Source.TargetRevision
if q.Revision != nil && *q.Revision != "" {
revision = *q.Revision
if q.Revision != "" {
revision = q.Revision
}
manifestInfo, err := repoClient.GenerateManifest(context.Background(), &repository.ManifestRequest{
Repo: repo,
Expand All @@ -144,7 +144,7 @@ func (s *Server) Get(ctx context.Context, q *ApplicationQuery) (*appv1.Applicati

// ListResourceEvents returns a list of event resources
func (s *Server) ListResourceEvents(ctx context.Context, q *ApplicationResourceEventsQuery) (*v1.EventList, error) {
config, namespace, err := s.getApplicationClusterConfig(*q.AppName)
config, namespace, err := s.getApplicationClusterConfig(*q.Name)
if err != nil {
return nil, err
}
Expand All @@ -154,8 +154,8 @@ func (s *Server) ListResourceEvents(ctx context.Context, q *ApplicationResourceE
}

fieldSelector := fields.SelectorFromSet(map[string]string{
"involvedObject.name": *q.ResName,
"involvedObject.uid": *q.ResUid,
"involvedObject.name": q.ResourceName,
"involvedObject.uid": q.ResourceUID,
"involvedObject.namespace": namespace,
}).String()

Expand Down Expand Up @@ -187,7 +187,7 @@ func (s *Server) UpdateSpec(ctx context.Context, q *ApplicationSpecRequest) (*ap
if err != nil {
return nil, err
}
_, err = s.appclientset.ArgoprojV1alpha1().Applications(s.ns).Patch(*q.AppName, types.MergePatchType, patch)
_, err = s.appclientset.ArgoprojV1alpha1().Applications(s.ns).Patch(*q.Name, types.MergePatchType, patch)
return &q.Spec, err
}

Expand Down Expand Up @@ -361,16 +361,16 @@ func (s *Server) ensurePodBelongsToApp(applicationName string, podName, namespac
return nil
}

func (s *Server) DeletePod(ctx context.Context, q *DeletePodQuery) (*ApplicationResponse, error) {
config, namespace, err := s.getApplicationClusterConfig(*q.ApplicationName)
func (s *Server) DeletePod(ctx context.Context, q *ApplicationDeletePodRequest) (*ApplicationResponse, error) {
config, namespace, err := s.getApplicationClusterConfig(*q.Name)
if err != nil {
return nil, err
}
kubeClientset, err := kubernetes.NewForConfig(config)
if err != nil {
return nil, err
}
err = s.ensurePodBelongsToApp(*q.ApplicationName, *q.PodName, namespace, kubeClientset)
err = s.ensurePodBelongsToApp(*q.Name, *q.PodName, namespace, kubeClientset)
if err != nil {
return nil, err
}
Expand All @@ -381,16 +381,16 @@ func (s *Server) DeletePod(ctx context.Context, q *DeletePodQuery) (*Application
return &ApplicationResponse{}, nil
}

func (s *Server) PodLogs(q *PodLogsQuery, ws ApplicationService_PodLogsServer) error {
config, namespace, err := s.getApplicationClusterConfig(*q.ApplicationName)
func (s *Server) PodLogs(q *ApplicationPodLogsQuery, ws ApplicationService_PodLogsServer) error {
config, namespace, err := s.getApplicationClusterConfig(*q.Name)
if err != nil {
return err
}
kubeClientset, err := kubernetes.NewForConfig(config)
if err != nil {
return err
}
err = s.ensurePodBelongsToApp(*q.ApplicationName, *q.PodName, namespace, kubeClientset)
err = s.ensurePodBelongsToApp(*q.Name, *q.PodName, namespace, kubeClientset)
if err != nil {
return err
}
Expand Down
Loading