Skip to content

Commit

Permalink
Fixes in GraphQL dump
Browse files Browse the repository at this point in the history
  • Loading branch information
akgalwas committed Jul 31, 2024
1 parent 97af796 commit 35580ff
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 0 deletions.
3 changes: 3 additions & 0 deletions components/provisioner/internal/api/resolver.go
Original file line number Diff line number Diff line change
Expand Up @@ -63,6 +63,7 @@ func (r *Resolver) ProvisionRuntime(ctx context.Context, config gqlschema.Provis
log.Infof("Requested provisioning of Runtime %s.", config.RuntimeInput.Name)

if r.enableDumpShootSpec {
log.Infof("Saving GraphQL query for Runtime %s.", config.RuntimeInput.Name)
path := fmt.Sprintf("/testdata/provisioner/%s-shoot.yaml", config.RuntimeInput.Name)
err := testkit.PersistGraphQL(path, config)

Expand All @@ -71,6 +72,8 @@ func (r *Resolver) ProvisionRuntime(ctx context.Context, config gqlschema.Provis
} else {
log.Infof("GraphQL query dumped to %s", path)
}
} else {
log.Infof("GraphQL query not saved. Shoot Spec Dump feature is disabled.")
}

operationStatus, err := r.provisioning.ProvisionRuntime(config, tenant, subAccount)
Expand Down
1 change: 1 addition & 0 deletions components/provisioner/internal/gardener/provisioner.go
Original file line number Diff line number Diff line change
Expand Up @@ -97,6 +97,7 @@ func (g *GardenerProvisioner) ProvisionCluster(cluster model.Cluster, operationI

if g.enableDumpShootSpec {
path := fmt.Sprintf("%s/%s-%s.yaml", "/testdata/provisioner", shootTemplate.Namespace, shootTemplate.Name)
log.Infof("Saving Shoot spec for %s Runtime", cluster.ID)
if err := testkit.PersistShoot(path, shootTemplate); err != nil {
log.Errorf("Error marshaling Shoot spec: %s", err.Error())
}
Expand Down

0 comments on commit 35580ff

Please sign in to comment.