-
Notifications
You must be signed in to change notification settings - Fork 1.8k
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
Make sure resource names do not exceed limit of 63 characters #491
Conversation
cc @dwnusbaum |
/test pull-knative-build-pipeline-integration-tests |
452ac56
to
933b5cf
Compare
haha np :) |
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.
This looks great to me, but I think someone other than me should review it since I was part of creating it 😇
@@ -116,7 +117,7 @@ func (b *ArtifactBucket) GetSecretsVolumes() []corev1.Volume { | |||
volumes := []corev1.Volume{} | |||
for _, sec := range b.Secrets { | |||
volumes = append(volumes, corev1.Volume{ | |||
Name: fmt.Sprintf("bucket-secret-volume-%s", sec.SecretName), | |||
Name: names.SimpleNameGenerator.GenerateName(fmt.Sprintf("bucket-secret-%s", sec.SecretName)), |
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 had one thought, maybe overkill tho: we could make a GenerateNamef
, something like:
names.SimpleNameGenerator.GenerateNamef("bucket-secret-%s", sec.SecretName)
Since we're so often passing the output of fmt.Sprintf
in here anyway 🤷♀️
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.
nice idea
wantServiceAccountName string | ||
wantPodVolume []corev1.Volume | ||
wantPreSteps []corev1.Container | ||
wantSteps []corev1.Container |
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.
oh man you got through it! thanks so much for fixing this up @pivotal-nader-ziada ❤️ ❤️ ❤️ i think this is definitely better going forward
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.
Yeah, this is great! I have given you quite a few merge conflicts though because of #488, sorry! I would lean towards using a single wantPod
field instead of using all of the individual fields so that we can match on anything in ObjectMeta
or any additional fields as needed in the future as well.
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.
haha, that one file took more time than the rest of the PR :D
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 would lean towards using a single
wantPod
field instead of using all of the individual fields so that we can match on anything inObjectMeta
or any additional fields as needed in the future as well.
The only "trouble" here @dwnusbaum is that there ends up being a lot of repetition between the pods so the cases become pretty verbose :S (maybe it's worth it tho?)
Side note: might start looking a bit better if we add pod builders in test/builder
but that's probably a PR in itself :D
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.
might start looking a bit better if we add pod builders in
test/builder
Yeah that was what I was thinking, but like you said probably best left for another PR since the current code gets the job done.
|
||
_See [randstring.go](./randstring.go)._ | ||
namespace := names.SimpleNameGenerator.GenerateName("arendelle") | ||
``` |
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.
nice catch, thanks for updating the docs!
}, | ||
}}, | ||
}, | ||
} { |
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 think if we wanted to we could make some of these a bit less verbose but this is fine for now if we want to iterate on it :D
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.
yes, agreed, just wanted to get everything working first, then we can improve on it
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.
This looks great @pivotal-nader-ziada @bobcatfish 👍
9adde1f
to
244e1cb
Compare
e2aab67
to
8dae438
Compare
/assign @shashwathi |
8dae438
to
7bce4e1
Compare
/test pull-knative-build-pipeline-integration-tests |
1 similar comment
/test pull-knative-build-pipeline-integration-tests |
f8faa05
to
219a340
Compare
- generated names for taskruns and build steps get a random suffix of five alphanumerics. The string is guaranteed to not exceed the length of a standard Kubernetes name (63 characters) - updated tests using fixed seed for the name generation - remove rand string func from test folder - use new rand string already used for generated names
Pipelinerun resolution now checking if taskrun already created so it doesn't generate a new random suffix to it updated e2e tests to work with variable taskrun names Signed-off-by: Nader Ziada <nziada@pivotal.io>
219a340
to
ae1ee4c
Compare
The following is the coverage report on pkg/.
|
/lgtm |
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.
Great PR. 👍
[APPROVALNOTIFIER] This PR is APPROVED This pull-request has been approved by: pivotal-nader-ziada, shashwathi The full list of commands accepted by this bot can be found here. The pull request process is described here
Needs approval from an approver in each of these files:
Approvers can indicate their approval by writing |
nice ooooone @pivotal-nader-ziada !! 🎉 |
PR tektoncd#491 did the trick for generated resource containers, but not for `TaskSpec`-defined step container names. This fixes that.
PR #491 did the trick for generated resource containers, but not for `TaskSpec`-defined step container names. This fixes that.
Releasing release.yaml v0.15.2
Fixes: #481
Proposed changes
taskruns
andbuild steps
get a random suffixof five alphanumerics. The string is guaranteed to not exceed the
length of a standard Kubernetes name (63 characters)
rand string
func from test folder and useGenerateName()
validateObjectMetadata()
This PR was co-authored by @bobcatfish, but will not put her name in the commit to avoid CLA hassle, (sorry Christie 🤷♂️)