Closed pgpbpadilla closed 2 weeks ago
Hi @pgpbpadilla 👋
When registering an existing component, you should specify the template.yaml file for the url. For example:
https://git.mycompany.com/opa-admin/backstage-reference/-/blob/main/templates/my-new-project/template.yaml
I see the same behavior that you reported if I try to import the .backstage/catalog-info.yaml
file.
Can you confirm that you're importing the correct file?
I have now tried to use the template.yaml
and get the following:
{
"error": {
"name": "InputError",
"message": "InputError: No processor recognized the entity template:default/aws-s3-static-site as valid, possibly caused by a foreign kind or apiVersion"
},
"request": {
"method": "POST",
"url": "/locations?dryRun=true"
},
"response": {
"statusCode": 400
}
}
Here's the content of the template:
apiVersion: backstage.io/v1alpha1
# https://backstage.io/docs/features/software-catalog/descriptor-format#kind-template
kind: Template
metadata:
name: aws-s3-static-site
title: Static site hosted in AWS S3 Bucket
description: >-
Create a static site hosted in Amazon S3 Bucket.
tags:
- html
- static-site
- s3
- aws
spec:
owner: group:admins
type: website
# The rest of the template is a copy of: https://github.com/awslabs/harmonix/blob/main/backstage-reference/templates/aws-s3-resource/template.yaml
Basically I just duplicated the parent directory of aws-s3-resource and then renamed a few things.
Check the apiVersion
value. The value for a scaffolder template should be:
apiVersion: scaffolder.backstage.io/v1beta3
Regarding discovery of the template, you may need to check the allTemplates.yaml
file in the backstage-reference repository and ensure that you've got a reference for your new template.
That was the issue 😓
Description
Duplicated an existing template by copying the whole template directory and renaming it. I edited the key fields like name, type, etc. I waited for the scanner to import my new template, but nothing happened after the scheduled interval. I tried to register the template using the UI but it failed:
catalog-info.yaml:
Versions
yarn list --cwd backstage --pattern aws-apps
Reproduction Code [Required]
Steps to reproduce the behavior:
Expected behavior
My template should be registered and then I should see it in the Catalog.
Actual behavior
Registration fails with error provided above.
Terminal Output Screenshot(s)
Additional context