-
Notifications
You must be signed in to change notification settings - Fork 630
Knative ConfigMap Propagation #2333
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Changes from all commits
d38ca4c
e95fb2f
610ac33
183fbf6
4f9bf6e
86be672
9414727
8f856dd
3164381
b8b48b0
39ecc30
96a3773
05fe27a
4a2f88e
7c47668
1d1c172
8e80aba
4a4f250
de81277
b370aa9
005d943
92a3f48
f0af2c4
ce73965
25c7167
18a2832
12c2f40
fc09fc6
efdda0f
bf279c1
586f6f0
8ebc2c5
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,38 @@ | ||
| /* | ||
| * Copyright 2019 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 broker | ||
|
|
||
| import ( | ||
| "context" | ||
|
|
||
| apierrors "k8s.io/apimachinery/pkg/api/errors" | ||
| metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" | ||
|
|
||
| kubeclient "knative.dev/pkg/client/injection/kube/client" | ||
| "knative.dev/pkg/logging" | ||
| ) | ||
|
|
||
| // GetLoggingConfig will get config from a specific namespace | ||
| func GetLoggingConfig(ctx context.Context, namespace, loggingConfigMapName string) (*logging.Config, error) { | ||
| loggingConfigMap, err := kubeclient.Get(ctx).CoreV1().ConfigMaps(namespace).Get(loggingConfigMapName, metav1.GetOptions{}) | ||
| if apierrors.IsNotFound(err) { | ||
| return logging.NewConfigFromMap(nil) | ||
| } else if err != nil { | ||
| return nil, err | ||
| } | ||
| return logging.NewConfigFromConfigMap(loggingConfigMap) | ||
| } | ||
| Original file line number | Diff line number | Diff line change | ||||||
|---|---|---|---|---|---|---|---|---|
| @@ -0,0 +1 @@ | ||||||||
| core/resources/configmappropagation.yaml | ||||||||
|
Member
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Add trailing newline:
Suggested change
Contributor
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Does symbolic link also need trailing newline?
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. No, don't edit this file. @mattmoor your bot should probably ignore symlinks |
||||||||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,61 @@ | ||
| # 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. | ||
|
|
||
| apiVersion: apiextensions.k8s.io/v1beta1 | ||
| kind: CustomResourceDefinition | ||
| metadata: | ||
| name: configmappropagations.configs.internal.knative.dev | ||
| labels: | ||
| eventing.knative.dev/release: devel | ||
| knative.dev/crd-install: "true" | ||
| spec: | ||
| group: configs.internal.knative.dev | ||
| versions: | ||
| - name: v1alpha1 | ||
| served: true | ||
| storage: true | ||
| names: | ||
| kind: ConfigMapPropagation | ||
| plural: configmappropagations | ||
| singular: configmappropagation | ||
| categories: | ||
| - all | ||
| - knative | ||
| - eventing | ||
| shortNames: | ||
| - kcmp | ||
| - cmp | ||
| scope: Namespaced | ||
| subresources: | ||
| status: {} | ||
| additionalPrinterColumns: | ||
| - name: Ready | ||
| type: string | ||
| JSONPath: ".status.conditions[?(@.type==\"Ready\")].status" | ||
| - name: Reason | ||
| type: string | ||
| JSONPath: ".status.conditions[?(@.type==\"Ready\")].reason" | ||
| - name: OriginalNamespace | ||
| type: string | ||
| JSONPath: ".spec.originalNamespace" | ||
| validation: | ||
| openAPIV3Schema: | ||
| properties: | ||
| spec: | ||
| required: | ||
| - originalNamespace | ||
| properties: | ||
| originalNamespace: | ||
| type: string | ||
| description: "The namespace where original ConfigMaps exist in." |
Uh oh!
There was an error while loading. Please reload this page.