-
Notifications
You must be signed in to change notification settings - Fork 113
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
625 user control over pod labels #1069
625 user control over pod labels #1069
Conversation
[APPROVALNOTIFIER] This PR is NOT APPROVED This pull-request has been approved by: The full list of commands accepted by this bot can be found here.
Needs approval from an approver in each of these files:
Approvers can indicate their approval by writing |
/kind feature |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks. We should wait for the discussions in the ship to be completed. Beside that, implementation looks mostly good. Also the right set of documentation is included. I think you should add an integration test as well.
- The Kubernetes [Network Traffic Shaping](https://kubernetes.io/docs/concepts/extend-kubernetes/compute-storage-net/network-plugins/#support-traffic-shaping) feature looks for the `kubernetes.io/ingress-bandwidth` and `kubernetes.io/egress-bandwidth` annotations to limit the network bandwidth the `Pod` is allowed to use. | ||
- The [AppArmor profile of a container](https://kubernetes.io/docs/tutorials/clusters/apparmor/) is defined using the `container.apparmor.security.beta.kubernetes.io/<container_name>` annotation. | ||
|
||
Since you can define labels for all of BuildStrategy/ClusterBuildStrategy, Build and BuildRun resources, if you define the same label key for different resources in the same build "pipeline", only the value in the last definition stage will be used (e.g. if you define `someproj.io/label: value01` in a Build and `someproj.io/label: value02` in a BuildRun that references such Build, `value02` will be used). |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Please mention here that annotations cannot be overriden.
func (b Build) GetLabels() map[string]string { | ||
return b.Labels | ||
} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I don't think this is needed because Kubernetes already provides that function on ObjectMeta
.
// GetLabels returns the labels of the BuildRun | ||
func (br *BuildRun) GetLabels() map[string]string { | ||
return br.Labels | ||
} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I don't think this is needed because Kubernetes already provides that function on ObjectMeta
.
// GetLabels returns the labels the build strategy | ||
func (s BuildStrategy) GetLabels() map[string]string { | ||
return s.Labels | ||
} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I don't think this is needed because Kubernetes already provides that function on ObjectMeta
.
// GetLabels returns the labels of the build strategy | ||
func (s ClusterBuildStrategy) GetLabels() map[string]string { | ||
return s.Labels | ||
} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I don't think this is needed because Kubernetes already provides that function on ObjectMeta
.
@@ -322,6 +322,32 @@ func GenerateTaskRun( | |||
expectedTaskRun.Labels[label] = value | |||
} | |||
|
|||
reserved, err := regexp.Compile(reservedLabels) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The regular expression should be compiled only once.
Changes
Fixes #625
Submitter Checklist
Release Notes