query

package
v0.9.0 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Nov 10, 2026 License: Apache-2.0 Imports: 7 Imported by: 0

Documentation

Overview

Copyright 2026 The BlanketOps Authors. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at

http://www.apache.org/licenses/LICENSE-2.0

Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License.

Package query provides the EnvironmentContext lookup used as step zero in every BlanketOps mediator.

Environment must pre-exist — it is the root of the delivery chain and the sole authority for platform bindings (store name, store kind, type). All composed CRs carry environments.blanketops.dev/name and environments.blanketops.dev/type labels to correlate back to their owning Environment.

Index

Constants

View Source
const (
	// LabelEnvironmentName is the name of the owning Environment CR.
	// Required on all BlanketOps composed CRs.
	LabelEnvironmentName = "environments.blanketops.dev/name"
	// LabelEnvironmentType is the environment classification.
	// e.g. dev, staging, production, testing
	LabelEnvironmentType = "environments.blanketops.dev/type"

	// StoreKindClusterSecretStore is the cluster-scoped ESO store kind.
	// The platform default — used whenever the Environment contract does
	// not declare a kind.
	StoreKindClusterSecretStore = "ClusterSecretStore"
	// StoreKindSecretStore is the namespaced ESO store kind.
	StoreKindSecretStore = "SecretStore"
)

Variables

This section is empty.

Functions

This section is empty.

Types

type EnvironmentContext

type EnvironmentContext struct {
	// Name of the Environment CR.
	Name string
	// EnvironmentType from environments.blanketops.dev/type label.
	EnvironmentType string
	// StoreName is the resolved secret store name.
	// Injected into all composed CR secret reconcilers.
	StoreName string
	// StoreKind is the resolved secret store kind — ClusterSecretStore or
	// SecretStore. Defaults to ClusterSecretStore when the contract does
	// not declare one. Injected into all composed CR secret reconcilers.
	StoreKind string
}

EnvironmentContext holds the resolved platform bindings for a given Environment CR. Returned by Lookup and passed into mediators.

func Lookup

func Lookup(ctx context.Context, c client.Client, namespace string, labels map[string]string) (*EnvironmentContext, error)

Lookup fetches the named Environment CR, resolves its contract, and returns the platform context needed by mediators.

Returns a non-nil error if:

  • environments.blanketops.dev/name label is missing
  • Environment CR does not exist — requeue, not terminal
  • Environment contract fails resolution
  • Environment contract declares an unrecognized store kind

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL