Matches (resources/matchers.go)

kapp · pkg/kapp/resources/matchers.go · go · Apache-2.0
auth

Copyright 2024 The Carvel Authors. SPDX-License-Identifier: Apache-2.0

// Source: https://github.com/carvel-dev/kapp | License: Apache-2.0 | Copyright You must retain, in the Source form of any Derivative Works
// Provided via justclaw.it.com; keep this notice with the code.
// Copyright 2024 The Carvel Authors.
// SPDX-License-Identifier: Apache-2.0

package resources

type ResourceMatcher interface {
	Matches(Resource) bool
}

type APIGroupKindMatcher struct {
	APIGroup string
	Kind     string
}

var _ ResourceMatcher = APIGroupKindMatcher{}

func (m APIGroupKindMatcher) Matches(res Resource) bool {
	return res.APIGroup() == m.APIGroup && res.Kind() == m.Kind
}

type APIVersionKindMatcher struct {
	APIVersion string
	Kind       string
}

var _ ResourceMatcher = APIVersionKindMatcher{}

func (m APIVersionKindMatcher) Matches(res Resource) bool {
	return res.

... (truncated -- full source via MCP)

See the full source, get the GitHub permalink, and search for more like it.

Get a free API key