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

Add readonly property to Tekton Dashboard component #402

Merged
merged 1 commit into from
Sep 9, 2021
Merged

Add readonly property to Tekton Dashboard component #402

merged 1 commit into from
Sep 9, 2021

Conversation

MarcusNoble
Copy link
Contributor

@MarcusNoble MarcusNoble commented Sep 6, 2021

Changes

Fixes #399

Adds an optional boolean property to the TektonDashboard and the TektonConfig CRDs to control which variation of the Dashboard manifest is used.
If readonly is set to true the manifests with only the read RBAC permissions will be used.

Submitter Checklist

These are the criteria that every PR should meet, please check them off as you
review them:

See the contribution guide for more details.

Release Notes

Added `readonly` property to TektonDashboard to allow installing the Dashboard in read-only mode

@tekton-robot tekton-robot added release-note Denotes a PR that will be considered when it comes time to generate release notes. needs-ok-to-test Indicates a PR that requires an org member to verify it is safe to test. labels Sep 6, 2021
@tekton-robot
Copy link
Contributor

Hi @MarcusNoble. Thanks for your PR.

I'm waiting for a tektoncd member to verify that this patch is reasonable to test. If it is, they should reply with /ok-to-test on its own line. Until that is done, I will not automatically test new commits in this PR, but the usual testing commands by org members will still work. Regular contributors should join the org to skip this step.

Once the patch is verified, the new status will be reflected by the ok-to-test label.

I understand the commands that are listed here.

Instructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the kubernetes/test-infra repository.

@tekton-robot tekton-robot added the size/M Denotes a PR that changes 30-99 lines, ignoring generated files. label Sep 6, 2021
@nikhil-thomas
Copy link
Member

/ok-to-test

Comment on lines 23 to 24
if [[ ${releaseFileName} == "tekton-dashboard-release-readonly" ]]; then
dir="dashboard-readonly"
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

could we create sub-directories in dashboard dir instead of creating a new directory.
I would prefer that becuase operator-dev has an informal agreement that we keep 1 top level directory per TektonComponent. 🧑‍💻

@nikhil-thomas
Copy link
Member

overall the pr looks great.
It would be great if we could keep all dashboard related items in subdirectories inside a top level directory like kodata/dashboard.

Comment on lines 86 to 88
return filepath.Join(koDataDir, "tekton-dashboard-readonly")
}
return filepath.Join(koDataDir, "tekton-dashboard")
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

How about:

Suggested change
return filepath.Join(koDataDir, "tekton-dashboard-readonly")
}
return filepath.Join(koDataDir, "tekton-dashboard")
return filepath.Join(koDataDir, "tekton-dashboard/tekton-dashboard-readonly")
}
return filepath.Join(koDataDir, "tekton-dashboard/tekton-dashboard-fullaccess")

Comment on lines 86 to 88
return filepath.Join(koDataDir, "tekton-dashboard-readonly")
}
return filepath.Join(koDataDir, "tekton-dashboard")
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

How about:

Suggested change
return filepath.Join(koDataDir, "tekton-dashboard-readonly")
}
return filepath.Join(koDataDir, "tekton-dashboard")
return filepath.Join(koDataDir, "tekton-dashboard/tekton-dashboard-readonly")
}
return filepath.Join(koDataDir, "tekton-dashboard/tekton-dashboard-fullaccess")

@MarcusNoble
Copy link
Contributor Author

Thanks @nikhil-thomas. I've updated with those suggestions.

@nikhil-thomas
Copy link
Member

/ok-to-test

@tekton-robot tekton-robot added ok-to-test Indicates a non-member PR verified by an org member that is safe to test. and removed needs-ok-to-test Indicates a PR that requires an org member to verify it is safe to test. labels Sep 8, 2021
@nikhil-thomas
Copy link
Member

/approve

@tekton-robot tekton-robot added the approved Indicates a PR has been approved by an approver from all required OWNERS files. label Sep 8, 2021
@tekton-robot
Copy link
Contributor

The following is the coverage report on the affected files.
Say /test pull-tekton-operator-go-coverage to re-run this coverage report

File Old Coverage New Coverage Delta
pkg/reconciler/common/releases.go 63.6% 61.8% -1.9
pkg/reconciler/kubernetes/tektonconfig/extension/dashboard.go 58.6% 55.7% -2.9

@MarcusNoble
Copy link
Contributor Author

