Business
Jobs
  • About Us
  • Solutions
    • Job Postings
      Post your job and receive qualified candidates in 48h.
    • Candidate Assessments
      500+ technical and psychological tests, plus anti-fraud.
    • Headhunting
      Tailor-made executive search from start to finish.
    • Payroll + EOR
      Payroll dispersal and EOR across 15+ LATAM countries.
  • Pricing
  • Jobs

0

299
Views
Filter secret objects by label in client-go

I am trying to get some secret objects from my cluster using the k8s go client library as follows

secret, err := clientset.CoreV1().Secrets("mynamespace").Get("name-of-my-secret", metav1.GetOptions{})

This worked well as long as I had to get just one object.

I have a case now where I need to fetch several such secret objects, however this now has to be done based on labels. (i.e. fetch all such secret objects matching the foo=someprovider.someurl.com/path1=value1 label)

I don't see however in the relevant docs a way to pass label selectors to the GetOptions struct that I assume performs such kind of filtering.

Any suggestions on how to select (potentially multiple) such resources based on labels?

over 4 years ago · Santiago Trujillo
1 answers
Answer question

0

clientset.CoreV1().Secrets("").List(context.TODO(), metav1.ListOptions{LabelSelector: "k8s-app=kube-proxy"})
over 4 years ago · Santiago Trujillo Report
Answer question
Find remote jobs

Discover the new way to find a job!

Top jobs
Top job categories
Business
Post vacancy Pricing Sales
Legal
Terms and conditions Privacy policy
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Show me some job opportunities
There's an error!