Skip to content

Commit 43e2ce6

Browse files
committed
Remove support for deprecated apis
Remove support for eval, safety and related apis Signed-off-by: Vaishnavi Hire <vhire@redhat.com> Assisted-by : claude-4.6-opus
1 parent 6d28968 commit 43e2ce6

22 files changed

Lines changed: 55 additions & 460 deletions

api/v1alpha1/llamastackdistribution_conversion_test.go

Lines changed: 9 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -504,8 +504,8 @@ func TestRoundTripV1Alpha2Providers(t *testing.T) {
504504
Inference: []v1alpha2.ProviderConfig{
505505
{ID: "vllm-1", Provider: "vllm", Endpoint: "http://vllm:8000", Settings: &settings},
506506
},
507-
Safety: []v1alpha2.ProviderConfig{
508-
{Provider: "llama-guard"},
507+
Telemetry: []v1alpha2.ProviderConfig{
508+
{Provider: "otel"},
509509
},
510510
},
511511
},
@@ -525,8 +525,8 @@ func TestRoundTripV1Alpha2Providers(t *testing.T) {
525525
assert.Equal(t, "http://vllm:8000", roundtripped.Spec.Providers.Inference[0].Endpoint)
526526
require.NotNil(t, roundtripped.Spec.Providers.Inference[0].Settings)
527527
assert.JSONEq(t, `{"temperature":0.7}`, string(roundtripped.Spec.Providers.Inference[0].Settings.Raw))
528-
require.Len(t, roundtripped.Spec.Providers.Safety, 1)
529-
assert.Equal(t, "llama-guard", roundtripped.Spec.Providers.Safety[0].Provider)
528+
require.Len(t, roundtripped.Spec.Providers.Telemetry, 1)
529+
assert.Equal(t, "otel", roundtripped.Spec.Providers.Telemetry[0].Provider)
530530
}
531531

532532
func TestRoundTripV1Alpha2Resources(t *testing.T) {
@@ -539,8 +539,7 @@ func TestRoundTripV1Alpha2Resources(t *testing.T) {
539539
Models: []v1alpha2.ModelConfig{
540540
{Name: "llama3", Provider: "vllm", ContextLength: &ctxLen, ModelType: "llm"},
541541
},
542-
Tools: []string{"code_interpreter"},
543-
Shields: []string{"llama-guard"},
542+
Tools: []string{"code_interpreter"},
544543
},
545544
},
546545
}
@@ -559,7 +558,6 @@ func TestRoundTripV1Alpha2Resources(t *testing.T) {
559558
assert.Equal(t, 8192, *roundtripped.Spec.Resources.Models[0].ContextLength)
560559
assert.Equal(t, "llm", roundtripped.Spec.Resources.Models[0].ModelType)
561560
assert.Equal(t, []string{"code_interpreter"}, roundtripped.Spec.Resources.Tools)
562-
assert.Equal(t, []string{"llama-guard"}, roundtripped.Spec.Resources.Shields)
563561
}
564562

