diff --git a/config/domain-mapping/300-resources/domain-claim.yaml b/config/core/300-resources/domain-claim.yaml similarity index 100% rename from config/domain-mapping/300-resources/domain-claim.yaml rename to config/core/300-resources/domain-claim.yaml diff --git a/config/core/300-resources/domain-mapping.yaml b/config/core/300-resources/domain-mapping.yaml new file mode 100644 index 0000000000..b89d01f28f --- /dev/null +++ b/config/core/300-resources/domain-mapping.yaml @@ -0,0 +1,151 @@ +# Copyright 2020 The Knative Authors +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +apiVersion: apiextensions.k8s.io/v1 +kind: CustomResourceDefinition +metadata: + name: domainmappings.serving.knative.dev + labels: + serving.knative.dev/release: devel + knative.dev/crd-install: "true" +spec: + group: serving.knative.dev + versions: + - name: v1alpha1 + served: true + storage: true + subresources: + status: {} + schema: + openAPIV3Schema: + description: DomainMapping is a mapping from a custom hostname to an Addressable. + type: object + properties: + apiVersion: + description: 'APIVersion defines the versioned schema of this representation of an object. Servers should convert recognized schemas to the latest internal value, and may reject unrecognized values. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#resources' + type: string + kind: + description: 'Kind is a string value representing the REST resource this object represents. Servers may infer this from the endpoint the client submits requests to. Cannot be updated. In CamelCase. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#types-kinds' + type: string + metadata: + type: object + spec: + description: 'Spec is the desired state of the DomainMapping. More info: https://github.com/kubernetes/community/blob/master/contributors/devel/sig-architecture/api-conventions.md#spec-and-status' + type: object + required: + - ref + properties: + ref: + description: "Ref specifies the target of the Domain Mapping. \n The object identified by the Ref must be an Addressable with a URL of the form `{name}.{namespace}.{domain}` where `{domain}` is the cluster domain, and `{name}` and `{namespace}` are the name and namespace of a Kubernetes Service. \n This contract is satisfied by Knative types such as Knative Services and Knative Routes, and by Kubernetes Services." + type: object + required: + - kind + - name + properties: + apiVersion: + description: API version of the referent. + type: string + group: + description: 'Group of the API, without the version of the group. This can be used as an alternative to the APIVersion, and then resolved using ResolveGroup. Note: This API is EXPERIMENTAL and might break anytime. For more details: https://github.com/knative/eventing/issues/5086' + type: string + kind: + description: 'Kind of the referent. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#types-kinds' + type: string + name: + description: 'Name of the referent. More info: https://kubernetes.io/docs/concepts/overview/working-with-objects/names/#names' + type: string + namespace: + description: 'Namespace of the referent. More info: https://kubernetes.io/docs/concepts/overview/working-with-objects/namespaces/ This is optional field, it gets defaulted to the object holding it if left out.' + type: string + tls: + description: TLS allows the DomainMapping to terminate TLS traffic with an existing secret. + type: object + required: + - secretName + properties: + secretName: + description: SecretName is the name of the existing secret used to terminate TLS traffic. + type: string + status: + description: 'Status is the current state of the DomainMapping. More info: https://github.com/kubernetes/community/blob/master/contributors/devel/sig-architecture/api-conventions.md#spec-and-status' + type: object + properties: + address: + description: Address holds the information needed for a DomainMapping to be the target of an event. + type: object + properties: + url: + type: string + annotations: + description: Annotations is additional Status fields for the Resource to save some additional State as well as convey more information to the user. This is roughly akin to Annotations on any k8s resource, just the reconciler conveying richer information outwards. + type: object + additionalProperties: + type: string + conditions: + description: Conditions the latest available observations of a resource's current state. + type: array + items: + description: 'Condition defines a readiness condition for a Knative resource. See: https://github.com/kubernetes/community/blob/master/contributors/devel/sig-architecture/api-conventions.md#typical-status-properties' + type: object + required: + - status + - type + properties: + lastTransitionTime: + description: LastTransitionTime is the last time the condition transitioned from one status to another. We use VolatileTime in place of metav1.Time to exclude this from creating equality.Semantic differences (all other things held constant). + type: string + format: date-time + message: + description: A human readable message indicating details about the transition. + type: string + reason: + description: The reason for the condition's last transition. + type: string + severity: + description: Severity with which to treat failures of this type of condition. When this is not specified, it defaults to Error. + type: string + status: + description: Status of the condition, one of True, False, Unknown. + type: string + type: + description: Type of condition. + type: string + observedGeneration: + description: ObservedGeneration is the 'Generation' of the Service that was last processed by the controller. + type: integer + format: int64 + url: + description: URL is the URL of this DomainMapping. + type: string + additionalPrinterColumns: + - name: URL + type: string + jsonPath: .status.url + - name: Ready + type: string + jsonPath: ".status.conditions[?(@.type=='Ready')].status" + - name: Reason + type: string + jsonPath: ".status.conditions[?(@.type=='Ready')].reason" + names: + kind: DomainMapping + plural: domainmappings + singular: domainmapping + categories: + - all + - knative + - serving + shortNames: + - dm + scope: Namespaced diff --git a/config/domain-mapping/controller.yaml b/config/core/deployments/domainmapping-controller.yaml similarity index 100% rename from config/domain-mapping/controller.yaml rename to config/core/deployments/domainmapping-controller.yaml diff --git a/config/domain-mapping/webhook.yaml b/config/core/deployments/domainmapping-webhook.yaml similarity index 100% rename from config/domain-mapping/webhook.yaml rename to config/core/deployments/domainmapping-webhook.yaml diff --git a/config/domain-mapping/webhooks/defaulting.yaml b/config/core/webhooks/domainmapping-defaulting.yaml similarity index 100% rename from config/domain-mapping/webhooks/defaulting.yaml rename to config/core/webhooks/domainmapping-defaulting.yaml diff --git a/config/domain-mapping/webhooks/secret.yaml b/config/core/webhooks/domainmapping-secret.yaml similarity index 100% rename from config/domain-mapping/webhooks/secret.yaml rename to config/core/webhooks/domainmapping-secret.yaml diff --git a/config/domain-mapping/webhooks/validation.yaml b/config/core/webhooks/domainmapping-validation.yaml similarity index 100% rename from config/domain-mapping/webhooks/validation.yaml rename to config/core/webhooks/domainmapping-validation.yaml diff --git a/config/domain-mapping/300-resources/domain-mapping.yaml b/config/domain-mapping/300-resources/domain-mapping.yaml deleted file mode 100644 index afb000f947..0000000000 --- a/config/domain-mapping/300-resources/domain-mapping.yaml +++ /dev/null @@ -1,58 +0,0 @@ -# Copyright 2020 The Knative Authors -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# https://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - -apiVersion: apiextensions.k8s.io/v1 -kind: CustomResourceDefinition -metadata: - name: domainmappings.serving.knative.dev - labels: - serving.knative.dev/release: devel - knative.dev/crd-install: "true" -spec: - group: serving.knative.dev - versions: - - name: v1alpha1 - served: true - storage: true - subresources: - status: {} - schema: - openAPIV3Schema: - type: object - # this is a work around so we don't need to flush out the - # schema for each version at this time - # - # see issue: https://github.com/knative/serving/issues/912 - x-kubernetes-preserve-unknown-fields: true - additionalPrinterColumns: - - name: URL - type: string - jsonPath: .status.url - - name: Ready - type: string - jsonPath: ".status.conditions[?(@.type=='Ready')].status" - - name: Reason - type: string - jsonPath: ".status.conditions[?(@.type=='Ready')].reason" - names: - kind: DomainMapping - plural: domainmappings - singular: domainmapping - categories: - - all - - knative - - serving - shortNames: - - dm - scope: Namespaced diff --git a/config/domain-mapping/300-resources/placeholder.go b/config/domain-mapping/300-resources/placeholder.go deleted file mode 100644 index df642fe158..0000000000 --- a/config/domain-mapping/300-resources/placeholder.go +++ /dev/null @@ -1,19 +0,0 @@ -/* -Copyright 2020 The Knative Authors - -Licensed under the Apache License, Version 2.0 (the "License"); -you may not use this file except in compliance with the License. -You may obtain a copy of the License at - - http://www.apache.org/licenses/LICENSE-2.0 - -Unless required by applicable law or agreed to in writing, software -distributed under the License is distributed on an "AS IS" BASIS, -WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -See the License for the specific language governing permissions and -limitations under the License. -*/ - -// Package resources is a placeholder that allows us to pull in config files -// via go mod vendor. -package resources diff --git a/config/domain-mapping/placeholder.go b/config/domain-mapping/placeholder.go deleted file mode 100644 index 2c54bdd5bb..0000000000 --- a/config/domain-mapping/placeholder.go +++ /dev/null @@ -1,19 +0,0 @@ -/* -Copyright 2020 The Knative Authors - -Licensed under the Apache License, Version 2.0 (the "License"); -you may not use this file except in compliance with the License. -You may obtain a copy of the License at - - http://www.apache.org/licenses/LICENSE-2.0 - -Unless required by applicable law or agreed to in writing, software -distributed under the License is distributed on an "AS IS" BASIS, -WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -See the License for the specific language governing permissions and -limitations under the License. -*/ - -// Package domainmapping is a placeholder that allows us to pull in config files -// via go mod vendor. -package domainmapping diff --git a/config/domain-mapping/webhooks/placeholder.go b/config/domain-mapping/webhooks/placeholder.go deleted file mode 100644 index 4092b1bc7e..0000000000 --- a/config/domain-mapping/webhooks/placeholder.go +++ /dev/null @@ -1,19 +0,0 @@ -/* -Copyright 2020 The Knative Authors - -Licensed under the Apache License, Version 2.0 (the "License"); -you may not use this file except in compliance with the License. -You may obtain a copy of the License at - - http://www.apache.org/licenses/LICENSE-2.0 - -Unless required by applicable law or agreed to in writing, software -distributed under the License is distributed on an "AS IS" BASIS, -WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -See the License for the specific language governing permissions and -limitations under the License. -*/ - -// Package webhooks is a placeholder that allows us to pull in config files -// via go mod vendor. -package webhooks diff --git a/hack/generate-yamls.sh b/hack/generate-yamls.sh index 676acdcd86..7079d55dee 100755 --- a/hack/generate-yamls.sh +++ b/hack/generate-yamls.sh @@ -53,8 +53,6 @@ readonly SERVING_CORE_YAML=${YAML_OUTPUT_DIR}/serving-core.yaml readonly SERVING_DEFAULT_DOMAIN_YAML=${YAML_OUTPUT_DIR}/serving-default-domain.yaml readonly SERVING_STORAGE_VERSION_MIGRATE_YAML=${YAML_OUTPUT_DIR}/serving-storage-version-migration.yaml readonly SERVING_HPA_YAML=${YAML_OUTPUT_DIR}/serving-hpa.yaml -readonly SERVING_DOMAINMAPPING_YAML=${YAML_OUTPUT_DIR}/serving-domainmapping.yaml -readonly SERVING_DOMAINMAPPING_CRD_YAML=${YAML_OUTPUT_DIR}/serving-domainmapping-crds.yaml readonly SERVING_CRD_YAML=${YAML_OUTPUT_DIR}/serving-crds.yaml readonly SERVING_NSCERT_YAML=${YAML_OUTPUT_DIR}/serving-nscert.yaml readonly SERVING_POST_INSTALL_JOBS_YAML=${YAML_OUTPUT_DIR}/serving-post-install-jobs.yaml @@ -100,10 +98,6 @@ ko resolve ${KO_YAML_FLAGS} -f config/core/300-resources/ -f config/core/300-ima # Create hpa-class autoscaling related yaml ko resolve ${KO_YAML_FLAGS} -f config/hpa-autoscaling/ | "${LABEL_YAML_CMD[@]}" > "${SERVING_HPA_YAML}" -# Create domain mapping related yaml -ko resolve ${KO_YAML_FLAGS} -R -f config/domain-mapping/ | "${LABEL_YAML_CMD[@]}" > "${SERVING_DOMAINMAPPING_YAML}" -ko resolve ${KO_YAML_FLAGS} -f config/domain-mapping/300-resources/ | "${LABEL_YAML_CMD[@]}" > "${SERVING_DOMAINMAPPING_CRD_YAML}" - # Create nscert related yaml ko resolve ${KO_YAML_FLAGS} -f config/namespace-wildcard-certs | "${LABEL_YAML_CMD[@]}" > "${SERVING_NSCERT_YAML}" @@ -130,8 +124,6 @@ ${SERVING_DEFAULT_DOMAIN_YAML} ${SERVING_STORAGE_VERSION_MIGRATE_YAML} ${SERVING_POST_INSTALL_JOBS_YAML} ${SERVING_HPA_YAML} -${SERVING_DOMAINMAPPING_YAML} -${SERVING_DOMAINMAPPING_CRD_YAML} ${SERVING_CRD_YAML} ${SERVING_NSCERT_YAML} EOF @@ -142,8 +134,6 @@ export SERVING_DEFAULT_DOMAIN_YAML=${SERVING_DEFAULT_DOMAIN_YAML} export SERVING_STORAGE_VERSION_MIGRATE_YAML=${SERVING_STORAGE_VERSION_MIGRATE_YAML} export SERVING_POST_INSTALL_JOBS_YAML=${SERVING_POST_INSTALL_JOBS_YAML} export SERVING_HPA_YAML=${SERVING_HPA_YAML} -export SERVING_DOMAINMAPPING_YAML=${SERVING_DOMAINMAPPING_YAML} -export SERVING_DOMAINMAPPING_CRD_YAML=${SERVING_DOMAINMAPPING_CRD_YAML} export SERVING_CRD_YAML=${SERVING_CRD_YAML} export SERVING_NSCERT_YAML=${SERVING_NSCERT_YAML} EOF diff --git a/test/conformance/api/v1alpha1/domain_mapping_test.go b/test/conformance/api/v1alpha1/domain_mapping_test.go index 8bc3dd0179..e8d9507e96 100644 --- a/test/conformance/api/v1alpha1/domain_mapping_test.go +++ b/test/conformance/api/v1alpha1/domain_mapping_test.go @@ -35,8 +35,8 @@ import ( ) func TestDomainMapping(t *testing.T) { - if !test.ServingFlags.EnableAlphaFeatures { - t.Skip("Alpha features not enabled") + if !test.ServingFlags.EnableBetaFeatures { + t.Skip("Beta features not enabled") } t.Parallel() diff --git a/test/e2e-common.sh b/test/e2e-common.sh index f2d692ba92..e16418d397 100644 --- a/test/e2e-common.sh +++ b/test/e2e-common.sh @@ -446,7 +446,6 @@ function stage_serving_head() { mkdir -p "${head_post_install_dir}" cp "${SERVING_CORE_YAML}" "${head_dir}" - cp "${SERVING_DOMAINMAPPING_YAML}" "${head_dir}" cp "${SERVING_HPA_YAML}" "${head_dir}" cp "${SERVING_POST_INSTALL_JOBS_YAML}" "${head_post_install_dir}" } @@ -461,7 +460,6 @@ function stage_serving_custom() { mkdir -p "${head_post_install_dir}" cp "${SERVING_CORE_YAML}" "${head_dir}" - cp "${SERVING_DOMAINMAPPING_YAML}" "${head_dir}" cp "${SERVING_HPA_YAML}" "${head_dir}" cp "${SERVING_POST_INSTALL_JOBS_YAML}" "${head_post_install_dir}" } @@ -482,9 +480,6 @@ function stage_serving_latest() { wget "${url}/serving-core.yaml" -P "${latest_dir}" \ || fail_test "Unable to download latest knative/serving core file." - wget "${url}/serving-domainmapping.yaml" -P "${latest_dir}" \ - || fail_test "Unable to download latest knative/serving domain mapping file." - wget "${url}/serving-hpa.yaml" -P "${latest_dir}" \ || fail_test "Unable to download latest knative/serving hpa file." diff --git a/test/e2e/autotls/domain_mapping_test.go b/test/e2e/autotls/domain_mapping_test.go index 3883e670b7..aba1b60e29 100644 --- a/test/e2e/autotls/domain_mapping_test.go +++ b/test/e2e/autotls/domain_mapping_test.go @@ -45,8 +45,8 @@ type dmConfig struct { } func TestDomainMappingAutoTLS(t *testing.T) { - if !test.ServingFlags.EnableAlphaFeatures { - t.Skip("Alpha features not enabled") + if !test.ServingFlags.EnableBetaFeatures { + t.Skip("Beta features not enabled") } t.Parallel() diff --git a/test/e2e/domainmapping/domain_mapping_test.go b/test/e2e/domainmapping/domain_mapping_test.go index f8f9b52501..9e6d9ef10b 100644 --- a/test/e2e/domainmapping/domain_mapping_test.go +++ b/test/e2e/domainmapping/domain_mapping_test.go @@ -48,8 +48,8 @@ import ( ) func TestBYOCertificate(t *testing.T) { - if !test.ServingFlags.EnableAlphaFeatures { - t.Skip("Alpha features not enabled") + if !test.ServingFlags.EnableBetaFeatures { + t.Skip("Beta features not enabled") } t.Parallel() diff --git a/test/ha/domainmapping_test.go b/test/ha/domainmapping_test.go index 5187ed5dc6..f150d7b21a 100644 --- a/test/ha/domainmapping_test.go +++ b/test/ha/domainmapping_test.go @@ -43,8 +43,8 @@ const ( ) func TestDomainMappingHA(t *testing.T) { - if !test.ServingFlags.EnableAlphaFeatures { - t.Skip("Alpha features not enabled") + if !test.ServingFlags.EnableBetaFeatures { + t.Skip("Beta features not enabled") } ctx, clients := context.Background(), test.Setup(t)