Skip to content
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

Fix object labels #89

Closed
jt-nti opened this issue Feb 10, 2023 · 1 comment · Fixed by #124
Closed

Fix object labels #89

jt-nti opened this issue Feb 10, 2023 · 1 comment · Fixed by #124
Labels
bug Something isn't working design Design discussions
Milestone

Comments

@jt-nti
Copy link
Member

jt-nti commented Feb 10, 2023

MSP and peer ID annotations look like they might cause problems. Also potentially related to #88, can the object labels be improved to make management easier?

Valid label values:

  • must be 63 characters or less (can be empty),
  • unless empty, must begin and end with an alphanumeric character ([a-z0-9A-Z]),
  • could contain dashes (-), underscores (_), dots (.), and alphanumerics between.

Possible label changes:

Key Description Current Suggested
app.kubernetes.io/name The name of the application fabric ?
app.kubernetes.io/instance A unique name identifying the instance of an application ?
app.kubernetes.io/version The current version of the application (e.g., a SemVer 1.0, revision hash, etc.) The ccid hash?
app.kubernetes.io/component The component within the architecture chaincode
app.kubernetes.io/part-of The name of a higher level application this one is part of fabric?
app.kubernetes.io/created-by The controller/user who created this resource (deprecated) fabric-builder-k8s
app.kubernetes.io/managed-by The tool being used to manage the operation of an application fabric-builder-k8s fabric-builder-k8s
fabric-builder-k8s-mspid Fabric peer MSP ID (may not be a valid label) e.g. http://peer0.org1.example.com/ Use an annotation instead?
fabric-builder-k8s-peerid Fabric peer ID (may not be a valid label) e.g. Org1MSP Use an annotation instead?
@jt-nti jt-nti added bug Something isn't working design Design discussions labels Feb 10, 2023
@jt-nti jt-nti added this to the Version 1 milestone Feb 10, 2023
@jt-nti
Copy link
Member Author

jt-nti commented May 10, 2024

The following seem to work ok...

Labels:

  • app.kubernetes.io/component=chaincode
  • app.kubernetes.io/created-by=fabric-builder-k8s
  • app.kubernetes.io/managed-by=fabric-builder-k8s
  • app.kubernetes.io/name=hyperledger-fabric
  • fabric-builder-k8s-cchash=N6MMJOZJIFDXCMJO3XI2QE7O6WB56IJBYI24I6LXSLYUDJDNJNCQ

Annotations:

  • fabric-builder-k8s-ccid: go-contract:6f98c4bb29414771312eddd1a813eef583df2121c235c4797792f141a46d4b45
  • fabric-builder-k8s-mspid: Org1MSP
  • fabric-builder-k8s-peeraddress: host.minikube.internal:7052
  • fabric-builder-k8s-peerid: peer0.org1.example.com

I also wonder whether adding a fabric-builder-k8s-cclabel label might be possible. The k8s builder would need to validate the package label to ensure it's a valid kubernetes label value. That would be a builder specific restriction, which doesn't seem unreasonable since it's inside a kubernetes package.

jt-nti added a commit to jt-nti/fabric-builder-k8s that referenced this issue May 24, 2024
Base32 encode the package hash and validate the chaincode label in the
build phase

Move labels that cannot be guaranteed to be valid to annotations
instead

Closes hyperledger-labs#89

Signed-off-by: James Taylor <jamest@uk.ibm.com>
jt-nti added a commit to jt-nti/fabric-builder-k8s that referenced this issue May 24, 2024
Base32 encode the package hash and validate the chaincode label in the
build phase

Move labels that cannot be guaranteed to be valid to annotations
instead

Closes hyperledger-labs#89

Signed-off-by: James Taylor <jamest@uk.ibm.com>
jt-nti added a commit to jt-nti/fabric-builder-k8s that referenced this issue May 24, 2024
Base32 encode the package hash and validate the chaincode label in the
build phase

Move labels that cannot be guaranteed to be valid to annotations
instead

Closes hyperledger-labs#89

Signed-off-by: James Taylor <jamest@uk.ibm.com>
jt-nti added a commit to jt-nti/fabric-builder-k8s that referenced this issue May 24, 2024
Base32 encode the package hash and validate the chaincode label in the
build phase

Move labels that cannot be guaranteed to be valid to annotations
instead

Closes hyperledger-labs#89

Signed-off-by: James Taylor <jamest@uk.ibm.com>
jt-nti added a commit that referenced this issue May 24, 2024
Base32 encode the package hash and validate the chaincode label in the
build phase

Move labels that cannot be guaranteed to be valid to annotations
instead

Closes #89

Signed-off-by: James Taylor <jamest@uk.ibm.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working design Design discussions
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant