Skip to content

Commit

Permalink
runtime and cluster
Browse files Browse the repository at this point in the history
  • Loading branch information
andrii-codefresh committed Jan 31, 2024
1 parent 1c5e5b7 commit 2d0fa16
Show file tree
Hide file tree
Showing 7 changed files with 165 additions and 223 deletions.
3 changes: 1 addition & 2 deletions controller/state.go
Original file line number Diff line number Diff line change
Expand Up @@ -209,8 +209,7 @@ func (m *appStateManager) getRepoObjs(app *v1alpha1.Application, sources []v1alp
ProjectName: proj.Name,
ProjectSourceRepos: proj.Spec.SourceRepos,
ApplicationIdentity: &apiclient.ApplicationIdentity{
Runtime: "runtime",
Cluster: "cluster",
Cluster: app.Spec.Destination.Server,
Namespace: app.Spec.Destination.Namespace,
Name: app.InstanceName(m.namespace),
},
Expand Down
5 changes: 2 additions & 3 deletions pkg/codefresh/client.go
Original file line number Diff line number Diff line change
Expand Up @@ -106,8 +106,8 @@ func (cc *CodefreshClient) Send(ctx context.Context, appName string, event *even
func (client *CodefreshClient) GetApplicationConfiguration(app *ApplicationIdentity) (*ApplicationConfiguration, error) {
query := GraphQLQuery{
Query: `
query ($runtime: String!, $cluster: String!, $namespace: String!, $name: String!) {
applicationConfiguration(runtime: $runtime, cluster: $cluster, namespace: $namespace, name: $name) {
query ($cluster: String!, $namespace: String!, $name: String!) {
applicationConfigurationByRuntime(cluster: $cluster, namespace: $namespace, name: $name) {
versionSource {
file
jsonPath
Expand All @@ -116,7 +116,6 @@ func (client *CodefreshClient) GetApplicationConfiguration(app *ApplicationIdent
}
`,
Variables: map[string]interface{}{
"runtime": app.Runtime,
"cluster": app.Cluster,
"namespace": app.Namespace,
"name": app.Name,
Expand Down
366 changes: 157 additions & 209 deletions reposerver/apiclient/repository.pb.go

Large diffs are not rendered by default.

1 change: 0 additions & 1 deletion reposerver/repository/repository.go
Original file line number Diff line number Diff line change
Expand Up @@ -637,7 +637,6 @@ func (s *Service) GenerateManifest(ctx context.Context, q *apiclient.ManifestReq
}

versionConfig := s.GetVersionConfig(&codefresh.ApplicationIdentity{
Runtime: q.ApplicationIdentity.Runtime,
Cluster: q.ApplicationIdentity.Cluster,
Namespace: q.ApplicationIdentity.Namespace,
Name: q.ApplicationIdentity.Name,
Expand Down
7 changes: 3 additions & 4 deletions reposerver/repository/repository.proto
Original file line number Diff line number Diff line change
Expand Up @@ -9,10 +9,9 @@ import "github.com/argoproj/argo-cd/v2/pkg/apis/application/v1alpha1/generated.p
import "google/protobuf/empty.proto";

message ApplicationIdentity {
string runtime = 1;
string cluster = 2;
string namespace = 3;
string name = 4;
string cluster = 1;
string namespace = 2;
string name = 3;
}

// ManifestRequest is a query for manifest generation.
Expand Down
3 changes: 1 addition & 2 deletions server/application/application.go
Original file line number Diff line number Diff line change
Expand Up @@ -508,8 +508,7 @@ func (s *Server) GetManifests(ctx context.Context, q *application.ApplicationMan
ProjectName: proj.Name,
ProjectSourceRepos: proj.Spec.SourceRepos,
ApplicationIdentity: &apiclient.ApplicationIdentity{
Runtime: "runtime",
Cluster: "cluster",
Cluster: a.Spec.Destination.Server,
Namespace: a.Spec.Destination.Namespace,
Name: a.InstanceName(s.ns),
},
Expand Down
3 changes: 1 addition & 2 deletions util/argo/argo.go
Original file line number Diff line number Diff line change
Expand Up @@ -774,8 +774,7 @@ func verifyGenerateManifests(
HasMultipleSources: hasMultipleSources,
RefSources: refSources,
ApplicationIdentity: &apiclient.ApplicationIdentity{
Runtime: "runtime",
Cluster: "cluster",
Cluster: dest.Server,
Namespace: dest.Namespace,
Name: name,
},
Expand Down

0 comments on commit 2d0fa16

Please sign in to comment.