I'm having a bit of trouble running the hack/update-codegen.sh for this PR

# hack/update-codegen.sh  
Generating deepcopy funcs for operator:v1alpha1
Generating clientset for operator:v1alpha1 at github.com/tektoncd/operator/pkg/client/clientset
Generating listers for operator:v1alpha1 at github.com/tektoncd/operator/pkg/client/listers
Generating informers for operator:v1alpha1 at github.com/tektoncd/operator/pkg/client/informers
Generating injection for operator:v1alpha1 at github.com/tektoncd/operator/pkg/client/injection
go: downloading go.uber.org/automaxprocs v1.4.0
go: downloading go.uber.org/atomic v1.9.0
go: downloading github.com/googleapis/gnostic v0.5.3
go: downloading golang.org/x/time v0.0.0-20210611083556-38a9dc6acbc6
go: downloading golang.org/x/net v0.0.0-20210825183410-e898025ed96a
go: downloading golang.org/x/oauth2 v0.0.0-20210819190943-2bc19b11175f
go: downloading google.golang.org/grpc v1.40.0
verifying github.com/googleapis/[email protected]: checksum mismatch
        downloaded: h1:FP6YXyar5+eeXU8lBWDHJMZLHinornnILMJYBLgqKXk=
        go.sum:     h1:2qsuRm+bzgwSIKikigPASa2GhW8H2Dn4Qq7UxD8K/48=

SECURITY ERROR
This download does NOT match an earlier download recorded in go.sum.
The bits may have been replaced on the origin server, or an attacker may
have intercepted the download attempt.

Anyone have any ideas what I may be missing?

@sm43
Copy link
Member

sm43 commented Sep 9, 2021

@MarcusNoble could you rebase and then try again? :)

@MarcusNoble
Copy link
Contributor Author

@sm43 Same problem I'm afraid.

@tekton-robot
Copy link
Contributor

The following is the coverage report on the affected files.
Say /test pull-tekton-operator-go-coverage to re-run this coverage report

File Old Coverage New Coverage Delta
pkg/reconciler/common/releases.go 63.6% 61.8% -1.9
pkg/reconciler/kubernetes/tektonconfig/extension/dashboard.go 58.6% 55.7% -2.9

Adds an optional boolean property to the TektonDashboard and the TektonConfig CRDs to control which version of the Dashboard manifest is used. If readonly is set to true the manifests with only the read RBAC permissions will be used.

Signed-off-by: Vincent Demeester <[email protected]>
@tekton-robot tekton-robot added size/L Denotes a PR that changes 100-499 lines, ignoring generated files. and removed size/M Denotes a PR that changes 30-99 lines, ignoring generated files. labels Sep 9, 2021
@vdemeester
Copy link
Member

@MarcusNoble hum, interesting, I didn't run into this when doing it. I've amended your commit with the fixed codegen/dep updates.

Copy link
Member

@vdemeester vdemeester left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

/lgtm

@tekton-robot tekton-robot added the lgtm Indicates that a PR is ready to be merged. label Sep 9, 2021
@tekton-robot
Copy link
Contributor

[APPROVALNOTIFIER] This PR is APPROVED

This pull-request has been approved by: nikhil-thomas, vdemeester

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:
  • OWNERS [nikhil-thomas,vdemeester]

Approvers can indicate their approval by writing /approve in a comment
Approvers can cancel approval by writing /approve cancel in a comment

@tekton-robot
Copy link
Contributor

The following is the coverage report on the affected files.
Say /test pull-tekton-operator-go-coverage to re-run this coverage report

File Old Coverage New Coverage Delta
pkg/reconciler/common/releases.go 63.6% 61.8% -1.9
pkg/reconciler/kubernetes/tektonconfig/extension/dashboard.go 58.6% 55.7% -2.9

@tekton-robot tekton-robot merged commit 75c06f1 into tektoncd:main Sep 9, 2021
@MarcusNoble
Copy link
Contributor Author

Thanks @vdemeester. I'm guessing it's something I've got messed up in my env.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
approved Indicates a PR has been approved by an approver from all required OWNERS files. lgtm Indicates that a PR is ready to be merged. ok-to-test Indicates a non-member PR verified by an org member that is safe to test. release-note Denotes a PR that will be considered when it comes time to generate release notes. size/L Denotes a PR that changes 100-499 lines, ignoring generated files.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Read-only option for Dashboard
5 participants