Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
81 changes: 40 additions & 41 deletions Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

4 changes: 3 additions & 1 deletion Tiltfile
Original file line number Diff line number Diff line change
Expand Up @@ -120,6 +120,7 @@ ac_flags = [
'--set=agentControlDeployment.chartValues.config.cdRemoteUpdate=' + enable_cd_remote_update,
'--version=>=0.0.0-beta',
'--set=agentControlDeployment.chartValues.image.imagePullPolicy=Always',
'--set=agentControlDeployment.chartValues.toolkitImage.imagePullPolicy=Always',
'--values=' + sa_chart_values_file,
]

Expand Down Expand Up @@ -193,7 +194,8 @@ helm_resource(
flags=ac_flags,
image_deps=['tilt.local/agent-control-dev', 'tilt.local/agent-control-cli-dev'],
image_keys=[('agentControlDeployment.chartValues.image.registry', 'agentControlDeployment.chartValues.image.repository', 'agentControlDeployment.chartValues.image.tag'),
[('toolkitImage.registry', 'toolkitImage.repository', 'toolkitImage.tag')]],
[('agentControlDeployment.chartValues.toolkitImage.registry', 'agentControlDeployment.chartValues.toolkitImage.repository', 'agentControlDeployment.chartValues.toolkitImage.tag'),
('toolkitImage.registry', 'toolkitImage.repository', 'toolkitImage.tag')]],
resource_deps=ac_chart_deps
)

Expand Down
2 changes: 1 addition & 1 deletion agent-control/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@ semver = { workspace = true, features = ["serde"] }
chrono = { workspace = true }
base64 = { version = "0.22.1" }
# New Relic dependencies (external repos)
nr-auth = { git = "https://github.com/newrelic/newrelic-auth-rs.git", tag = "0.2.0" }
Comment thread
sigilioso marked this conversation as resolved.
nr-auth = { git = "https://github.com/newrelic/newrelic-auth-rs.git", tag = "0.4.0" }
opamp-client = { git = "https://github.com/newrelic/newrelic-opamp-rs.git", tag = "0.0.36" }
# local dependencies
fs = { path = "../fs" }
Expand Down
12 changes: 8 additions & 4 deletions agent-control/src/agent_control/config.rs
Original file line number Diff line number Diff line change
Expand Up @@ -391,6 +391,13 @@ pub fn deployment_type_meta() -> TypeMeta {
}
}

pub fn secret_type_meta() -> TypeMeta {
TypeMeta {
api_version: "v1".to_string(),
kind: "Secret".to_string(),
}
}

pub fn default_group_version_kinds() -> Vec<TypeMeta> {
// In flux health check we are currently supporting just a single helm_release_type_meta
// Each time we support a new version we should decide if and how to support retrieving its health
Expand All @@ -400,10 +407,7 @@ pub fn default_group_version_kinds() -> Vec<TypeMeta> {
instrumentation_v1beta3_type_meta(),
// This allows Secrets created as dynamic objects to be cleaned up by the GC
// This should not be needed anymore whenever the GC detection logic doesn't rely on this list.
TypeMeta {
api_version: "v1".to_string(),
kind: "Secret".to_string(),
},
secret_type_meta(),
helmrepository_type_meta(),
helmrelease_v2_type_meta(),
]
Expand Down
15 changes: 14 additions & 1 deletion agent-control/src/bin/main_agent_control_k8s_cli.rs
Original file line number Diff line number Diff line change
@@ -1,8 +1,10 @@
use clap::{Parser, Subcommand};
use clap::error::ErrorKind;
use clap::{CommandFactory, Parser, Subcommand};
use newrelic_agent_control::cli::common::{error::CliError, logs};
use newrelic_agent_control::cli::k8s::install::agent_control::InstallAgentControl;
use newrelic_agent_control::cli::k8s::install::flux::InstallFlux;
use newrelic_agent_control::cli::k8s::install::{InstallData, apply_resources};
use newrelic_agent_control::cli::k8s::system_identity::{self, register_system_identity};
use newrelic_agent_control::cli::k8s::uninstall::agent_control::{
AgentControlUninstallData, uninstall_agent_control,
};
Expand Down Expand Up @@ -41,6 +43,9 @@ enum Operations {
/// Remove the resources created to handled the Continuous Deployment utility
#[clap(name = "remove-cd-resources")]
RemoveCDResources(FluxUninstallData),

/// Registers the System Identity to be used in Agent Control for authentication.
RegisterSystemIdentity(system_identity::Args),
Comment thread
sigilioso marked this conversation as resolved.
}

fn main() -> ExitCode {
Expand All @@ -67,6 +72,14 @@ fn main() -> ExitCode {
Operations::RemoveCDResources(cd_data) => {
remove_flux_crs(&cli.namespace, &cd_data.release_name)
}
Operations::RegisterSystemIdentity(args) => match args.validate() {
Ok(spec) => register_system_identity(&cli.namespace, spec),
Err(err) => {
let mut cmd = Cli::command();
cmd.error(ErrorKind::ArgumentConflict, err.to_string())
.exit()
}
},
};

match result {
Expand Down
2 changes: 1 addition & 1 deletion agent-control/src/bin/main_agent_control_onhost_cli.rs
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@ fn main() -> ExitCode {

let result = match cli.command {
Commands::GenerateConfig(args) => match args.validate() {
Ok(inputs) => config_gen::generate(inputs),
Ok(params) => config_gen::generate(params),
Err(err) => {
let mut cmd = Cli::command();
cmd.error(ErrorKind::ArgumentConflict, err.to_string())
Expand Down
Loading
Loading