Skip to content

Commit e2cecd6

Browse files
authored
Merge pull request #778 from spring-projects/LukeBalizet-update-registry-image-schema
Luke balizet update registry image schema
2 parents 9015092 + 94576ec commit e2cecd6

File tree

15 files changed

+191
-29
lines changed

15 files changed

+191
-29
lines changed

headless-services/concourse-language-server/src/main/java/org/springframework/ide/vscode/concourse/PipelineYmlSchema.java

Lines changed: 52 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -62,6 +62,7 @@
6262

6363
/**
6464
* @author Kris De Volder
65+
* @author LukeBalizet
6566
*/
6667
public class PipelineYmlSchema implements YamlSchema {
6768

@@ -156,14 +157,32 @@ public class PipelineYmlSchema implements YamlSchema {
156157
public final YType t_semver = f.yatomic("Semver")
157158
.parseWith(ValueParsers.NE_STRING); //TODO: use real semver parser.
158159

159-
public final YType t_s3_region = f.yenum("S3Region",
160-
//See: https://docs.aws.amazon.com/AmazonS3/latest/API/RESTBucketPUT.html
161-
"us-west-1", "us-west-2",
162-
"ca-central-1", "EU", "eu-west-1",
163-
"eu-west-2", "eu-central-1",
164-
"ap-south-1", "ap-southeast-1", "ap-southeast-2", "ap-northeast-1", "ap-northeast-2",
165-
"sa-east-1",
166-
"us-east-2"
160+
public final YType t_aws_region = f.yenum("AWSRegion",
161+
//See https://docs.aws.amazon.com/general/latest/gr/rande.html
162+
"af-south-1",
163+
"ap-east-1",
164+
"ap-southeast-3",
165+
"ap-south-1",
166+
"ap-northeast-3",
167+
"ap-northeast-2",
168+
"ap-southeast-1",
169+
"ap-southeast-2",
170+
"ap-northeast-1",
171+
"ca-central-1",
172+
"cn-north-1",
173+
"cn-northwest-1",
174+
"eu-central-1",
175+
"eu-west-1",
176+
"eu-west-2",
177+
"eu-south-1",
178+
"eu-west-3",
179+
"eu-north-1",
180+
"me-south-1",
181+
"us-east-1",
182+
"us-east-2",
183+
"us-west-1",
184+
"us-west-2",
185+
"sa-east-1"
167186
);
168187

169188
public final YType t_day = f.yenum("Day",
@@ -606,14 +625,16 @@ private void initializeDefaultResourceTypes() {
606625
put.require(Constraints.requireAtMostOneOf("rebase", "merge"));
607626
resourceTypes.def("git", source, get, put);
608627
}
628+
629+
// Shared by docker-image and registry-image
630+
AbstractType registry_mirror = f.ybean("RegistryMirror");
631+
addProp(registry_mirror, "host", t_ne_string).isPrimary(true);
632+
addProp(registry_mirror, "username", t_ne_string);
633+
addProp(registry_mirror, "password", t_ne_string);
634+
609635
//docker-image:
610636
{
611637

612-
AbstractType registry_mirror = f.ybean("RegistryMirror");
613-
addProp(registry_mirror, "host", t_ne_string).isPrimary(true);
614-
addProp(registry_mirror, "username", t_ne_string);
615-
addProp(registry_mirror, "password", t_ne_string);
616-
617638
AbstractType source = f.ybean("DockerImageSource");
618639
addProp(source, "repository", t_ne_string).isPrimary(true);
619640
addProp(source, "tag", t_ne_string);
@@ -670,14 +691,24 @@ private void initializeDefaultResourceTypes() {
670691

671692
resourceTypes.def("docker-image", source, get, put);
672693
}
673-
//registry_image
694+
//registry-image
674695
{
675696
AbstractType source = f.ybean("RegistryImageSource");
676697
addProp(source, "repository", t_ne_string).isPrimary(true);
698+
addProp(source, "insecure", t_boolean);
677699
addProp(source, "tag", t_ne_string);
700+
addProp(source, "variant", t_ne_string);
701+
addProp(source, "semver_constraint", t_ne_string);
678702
addProp(source, "username", t_ne_string);
679703
addProp(source, "password", t_ne_string);
704+
addProp(source, "aws_access_key_id", t_ne_string);
705+
addProp(source, "aws_secret_access_key", t_ne_string);
706+
addProp(source, "aws_session_token", t_ne_string);
707+
addProp(source, "aws_region", t_aws_region);
708+
addProp(source, "aws_role_arn", t_ne_string);
709+
addProp(source, "aws_role_arns", t_strings);
680710
addProp(source, "debug", t_boolean);
711+
addProp(source, "registry_mirror", registry_mirror);
681712
{
682713
AbstractType contentTrust = f.ybean("RegistryImageContentTrust");
683714
addProp(contentTrust, "server", t_ne_string);
@@ -689,16 +720,21 @@ private void initializeDefaultResourceTypes() {
689720

690721
addProp(source, "content_trust", contentTrust);
691722
}
723+
addProp(source, "ca_certs", t_strings);
692724

693725
AbstractType get = f.ybean("RegistryImageGetParams");
694726
addProp(get, "format", f.yenum("RegistryImageFormat", "rootfs", "oci"));
695727
addProp(get, "skip_download", t_boolean);
696728

697729
AbstractType put = f.ybean("RegistryImagePutParams");
698730
addProp(put, "image", t_ne_string).isPrimary(true);
731+
addProp(put, "version", t_ne_string);
732+
addProp(put, "bump_aliases", t_boolean);
699733
addProp(put, "additional_tags", t_ne_string);
700734

701735
resourceTypes.def("registry-image", source, get, put);
736+
737+
source.require(Constraints.mutuallyExclusive("aws_role_arn", "aws_role_arns"));
702738
}
703739
//s3
704740
{
@@ -714,7 +750,7 @@ private void initializeDefaultResourceTypes() {
714750
addProp(source, "access_key_id", t_ne_string);
715751
addProp(source, "secret_access_key", t_ne_string);
716752
addProp(source, "session_token", t_ne_string);
717-
addProp(source, "region_name", t_s3_region);
753+
addProp(source, "region_name", t_aws_region);
718754
addProp(source, "private", t_boolean);
719755
addProp(source, "cloudfront_url", t_ne_string);
720756
addProp(source, "endpoint", t_ne_string);
@@ -790,7 +826,7 @@ private void initializeDefaultResourceTypes() {
790826
addProp(s3_source, "key", t_ne_string).isRequired(true);
791827
addProp(s3_source, "access_key_id", t_ne_string).isRequired(true);
792828
addProp(s3_source, "secret_access_key", t_ne_string).isRequired(true);
793-
addProp(s3_source, "region_name", t_s3_region);
829+
addProp(s3_source, "region_name", t_aws_region);
794830
addProp(s3_source, "endpoint", t_ne_string);
795831
addProp(s3_source, "disable_ssl", t_boolean);
796832

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
*Optional. Default `false`.* When set to `true` and `version` is specified
2+
automatically bump alias tags for the version. For example, when pushing version
3+
`1.2.3`, push the same image to the following tags:
4+
- `1.2`, if 1.2.3 is the latest version of 1.2.x.
5+
- `1`, if 1.2.3 is the latest version of 1.x.
6+
- `latest`, if 1.2.3 is the latest version overall.
7+
8+
If `variant` is configured as `foo`, push the same image to the following tags:
9+
- `1.2-foo`, if 1.2.3 is the latest version of 1.2.x with `foo`.
10+
- `1-foo`, if 1.2.3 is the latest version of 1.x with `foo`.
11+
- `foo`, if 1.2.3 is the latest version overall for `foo`
Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
*Optional.* A version number to use as a tag.
Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
*Optional*. The access key ID to use for authenticating with ECR.
Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
*Optional*. The region to use for
2+
accessing ECR. This is required if you are using ECR. This region
3+
will help determine the full repository URL you are accessing
4+
(e.g., `012345678910.dkr.ecr.us-east-1.amazonaws.com`)
Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
*Optional*. If set, then this role will
2+
be assumed before authenticating to ECR. An error will occur if
3+
`aws_role_arns` is also specified. This is kept for backward compatibility.
Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
*Optional*. An array of AWS IAM roles.
2+
If set, these roles will be assumed in the specified order before
3+
authenticating to ECR. An error will occur if `aws_role_arn`
4+
is also specified.
Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
*Optional*. The secret access key to use for authenticating with ECR.
Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
*Optional*. The session token to use for authenticating with
2+
STS credentials with ECR.
Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,15 @@
1+
*Optional*. An array of PEM-encoded CA certificates. Example:
2+
```yaml
3+
ca_certs:
4+
- |
5+
-----BEGIN CERTIFICATE-----
6+
...
7+
-----END CERTIFICATE-----
8+
- |
9+
-----BEGIN CERTIFICATE-----
10+
...
11+
-----END CERTIFICATE-----
12+
```
13+
Each entry specifies the x509 CA certificate for the trusted docker registry.
14+
This is used to validate the certificate of the docker registry when the
15+
registry's certificate is signed by a custom authority (or itself).

0 commit comments

Comments
 (0)