565563
func TestRoundTripV1Alpha2Storage(t *testing.T) {
@@ -605,7 +603,7 @@ func TestRoundTripV1Alpha2Disabled(t *testing.T) {
605603
ObjectMeta: metav1.ObjectMeta{Name: "test", Namespace: "default"},
606604
Spec: v1alpha2.LlamaStackDistributionSpec{
607605
Distribution: v1alpha2.DistributionSpec{Name: "starter"},
608-
Disabled: []string{"safety", "telemetry"},
606+
Disabled: []string{"agents", "telemetry"},
609607
},
610608
}
611609

@@ -615,7 +613,7 @@ func TestRoundTripV1Alpha2Disabled(t *testing.T) {
615613
roundtripped := &v1alpha2.LlamaStackDistribution{}
616614
require.NoError(t, v1.ConvertTo(roundtripped))
617615

618-
assert.Equal(t, []string{"safety", "telemetry"}, roundtripped.Spec.Disabled)
616+
assert.Equal(t, []string{"agents", "telemetry"}, roundtripped.Spec.Disabled)
619617
}
620618

621619
func TestRoundTripV1Alpha2ExternalProviders(t *testing.T) {
@@ -724,7 +722,7 @@ func TestRoundTripV1Alpha2FullCR(t *testing.T) {
724722
Storage: &v1alpha2.StateStorageSpec{
725723
SQL: &v1alpha2.SQLStorageSpec{Type: "sqlite"},
726724
},
727-
Disabled: []string{"safety"},
725+
Disabled: []string{"agents"},
728726
Networking: &v1alpha2.NetworkingSpec{
729727
Port: 9000,
730728
Expose: &v1alpha2.ExposeConfig{Hostname: "llama.example.com"},
@@ -764,7 +762,7 @@ func TestRoundTripV1Alpha2FullCR(t *testing.T) {
764762
require.NotNil(t, roundtripped.Spec.Storage)
765763
assert.Equal(t, "sqlite", roundtripped.Spec.Storage.SQL.Type)
766764

767-
assert.Equal(t, []string{"safety"}, roundtripped.Spec.Disabled)
765+
assert.Equal(t, []string{"agents"}, roundtripped.Spec.Disabled)
768766

769767
require.NotNil(t, roundtripped.Spec.Networking.Expose)
770768
assert.Equal(t, "llama.example.com", roundtripped.Spec.Networking.Expose.Hostname)

api/v1alpha2/llamastackdistribution_types.go

Lines changed: 3 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -106,11 +106,6 @@ type ProvidersSpec struct {
106106
// +kubebuilder:validation:MinItems=1
107107
// +kubebuilder:validation:XValidation:rule="self.size() <= 1 || self.all(p, has(p.id))",message="each provider must have an explicit id when multiple providers are specified"
108108
Inference []ProviderConfig `json:"inference,omitempty"`
109-
// Safety configures safety providers (e.g., llama-guard).
110-
// +optional
111-
// +kubebuilder:validation:MinItems=1
112-
// +kubebuilder:validation:XValidation:rule="self.size() <= 1 || self.all(p, has(p.id))",message="each provider must have an explicit id when multiple providers are specified"
113-
Safety []ProviderConfig `json:"safety,omitempty"`
114109
// VectorIo configures vector I/O providers (e.g., pgvector, chromadb).
115110
// +optional
116111
// +kubebuilder:validation:MinItems=1
@@ -152,7 +147,7 @@ type ModelConfig struct {
152147
Quantization string `json:"quantization,omitempty"`
153148
}
154149

155-
// ResourcesSpec defines declarative registration of models, tools, and shields.
150+
// ResourcesSpec defines declarative registration of models and tools.
156151
type ResourcesSpec struct {
157152
// Models to register with inference providers.
158153
// +optional
@@ -163,11 +158,6 @@ type ResourcesSpec struct {
163158
// +kubebuilder:validation:MinItems=1
164159
// +kubebuilder:validation:items:MinLength=1
165160
Tools []string `json:"tools,omitempty"`
166-
// Shields are safety shield names to register with the safety provider.
167-
// +optional
168-
// +kubebuilder:validation:MinItems=1
169-
// +kubebuilder:validation:items:MinLength=1
170-
Shields []string `json:"shields,omitempty"`
171161
}
172162

173163
// KVStorageSpec configures the key-value storage backend.
@@ -423,16 +413,11 @@ type ExternalProvidersSpec struct {
423413
// +kubebuilder:validation:XValidation:rule="!has(self.overrideConfig) || !has(self.storage)",message="overrideConfig and storage are mutually exclusive"
424414
// +kubebuilder:validation:XValidation:rule="!has(self.overrideConfig) || !has(self.disabled)",message="overrideConfig and disabled are mutually exclusive"
425415
// +kubebuilder:validation:XValidation:rule="!has(self.providers) || !has(self.disabled) || !self.disabled.exists(d, d == 'inference') || !has(self.providers.inference) || self.providers.inference.size() == 0",message="inference cannot be both in providers and disabled"
426-
// +kubebuilder:validation:XValidation:rule="!has(self.providers) || !has(self.disabled) || !self.disabled.exists(d, d == 'safety') || !has(self.providers.safety) || self.providers.safety.size() == 0",message="safety cannot be both in providers and disabled"
427416
// +kubebuilder:validation:XValidation:rule="!has(self.providers) || !has(self.disabled) || !self.disabled.exists(d, d == 'vector_io') || !has(self.providers.vectorIo) || self.providers.vectorIo.size() == 0",message="vector_io cannot be both in providers and disabled"
428417
// +kubebuilder:validation:XValidation:rule="!has(self.providers) || !has(self.disabled) || !self.disabled.exists(d, d == 'tool_runtime') || !has(self.providers.toolRuntime) || self.providers.toolRuntime.size() == 0",message="tool_runtime cannot be both in providers and disabled"
429418
// +kubebuilder:validation:XValidation:rule="!has(self.providers) || !has(self.disabled) || !self.disabled.exists(d, d == 'telemetry') || !has(self.providers.telemetry) || self.providers.telemetry.size() == 0",message="telemetry cannot be both in providers and disabled"
430419
//
431420
//nolint:lll // kubebuilder markers cannot be split across lines.
432-
//nolint:lll // kubebuilder markers cannot be split across lines.
433-
//nolint:lll // kubebuilder markers cannot be split across lines.
434-
//nolint:lll // kubebuilder markers cannot be split across lines.
435-
//nolint:lll // kubebuilder markers cannot be split across lines.
436421
type LlamaStackDistributionSpec struct {
437422
// Distribution identifies the LlamaStack distribution to deploy.
438423
// +kubebuilder:validation:Required
@@ -441,7 +426,7 @@ type LlamaStackDistributionSpec struct {
441426
// Mutually exclusive with overrideConfig.
442427
// +optional
443428
Providers *ProvidersSpec `json:"providers,omitempty"`
444-
// Resources declares models, tools, and shields to register.
429+
// Resources declares models and tools to register.
445430
// Mutually exclusive with overrideConfig.
446431
// +optional
447432
Resources *ResourcesSpec `json:"resources,omitempty"`
@@ -453,7 +438,7 @@ type LlamaStackDistributionSpec struct {
453438
// Mutually exclusive with overrideConfig.
454439
// +optional
455440
// +kubebuilder:validation:MinItems=1
456-
// +kubebuilder:validation:items:Enum=agents;datasetio;eval;inference;safety;scoring;telemetry;tool_runtime;vector_io
441+
// +kubebuilder:validation:items:Enum=agents;inference;telemetry;tool_runtime;vector_io
457442
Disabled []string `json:"disabled,omitempty"`
458443
// Networking consolidates network configuration.
459444
// +optional

api/v1alpha2/llamastackdistribution_webhook.go

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -117,7 +117,6 @@ func validateProviderIDUniqueness(spec *ProvidersSpec) field.ErrorList {
117117
configs []ProviderConfig
118118
}{
119119
{"inference", spec.Inference},
120-
{"safety", spec.Safety},
121120
{"vectorIo", spec.VectorIo},
122121
{"toolRuntime", spec.ToolRuntime},
123122
{"telemetry", spec.Telemetry},
@@ -203,7 +202,6 @@ func collectAllProviderIDs(spec *ProvidersSpec) map[string]bool {
203202
ids := make(map[string]bool)
204203
for _, slice := range [][]ProviderConfig{
205204
spec.Inference,
206-
spec.Safety,
207205
spec.VectorIo,
208206
spec.ToolRuntime,
209207
spec.Telemetry,

api/v1alpha2/llamastackdistribution_webhook_test.go

Lines changed: 8 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -80,7 +80,7 @@ func TestValidateDistributionNameEmptyRegistry(t *testing.T) {
8080
func TestProviderIDUniquenessNoDuplicates(t *testing.T) {
8181
spec := &ProvidersSpec{
8282
Inference: []ProviderConfig{{Provider: "vllm"}},
83-
Safety: []ProviderConfig{{Provider: "llama-guard"}},
83+
Telemetry: []ProviderConfig{{Provider: "otel"}},
8484
}
8585
errs := validateProviderIDUniqueness(spec)
8686
assert.Empty(t, errs)
@@ -89,7 +89,7 @@ func TestProviderIDUniquenessNoDuplicates(t *testing.T) {
8989
func TestProviderIDUniquenessExplicitIDs(t *testing.T) {
9090
spec := &ProvidersSpec{
9191
Inference: []ProviderConfig{{ID: "my-provider", Provider: "vllm"}},
92-
Safety: []ProviderConfig{{ID: "my-provider", Provider: "llama-guard"}},
92+
Telemetry: []ProviderConfig{{ID: "my-provider", Provider: "otel"}},
9393
}
9494
errs := validateProviderIDUniqueness(spec)
9595
require.Len(t, errs, 1)
@@ -114,12 +114,12 @@ func TestProviderIDUniquenessEmptySlices(t *testing.T) {
114114

115115
func TestProviderIDUniquenessMultipleCollisions(t *testing.T) {
116116
spec := &ProvidersSpec{
117-
Inference: []ProviderConfig{{ID: "dup", Provider: "vllm"}},
118-
Safety: []ProviderConfig{{ID: "dup", Provider: "guard"}},
119-
Telemetry: []ProviderConfig{{ID: "dup", Provider: "otel"}},
117+
Inference: []ProviderConfig{{ID: "dup", Provider: "vllm"}},
118+
VectorIo: []ProviderConfig{{ID: "dup", Provider: "pgvector"}},
119+
Telemetry: []ProviderConfig{{ID: "dup", Provider: "otel"}},
120120
}
121121
errs := validateProviderIDUniqueness(spec)
122-
assert.Len(t, errs, 2, "should report conflict for safety and telemetry")
122+
assert.Len(t, errs, 2, "should report conflict for vectorIo and telemetry")
123123
}
124124

125125
// --- Provider reference validation ---
@@ -188,16 +188,14 @@ func TestCollectAllProviderIDs(t *testing.T) {
188188
{ID: "my-vllm", Provider: "vllm"},
189189
{Provider: "remote::ollama"},
190190
},
191-
Safety: []ProviderConfig{{Provider: "llama-guard"}},
192191
VectorIo: []ProviderConfig{{ID: "pgvec", Provider: "pgvector"}},
193192
}
194193

195194
ids := collectAllProviderIDs(spec)
196195
assert.True(t, ids["my-vllm"])
197196
assert.True(t, ids["ollama"], "remote::ollama derives to ollama")
198-
assert.True(t, ids["llama-guard"])
199197
assert.True(t, ids["pgvec"])
200-
assert.Len(t, ids, 4)
198+
assert.Len(t, ids, 3)
201199
}
202200

203201
// --- Full validate (integration-style) ---
@@ -236,7 +234,7 @@ func TestValidateCreateRejectsDuplicateProviderIDs(t *testing.T) {
236234
Distribution: DistributionSpec{Name: "starter"},
237235
Providers: &ProvidersSpec{
238236
Inference: []ProviderConfig{{ID: "dup", Provider: "vllm"}},
239-
Safety: []ProviderConfig{{ID: "dup", Provider: "guard"}},
237+
Telemetry: []ProviderConfig{{ID: "dup", Provider: "otel"}},
240238
},
241239
})
242240

api/v1alpha2/zz_generated.deepcopy.go

Lines changed: 0 additions & 12 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

config/crd/bases/llamastack.io_llamastackdistributions.yaml

Lines changed: 1 addition & 83 deletions
Original file line numberDiff line numberDiff line change
@@ -2838,11 +2838,7 @@ spec:
28382838
items:
28392839
enum:
28402840
- agents
2841-
- datasetio
2842-
- eval
28432841
- inference
2844-
- safety
2845-
- scoring
28462842
- telemetry
28472843
- tool_runtime
28482844
- vector_io
@@ -3041,72 +3037,6 @@ spec:
30413037
- message: each provider must have an explicit id when multiple
30423038
providers are specified
30433039
rule: self.size() <= 1 || self.all(p, has(p.id))
3044-
safety:
3045-
description: Safety configures safety providers (e.g., llama-guard).
3046-
items:
3047-
description: ProviderConfig defines the configuration for a
3048-
single LlamaStack provider instance.
3049-
properties:
3050-
endpoint:
3051-
description: Endpoint is the provider endpoint URL. Maps
3052-
to config.url in config.yaml.
3053-
type: string
3054-
id:
3055-
description: |-
3056-
ID is a unique provider identifier. Required when multiple providers are
3057-
configured for the same API type. Auto-generated from provider when omitted
3058-
for single-provider configurations.
3059-
type: string
3060-
provider:
3061-
description: |-
3062-
Provider is the provider type (e.g., "vllm", "llama-guard", "pgvector").
3063-
Maps to provider_type with "remote::" prefix in config.yaml.
3064-
minLength: 1
3065-
type: string
3066-
secretRefs:
3067-
additionalProperties:
3068-
description: SecretKeyRef references a specific key in
3069-
a Kubernetes Secret.
3070-
properties:
3071-
key:
3072-
description: Key is the key within the Secret.
3073-
minLength: 1
3074-
type: string
3075-
name:
3076-
description: Name is the name of the Kubernetes Secret.
3077-
minLength: 1
3078-
type: string
3079-
required:
3080-
- key
3081-
- name
3082-
type: object
3083-
description: |-
3084-
SecretRefs is a map of named secret references for provider-specific
3085-
connection fields (e.g., host, password). Each key becomes the env var
3086-
field suffix and maps to config.<key> with env var substitution:
3087-
${env.LLSD_<PROVIDER_ID>_<KEY>}. Use this instead of embedding
3088-
secretKeyRef inside settings.
3089-
minProperties: 1
3090-
type: object
3091-
settings:
3092-
description: |-
3093-
Settings contains provider-specific settings merged into the provider's
3094-
config section in config.yaml. Acts as an escape hatch for fields not
3095-
directly exposed in the CRD schema. Passed through as-is without any
3096-
secret resolution. Use secretRefs for secret values.
3097-
x-kubernetes-preserve-unknown-fields: true
3098-
required:
3099-
- provider
3100-
type: object
3101-
x-kubernetes-validations:
3102-
- message: id must not be empty if specified
3103-
rule: '!has(self.id) || self.id.size() > 0'
3104-
minItems: 1
3105-
type: array
3106-
x-kubernetes-validations:
3107-
- message: each provider must have an explicit id when multiple
3108-
providers are specified
3109-
rule: self.size() <= 1 || self.all(p, has(p.id))
31103040
telemetry:
31113041
description: Telemetry configures telemetry providers (e.g., opentelemetry).
31123042
items:
@@ -3309,7 +3239,7 @@ spec:
33093239
type: object
33103240
resources:
33113241
description: |-
3312-
Resources declares models, tools, and shields to register.
3242+
Resources declares models and tools to register.
33133243
Mutually exclusive with overrideConfig.
33143244
properties:
33153245
models:
@@ -3349,14 +3279,6 @@ spec:
33493279
> 0'
33503280
minItems: 1
33513281
type: array
3352-
shields:
3353-
description: Shields are safety shield names to register with
3354-
the safety provider.
3355-
items:
3356-
minLength: 1
3357-
type: string
3358-
minItems: 1
3359-
type: array
33603282
tools:
33613283
description: Tools are tool group names to register with the toolRuntime
33623284
provider.
@@ -5937,10 +5859,6 @@ spec:
59375859
rule: '!has(self.providers) || !has(self.disabled) || !self.disabled.exists(d,
59385860
d == ''inference'') || !has(self.providers.inference) || self.providers.inference.size()
59395861
== 0'
5940-
- message: safety cannot be both in providers and disabled
5941-
rule: '!has(self.providers) || !has(self.disabled) || !self.disabled.exists(d,
5942-
d == ''safety'') || !has(self.providers.safety) || self.providers.safety.size()
5943-
== 0'
59445862
- message: vector_io cannot be both in providers and disabled
59455863
rule: '!has(self.providers) || !has(self.disabled) || !self.disabled.exists(d,
59465864
d == ''vector_io'') || !has(self.providers.vectorIo) || self.providers.vectorIo.size()

config/samples/v1alpha2/example-vllm-postgres.yaml

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -42,8 +42,6 @@ spec:
4242
connectionString:
4343
name: pg-credentials
4444
key: dsn
45-
disabled:
46-
- safety
4745
workload:
4846
replicas: 2
4947
resources:

controllers/v1alpha2_config.go

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -410,7 +410,6 @@ func collectProviderIDs(spec *v1alpha2.ProvidersSpec) map[string]bool {
410410

411411
for _, slice := range [][]v1alpha2.ProviderConfig{
412412
spec.Inference,
413-
spec.Safety,
414413
spec.VectorIo,
415414
spec.ToolRuntime,
416415
spec.Telemetry,

0 commit comments

Comments
 (0)