Empresas
Empregos
  • Sobre nós
  • Soluções
    • Publicação de vagas
      Publique sua vaga e receba candidatos qualificados em 48h.
    • Avaliações de candidatos
      Mais de 500 testes técnicos e psicológicos, mais anti-fraude.
    • Headhunting
      Busca executiva personalizada do início ao fim.
    • Folha de Pagamento + EOR
      Dispersão de folha e EOR em mais de 15 países da LATAM.
  • Preços
  • Empregos

0

300
Visualizações
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 Respostas
Responde à pergunta

0

clientset.CoreV1().Secrets("").List(context.TODO(), metav1.ListOptions{LabelSelector: "k8s-app=kube-proxy"})
over 4 years ago · Santiago Trujillo Relatório
Responde à pergunta
Encontrar trabalhos remotos

Descubra a nova forma de encontrar um emprego!

melhores empregos
Principais categorias de trabalho
Empresas
Postar vaga Preços Comercial
Jurídico
Termos e Condições Política de privacidade
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Recomende algumas ofertas para mim
Preciso de ajuda