This repository has been archived by the owner on Jun 19, 2022. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 74
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
[master] Auto-update dependencies (#722)
Produced via: `./hack/update-deps.sh --upgrade && ./hack/update-codegen.sh` /assign grantr nachocano /cc grantr nachocano
- Loading branch information
Showing
38 changed files
with
1,086 additions
and
23 deletions.
There are no files selected for viewing
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
1 change: 0 additions & 1 deletion
1
vendor/knative.dev/eventing/config/200-channel-broker-binding.yaml
This file was deleted.
Oops, something went wrong.
1 change: 0 additions & 1 deletion
1
vendor/knative.dev/eventing/config/200-channel-broker-clusterrole.yaml
This file was deleted.
Oops, something went wrong.
1 change: 0 additions & 1 deletion
1
vendor/knative.dev/eventing/config/300-configmappropagation.yaml
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
core/resources/containersource.yaml |
1 change: 0 additions & 1 deletion
1
vendor/knative.dev/eventing/config/400-config-br-default-channel.yaml
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1 +1 @@ | ||
core/configmaps/default-broker.yaml | ||
brokers/channel-broker/configmaps/default-broker.yaml |
This file was deleted.
Oops, something went wrong.
1 change: 1 addition & 0 deletions
1
...or/knative.dev/eventing/config/brokers/channel-broker/200-channel-broker-clusterrole.yaml
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
roles/controller-clusterroles.yaml |
1 change: 1 addition & 0 deletions
1
vendor/knative.dev/eventing/config/brokers/channel-broker/300-configmappropagation.yaml
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
resources/configmappropagation.yaml |
1 change: 1 addition & 0 deletions
1
vendor/knative.dev/eventing/config/brokers/channel-broker/400-config-br-default-channel.yaml
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
configmaps/default-imc.yaml |
1 change: 1 addition & 0 deletions
1
vendor/knative.dev/eventing/config/brokers/channel-broker/400-config-br-defaults.yaml
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
configmaps/default-broker.yaml |
1 change: 1 addition & 0 deletions
1
vendor/knative.dev/eventing/config/brokers/channel-broker/500-broker-controller.yaml
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
deployments/controller.yaml |
1 change: 1 addition & 0 deletions
1
.../knative.dev/eventing/config/brokers/mt-channel-broker/400-config-br-default-channel.yaml
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
configmaps/default-imc.yaml |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
42 changes: 42 additions & 0 deletions
42
vendor/knative.dev/eventing/pkg/apis/sources/v1alpha2/container_defaults.go
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,42 @@ | ||
/* | ||
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 v1alpha2 | ||
|
||
import ( | ||
"context" | ||
"fmt" | ||
|
||
corev1 "k8s.io/api/core/v1" | ||
"knative.dev/pkg/apis" | ||
) | ||
|
||
func (s *ContainerSource) SetDefaults(ctx context.Context) { | ||
withName := apis.WithinParent(ctx, s.ObjectMeta) | ||
s.Spec.SetDefaults(withName) | ||
} | ||
|
||
func (ss *ContainerSourceSpec) SetDefaults(ctx context.Context) { | ||
containers := make([]corev1.Container, 0, len(ss.Template.Spec.Containers)) | ||
for i, c := range ss.Template.Spec.Containers { | ||
// If the Container specified has no name, then default to "<source_name>_<i>". | ||
if c.Name == "" { | ||
c.Name = fmt.Sprintf("%s-%d", apis.ParentMeta(ctx).Name, i) | ||
} | ||
containers = append(containers, c) | ||
} | ||
ss.Template.Spec.Containers = containers | ||
} |
92 changes: 92 additions & 0 deletions
92
vendor/knative.dev/eventing/pkg/apis/sources/v1alpha2/container_lifecycle.go
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,92 @@ | ||
/* | ||
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 v1alpha2 | ||
|
||
import ( | ||
appsv1 "k8s.io/api/apps/v1" | ||
corev1 "k8s.io/api/core/v1" | ||
"knative.dev/eventing/pkg/apis/duck" | ||
"knative.dev/pkg/apis" | ||
) | ||
|
||
const ( | ||
// ContainerSourceConditionReady has status True when the ContainerSource is ready to send events. | ||
ContainerSourceConditionReady = apis.ConditionReady | ||
|
||
// ContainerSourceConditionSinkBindingReady has status True when the ContainerSource's SinkBinding is ready. | ||
ContainerSourceConditionSinkBindingReady apis.ConditionType = "SinkBindingReady" | ||
|
||
// ContainerSourceConditionReceiveAdapterReady has status True when the ContainerSource's ReceiveAdapter is ready. | ||
ContainerSourceConditionReceiveAdapterReady apis.ConditionType = "ReceiveAdapterReady" | ||
) | ||
|
||
var containerCondSet = apis.NewLivingConditionSet( | ||
ContainerSourceConditionSinkBindingReady, | ||
ContainerSourceConditionReceiveAdapterReady, | ||
) | ||
|
||
// GetCondition returns the condition currently associated with the given type, or nil. | ||
func (s *ContainerSourceStatus) GetCondition(t apis.ConditionType) *apis.Condition { | ||
return containerCondSet.Manage(s).GetCondition(t) | ||
} | ||
|
||
// IsReady returns true if the resource is ready overall. | ||
func (s *ContainerSourceStatus) IsReady() bool { | ||
return containerCondSet.Manage(s).IsHappy() | ||
} | ||
|
||
// InitializeConditions sets relevant unset conditions to Unknown state. | ||
func (s *ContainerSourceStatus) InitializeConditions() { | ||
containerCondSet.Manage(s).InitializeConditions() | ||
} | ||
|
||
// PropagateSinkBindingStatus uses the availability of the provided Deployment to determine if | ||
// ContainerSourceConditionSinkBindingReady should be marked as true, false or unknown. | ||
func (s *ContainerSourceStatus) PropagateSinkBindingStatus(status *SinkBindingStatus) { | ||
// Do not copy conditions nor observedGeneration | ||
conditions := s.Conditions | ||
observedGeneration := s.ObservedGeneration | ||
s.SourceStatus = status.SourceStatus | ||
s.Conditions = conditions | ||
s.ObservedGeneration = observedGeneration | ||
|
||
cond := status.GetCondition(apis.ConditionReady) | ||
switch { | ||
case cond == nil: | ||
containerCondSet.Manage(s).MarkUnknown(ContainerSourceConditionSinkBindingReady, "", "") | ||
case cond.Status == corev1.ConditionTrue: | ||
containerCondSet.Manage(s).MarkTrue(ContainerSourceConditionSinkBindingReady) | ||
case cond.Status == corev1.ConditionFalse: | ||
containerCondSet.Manage(s).MarkFalse(ContainerSourceConditionSinkBindingReady, cond.Reason, cond.Message) | ||
case cond.Status == corev1.ConditionUnknown: | ||
containerCondSet.Manage(s).MarkUnknown(ContainerSourceConditionSinkBindingReady, cond.Reason, cond.Message) | ||
default: | ||
containerCondSet.Manage(s).MarkUnknown(ContainerSourceConditionSinkBindingReady, cond.Reason, cond.Message) | ||
} | ||
} | ||
|
||
// PropagateReceiveAdapterStatus uses the availability of the provided Deployment to determine if | ||
// ContainerSourceConditionReceiveAdapterReady should be marked as true or false. | ||
func (s *ContainerSourceStatus) PropagateReceiveAdapterStatus(d *appsv1.Deployment) { | ||
if duck.DeploymentIsAvailable(&d.Status, false) { | ||
containerCondSet.Manage(s).MarkTrue(ContainerSourceConditionReceiveAdapterReady) | ||
} else { | ||
// I don't know how to propagate the status well, so just give the name of the Deployment | ||
// for now. | ||
containerCondSet.Manage(s).MarkFalse(ContainerSourceConditionReceiveAdapterReady, "DeploymentUnavailable", "The Deployment '%s' is unavailable.", d.Name) | ||
} | ||
} |
92 changes: 92 additions & 0 deletions
92
vendor/knative.dev/eventing/pkg/apis/sources/v1alpha2/container_types.go
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,92 @@ | ||
/* | ||
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 v1alpha2 | ||
|
||
import ( | ||
corev1 "k8s.io/api/core/v1" | ||
metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" | ||
"k8s.io/apimachinery/pkg/runtime" | ||
"k8s.io/apimachinery/pkg/runtime/schema" | ||
"knative.dev/pkg/apis" | ||
duckv1 "knative.dev/pkg/apis/duck/v1" | ||
"knative.dev/pkg/kmeta" | ||
) | ||
|
||
// +genclient | ||
// +genreconciler | ||
// +k8s:deepcopy-gen:interfaces=k8s.io/apimachinery/pkg/runtime.Object | ||
|
||
// ContainerSource is the Schema for the containersources API | ||
type ContainerSource struct { | ||
metav1.TypeMeta `json:",inline"` | ||
metav1.ObjectMeta `json:"metadata,omitempty"` | ||
|
||
Spec ContainerSourceSpec `json:"spec,omitempty"` | ||
Status ContainerSourceStatus `json:"status,omitempty"` | ||
} | ||
|
||
var ( | ||
_ runtime.Object = (*ContainerSource)(nil) | ||
_ kmeta.OwnerRefable = (*ContainerSource)(nil) | ||
_ apis.Validatable = (*ContainerSource)(nil) | ||
_ apis.Defaultable = (*ContainerSource)(nil) | ||
_ apis.HasSpec = (*ContainerSource)(nil) | ||
) | ||
|
||
// ContainerSourceSpec defines the desired state of ContainerSource | ||
type ContainerSourceSpec struct { | ||
// inherits duck/v1 SourceSpec, which currently provides: | ||
// * Sink - a reference to an object that will resolve to a domain name or | ||
// a URI directly to use as the sink. | ||
// * CloudEventOverrides - defines overrides to control the output format | ||
// and modifications of the event sent to the sink. | ||
duckv1.SourceSpec `json:",inline"` | ||
|
||
// Template describes the pods that will be created | ||
Template corev1.PodTemplateSpec `json:"template"` | ||
} | ||
|
||
// GetGroupVersionKind returns the GroupVersionKind. | ||
func (s *ContainerSource) GetGroupVersionKind() schema.GroupVersionKind { | ||
return SchemeGroupVersion.WithKind("ContainerSource") | ||
} | ||
|
||
// ContainerSourceStatus defines the observed state of ContainerSource | ||
type ContainerSourceStatus struct { | ||
// inherits duck/v1 SourceStatus, which currently provides: | ||
// * ObservedGeneration - the 'Generation' of the Service that was last | ||
// processed by the controller. | ||
// * Conditions - the latest available observations of a resource's current | ||
// state. | ||
// * SinkURI - the current active sink URI that has been configured for the | ||
// Source. | ||
duckv1.SourceStatus `json:",inline"` | ||
} | ||
|
||
// +k8s:deepcopy-gen:interfaces=k8s.io/apimachinery/pkg/runtime.Object | ||
|
||
// ContainerSourceList contains a list of ContainerSource | ||
type ContainerSourceList struct { | ||
metav1.TypeMeta `json:",inline"` | ||
metav1.ListMeta `json:"metadata,omitempty"` | ||
Items []ContainerSource `json:"items"` | ||
} | ||
|
||
// GetUntypedSpec returns the spec of the ContainerSource. | ||
func (c *ContainerSource) GetUntypedSpec() interface{} { | ||
return c.Spec | ||
} |
59 changes: 59 additions & 0 deletions
59
vendor/knative.dev/eventing/pkg/apis/sources/v1alpha2/container_validation.go
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,59 @@ | ||
/* | ||
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 v1alpha2 | ||
|
||
import ( | ||
"context" | ||
|
||
corev1 "k8s.io/api/core/v1" | ||
"knative.dev/pkg/apis" | ||
) | ||
|
||
func (c *ContainerSource) Validate(ctx context.Context) *apis.FieldError { | ||
return c.Spec.Validate(ctx).ViaField("spec") | ||
} | ||
|
||
func (cs *ContainerSourceSpec) Validate(ctx context.Context) *apis.FieldError { | ||
var errs *apis.FieldError | ||
if fe := cs.Sink.Validate(ctx); fe != nil { | ||
errs = errs.Also(fe.ViaField("sink")) | ||
} | ||
|
||
// Validate there is at least a container | ||
if cs.Template.Spec.Containers == nil || len(cs.Template.Spec.Containers) == 0 { | ||
fe := apis.ErrMissingField("containers") | ||
errs = errs.Also(fe) | ||
} else { | ||
for i, c := range cs.Template.Spec.Containers { | ||
if ce := isValidContainer(&c); ce != nil { | ||
errs = errs.Also(ce.ViaFieldIndex("containers", i)) | ||
} | ||
} | ||
} | ||
return errs | ||
} | ||
|
||
func isValidContainer(c *corev1.Container) *apis.FieldError { | ||
var errs *apis.FieldError | ||
if c.Name == "" { | ||
errs = errs.Also(apis.ErrMissingField("name")) | ||
} | ||
if c.Image == "" { | ||
errs = errs.Also(apis.ErrMissingField("image")) | ||
} | ||
return errs | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.