<commit_before>/*
Copyright 2018 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 v1alpha1

import (
	metav1 "k8s.io/apimachinery/pkg/apis/meta/v1"
	"k8s.io/apimachinery/pkg/runtime"
	"k8s.io/apimachinery/pkg/runtime/schema"

	"github.com/knative/pkg/apis"
	duckv1alpha1 "github.com/knative/pkg/apis/duck/v1alpha1"
	"github.com/knative/pkg/webhook"
)

// +genclient
// +genclient:nonNamespaced
// +k8s:deepcopy-gen:interfaces=k8s.io/apimachinery/pkg/runtime.Object

// ClusterChannelProvisioner encapsulates a provisioning strategy for the
// backing resources required to realize a particular resource type.
type ClusterChannelProvisioner struct {
	metav1.TypeMeta `json:",inline"`
	// +optional
	metav1.ObjectMeta `json:"metadata,omitempty"`

	// Spec defines the Types provisioned by this Provisioner.
	Spec ClusterChannelProvisionerSpec `json:"spec"`

	// Status is the current status of the Provisioner.
	// +optional
	Status ClusterChannelProvisionerStatus `json:"status,omitempty"`
}

// Check that ClusterChannelProvisioner can be validated and can be defaulted.
var _ apis.Validatable = (*ClusterChannelProvisioner)(nil)
var _ apis.Defaultable = (*ClusterChannelProvisioner)(nil)
var _ runtime.Object = (*ClusterChannelProvisioner)(nil)
var _ webhook.GenericCRD = (*ClusterChannelProvisioner)(nil)

// ClusterChannelProvisionerSpec is the spec for a ClusterChannelProvisioner resource.
type ClusterChannelProvisionerSpec struct {
	// TODO By enabling the status subresource metadata.generation should increment
	// thus making this property obsolete.
	//
	// We should be able to drop this property with a CRD conversion webhook
	// in the future
	//
	// +optional
	DeprecatedGeneration int64 `json:"generation,omitempty"`
}

var ccProvCondSet = duckv1alpha1.NewLivingConditionSet()<commit_msg>Check that ClusterChannelProvisioner is OwnerRefable (#1183)<commit_after>/*
Copyright 2018 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 v1alpha1

import (
	metav1 "k8s.io/apimachinery/pkg/apis/meta/v1"
	"k8s.io/apimachinery/pkg/runtime"
	"k8s.io/apimachinery/pkg/runtime/schema"

	"github.com/knative/pkg/apis"
	duckv1alpha1 "github.com/knative/pkg/apis/duck/v1alpha1"
	"github.com/knative/pkg/kmeta"
	"github.com/knative/pkg/webhook"
)

// +genclient
// +genclient:nonNamespaced
// +k8s:deepcopy-gen:interfaces=k8s.io/apimachinery/pkg/runtime.Object

// ClusterChannelProvisioner encapsulates a provisioning strategy for the
// backing resources required to realize a particular resource type.
type ClusterChannelProvisioner struct {
	metav1.TypeMeta `json:",inline"`
	// +optional
	metav1.ObjectMeta `json:"metadata,omitempty"`

	// Spec defines the Types provisioned by this Provisioner.
	Spec ClusterChannelProvisionerSpec `json:"spec"`

	// Status is the current status of the Provisioner.
	// +optional
	Status ClusterChannelProvisionerStatus `json:"status,omitempty"`
}

// Check that ClusterChannelProvisioner can be validated and can be defaulted.
var _ apis.Validatable = (*ClusterChannelProvisioner)(nil)
var _ apis.Defaultable = (*ClusterChannelProvisioner)(nil)
var _ runtime.Object = (*ClusterChannelProvisioner)(nil)
var _ webhook.GenericCRD = (*ClusterChannelProvisioner)(nil)
var _ kmeta.OwnerRefable = (*ClusterChannelProvisioner)(nil)

// ClusterChannelProvisionerSpec is the spec for a ClusterChannelProvisioner resource.
type ClusterChannelProvisionerSpec struct {
	// TODO By enabling the status subresource metadata.generation should increment
	// thus making this property obsolete.
	//
	// We should be able to drop this property with a CRD conversion webhook
	// in the future
	//
	// +optional
	DeprecatedGeneration int64 `json:"generation,omitempty"`
}

var ccProvCondSet = duckv1alpha1.NewLivingConditionSet()
{'fraction_non_alphanumeric': 0.0873582528349433, 'fraction_numerical': 0.012179756404871903, 'mean_word_length': 5.029113924050633, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 3, 'https://': 0, 'lorem ipsum': 0, 'www.': 2, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '5324670', 'n_tokens_mistral': 1452, 'n_tokens_neox': 1385, 'n_words': 438}