public ResourceReferenceValidator()

in src/Azure.Deployments.Extensibility.Extensions.Kubernetes/Validation/ResourceReferenceValidator.cs [12:35]


        public ResourceReferenceValidator()
        {
            this.AnyValid(x => x.Type)
                .MustMatchRegex(RegexPatterns.ResourceType())
                    .WithErrorCode("InvalidResourceType");

            this.AnyValid(x => x.ApiVersion)
                .MustNotBeNull()
                    .WithErrorCode("NullApiVersion")
                    .WithErrorMessage("The Kubernetes resource API version must be provided and cannot be null.").AndThen
                .MustMatchRegex(RegexPatterns.ApiVersion())
                    .WithErrorCode("InvalidApiVersion");

            this.WhenPrecedingRulesSatisfied(x => x.Identifiers)
                .MustMatchJsonSchema(JsonSchemas.K8sResourceIdentifiers)
                    .WithErrorCode("InvalidIdentifier");

            this.AnyValid(x => x.Config)
                .MustNotBeNull()
                    .WithErrorCode("NullConfig")
                    .WithErrorMessage("The Kubernetes config must be provided and cannot be null.").AndThen
                .MustMatchJsonSchema(JsonSchemas.K8sResourceConfig)
                    .WithErrorCode("InvalidConfig");
        }